query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Check if the user is logged in
public function preDispatch() { parent::preDispatch(); if (!Mage::getSingleton('customer/session')->authenticate($this)) { $this->setFlag('', 'no-dispatch', true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "public function loggedIn()\n {\n if($this->di->session->get('user'))\n {\n return true;\n }\n return false;\n }", "public function isLoggedIn()\n {\n return isset($_SESSION['user']);\n }", "public function isLoggedIn()\n {\n if(Session::get('user_id') != '') {\n $this->user_id=Session::get('user_id');\n $this->role_id=Session::get('role_id');\n return true;\n }else {\n return false;\n }\n }", "public function loggedIn()\n {\n if ($this->userId) {\n return true;\n } else {\n return false;\n }\n }", "public function is_logged_in() {\n\n\t}", "public function isLoggedIn()\n {\n return $this->session->has('user');\n }", "public function isUserLoggedIn() {\r\n\t\treturn ($this->coreAuthenticationFactory->isUserLoggedIn ());\r\n\t}", "public function logged_in()\n {\n if (isset($_SESSION['user_data'])) {\n return true;\n } else {\n return false;\n }\n }", "public static function isLoggedIn()\n {\n return (bool)Users::getCurrentUser();\n }", "public function isUserLoggedIn()\n {\n return $this->user_is_logged_in;\n }", "public function loggedIn()\n {\n if(isset($_SESSION['user']) && !empty($_SESSION['user'])) {\n return true;\n }\n\n return false;\n }", "public function isLoggedIn()\n {\n return ($this->userInfo->userid ? true : false);\n }", "private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }", "public function isLoggedIn()\n {\n return true;\n }", "public function loggedIn(){\r\n if (isset($_SESSION['user_session']))\r\n return true;\r\n else\r\n return false;\r\n }", "public function isLoggedIn();", "public function isLoggedIn();", "static function isLoggedIn() {\n $user = self::currentUser();\n return isset($user) && $user != null;\n }", "public function is_loggedin()\n {\n if (isset($_SESSION['user_session'])) {\n return true;\n }\n }", "function is_logged_in()\n\t{\n\t\treturn require_login();\n\t}", "public function is_user_logged_in(){\n\t\treturn $this->session->userdata('current_user_id') != FALSE;\n\t}", "private function checkUserLoggedIn(): bool\n {\n $user = JFactory::getUser();\n if ($user->id > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function loggedIn()\n {\n return $this->user() != null;\n }", "function is_logged_in()\n {\n //check session\n //return logged in user_id or false\n }", "function is_logged_in() \n {\n return (empty($this->userID) || $this->userID == \"\") ? false : true;\n }", "public function userIsLoggedIn() {\n return auth()->check() ;\n }", "public function isUserLoggedIn()\n {\n return (isset($this->session->sUserId) && !empty($this->session->sUserId));\n }", "public function is_loggedin(){\n if(isset($_SESSION['user_session'])){\n return true;\n }\n return false;\n }", "public function isloggedin()\n {\n return Session::userIsLoggedIn();\n }", "public function isLoggedIn(){\n // Apakah user_session sudah ada di session\n if(isset($_SESSION['user_session']))\n {\n return true;\n }\n }", "public function isUserLoggedIn() \n {\n if (!isset($_SESSION['user_id']) || !isset($_SESSION['is_logged_in'])) {\n return false;\n } else {\n return true;\n }\n }", "public function isLoggedIn()\n {\n $userId = $this->session->offsetGet('sUserId');\n\n return !empty($userId);\n }", "public function isLoggedIn()\n {\n $userId = $this->session->offsetGet('sUserId');\n\n return !empty($userId);\n }", "public function is_logged_in()\n {\n return isset($this->user);\n }", "function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }", "public static function loggedIn(): bool\n {\n // Check if user is in the session\n return isset($_SESSION['user']);\n }", "public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }", "protected function isLoggedIn()\n\t{\n\t\treturn is_user_logged_in();\n\t}", "private function if_user_logged_in()\n {\n\n session_start();\n\n if(!empty($_SESSION)){\n\n if(isset($_SESSION[\"user_id\"]) && isset($_SESSION[\"user_type\"])){\n \n return true;\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n }", "function wv_is_user_loggedin() {\n $output = 0;\n if (is_user_logged_in()) {\n $output = 1;\n } else {\n $output = 0;\n }\n return $output;\n }", "public function isUserLoggedIn()\n {\n return $this->container->get('security.authorization_checker')\n ->isGranted('IS_AUTHENTICATED_FULLY');\n }", "public function is_logged_in()\n\t{\n\t\treturn ($this->session->userdata('iduser') != FALSE);\n\t}", "public function is_logged_in()\n {\n if (isset($_SESSION['user_session'])) {\n return true;\n }\n }", "public function isLoggedIn()\n {\n // check session for user id\n if(isset($_SESSION['user']['id'])) {\n // return true;\n return $_SESSION['user']['id'];\n }\n else {\n return false;\n }\n }", "protected function _logged_in()\n\t{\n\t\t$authentic = Auth::instance();\n\t\t\n\t\tif ($authentic->logged_in())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}", "private static function is_logged_in () {\n\t\t# Check for the existence of the cookie\n\t\tif (isset($_COOKIE[\"user_id\"])) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}", "public static function is_user_logged_in() {\r\n if (isset($_SESSION['user_id'])) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "public function isUserLoggedIn()\n {\n return $this->_customerSession->isLoggedIn();\n }", "static function checkForLogIn()\n {\n if (isset($_SESSION['username'])) {\n return true;\n }\n\n return false;\n }", "public function loggedIn()\n {\n $CI = &get_instance();\n if ($CI->session->has_userdata('user_id')) {\n return true;\n } else {\n return false;\n }\n }", "public function isUserLoggedIn()\n {\n if (isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] == 1) {\n return true;\n }\n // default return\n return false;\n }", "public function logged_in()\n\t{\n\t\t$status = FALSE;\n\n\t\t// Get the user from the session\n\t\t$user = $this->_session->get($this->_config['session_key']);\n\n\t\tif ( ! is_object($user))\n\t\t{\n\t\t\t// Attempt auto login\n\t\t\tif ($this->auto_login())\n\t\t\t{\n\t\t\t\t// Success, get the user back out of the session\n\t\t\t\t$user = $this->_session->get($this->_config['session_key']);\n\t\t\t}\n\t\t}\n\n\t\t// check from DB if set in config\n\t\tif ($this->_config['strong_check'])\n\t\t{\n\t\t\t$user = $this->_get_object($user, TRUE);\n\t\t}\n\n\t\tif (is_object($user)\n\t\t\tAND is_subclass_of($user, 'Model_MangoRauth_User')\n\t\t\tAND $user->loaded()\n\t\t\tAND $user->is_active\n\t\t)\n\t\t{\n\t\t\t// Everything is okay so far\n\t\t\t$status = TRUE;\n\t\t}\n\n\t\treturn $status;\n\t}", "public function isLoggedIn() {\n\t\treturn (bool) $this->getLoggedInUser();\n\t}", "public function is_logged_in()\n\t{\n\t\tif(isset($_SESSION['userSession']))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function is_logged_in()\n {\n // Check if user session has been set\n if (isset($_SESSION['session'])) {\n return true;\n }\n }", "function isLoggedIn()\n\t{\n\t\tif ( $this->_isAuthorized() ){\t\n\t\t\treturn true;\n\t\t} else return false;\n\t\n\t}", "public function isUserLoggedIn() {\n\n $this->restartSession();\n\n if ($this->checkLogin() == false) {\n return false;\n } else {\n return true;\n }\n }", "public function isLoggedIn() {\n $cookie = $this->login();\n return $cookie != NULL;\n }", "public static function isUserLoggedIn(): bool\n {\n if (isset($_SESSION['user_id'])) return true;\n return false;\n }", "function loggedIn() {\n\t\treturn isset($_SESSION['username']);\n\t}", "function logged_in(){\n\t\tif((isset($_SESSION['user_id']) || isset($_SESSION['username'])) && (!empty($_SESSION['user_id']) || !empty($_SESSION['username']))){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isLoggedIn()\n {\n $loggedIn = $this->di->get(\"session\")->has(\"user\");\n if (!$loggedIn) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n return false;\n }\n return true;\n }", "public static function isLoggedIn()\n {\n self::startSession();\n return isset($_SESSION['user']);\n }", "public function isLoggedIn()\n {\n return $this->loggedIn;\n }", "public function logged_in() {\n return !empty($this->session->userdata('user_id'));\n }", "protected function loggedIn() {\n return isset($_SESSION) && array_key_exists(self::user, $_SESSION);\n }", "function isLoggedIn() {\n\treturn isset($_SESSION['user_id']);\n}", "public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }", "function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }", "public function is_user_logged_in()\n {\n $result = (boolean)self::getUser();\n return $result;\n }", "public function isLoggedIn()\r\n {\r\n if ($this->session->has('AUTH_NAME') AND $this->session->has('AUTH_EMAIL') AND $this->session->has('AUTH_CREATED') AND $this->session->has('AUTH_UPDATED')) {\r\n return true;\r\n }\r\n return false;\r\n }", "function isLoggedIn() {\n\treturn isset($_SESSION['user']);\n}", "function logged_in() {\n\t\treturn isset($_SESSION['USERID']);\n \n\t}", "public function is_logged_in(){\r\n\t\t\treturn $this->logged_in;\r\n\t\t}", "public static function isLoggedIn()\n {\n if(isset($_SESSION[static::$sessionKey]))\n return (self::getUser(false) ? true : false);\n \n return false;\n }", "protected function is_logged_in( )\n\t{\n\t\t$this->user = $this->php_session->get('user');\n\t\tif( is_null($this->user))\n\t\t\treturn False;\n\t\tif( ! $this->is_timed_out() )\n\t\t\treturn False;\n\t\t$this->user['last_active'] = time();\n\t\t$this->php_session->set('user' , $this->user );\n\n\t\t//apply user permissions globally\n\t\t//@see user_helper\n\t\tapply_global_perms( $this->user );\n\n\n\t\t\n\t\treturn True;\n\t}", "public function isLoggedIn() {\n\t\treturn $this->loggedIn;\n\t}", "public function isLoggedIn() {\n\t\t\treturn $this->bLoggedInUser;\n\t\t}", "function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn();\n\t\t}", "public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}", "function isUserLoggedIn()\r\n\t{\r\n\t\t\tglobal $con;\r\n\t\t\t$return = false;\r\n\t\t\tif (isset($_SESSION['USER_ID']) && ($_SESSION['USER_ID'] > 0) && ($_SESSION['USER_ID'] != ''))\r\n\t\t\t{\r\n\t\t\t\t$id = $_SESSION['USER_ID'];\r\n\t\t\t\tif ($this->chkValidUser($id))\r\n\t\t\t\t{\r\n\t\t\t\t\t$return = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $return;\r\n\t}", "public static function is_logged_in()\n {\n if (isset($_SESSION['id']) and isset($_SESSION['username']) and isset($_SESSION['role_name'])){\n return true;\n }else{\n return false;\n }\n }", "public static function check()\n {\n if (!empty($_SESSION['LOGGED_IN_USER'])){\n return true;\n } else{\n return false;\n }\n }", "abstract protected function isUserLoggedIn() ;", "public static function isLoggedIn(){\r\n\t\treturn isset($_SESSION[\"id\"]);\r\n\t}", "public function isLoggedIn()\n\t{\n\t\tif( isset($_SESSION['username']) )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function isUserLogged() {\r\n return isset($_SESSION['user']);\r\n }", "public function isLoggedIn()\n {\n if (isset($_SESSION['username'], $_SESSION['email'])) {\n return true;\n } else {\n $url=URL::getURI('login/required');\n header(\"location:$url\");\n }\n }", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "function loggedIn()\n\t{\n\t\treturn $this->hasFunction(AUTH_FUNCTION_LOGGED_IN_ATTRIBUTE);\n\t}", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "public function isLoggedIn() {\n\t\treturn $this->isLoggedin;\n\t}", "public function isLoggedIn() {\n\t\t\treturn $this->loggedIn;\n\t\t}", "public static function isLoggedIn()\n {\n return !is_null(SessionService::getCurrent());\n }", "public function loggedIn ()\r\n {\r\n\r\n if (isset($_SESSION['userID'])) {\r\n return true;\r\n } else {\r\n header('Location: login');\r\n exit;\r\n }\r\n }", "public function loggedIn()\n {\n $page = $this->getSession()->getPage();\n\n // Look for a selector to determine if the user is logged in.\n try {\n return $page->has('css', 'body.logged-in');\n\n // This may fail if the user has not loaded any site yet.\n } catch (DriverException $e) {\n }\n\n return false;\n }", "public function isLogged(){\n return isset($_SESSION[\"user\"]);\n }", "public function isCurrentlyLoggedIn() {}" ]
[ "0.8740533", "0.8740533", "0.8564388", "0.8421157", "0.8410339", "0.83837783", "0.837765", "0.8374241", "0.83621156", "0.83410144", "0.8335263", "0.831488", "0.8314218", "0.8310379", "0.83064747", "0.82900965", "0.82808197", "0.82570964", "0.82570964", "0.82475877", "0.8219995", "0.8219884", "0.8219143", "0.8212393", "0.8199411", "0.81974435", "0.81948197", "0.8183685", "0.8182813", "0.8173086", "0.8172859", "0.8171019", "0.8168445", "0.8163897", "0.8163897", "0.81629467", "0.8161779", "0.81597733", "0.8138405", "0.8133648", "0.81289697", "0.8127457", "0.8126765", "0.8118825", "0.81114656", "0.8108917", "0.81071585", "0.8096439", "0.80946743", "0.8094573", "0.8093641", "0.80889547", "0.80858105", "0.8080325", "0.80778104", "0.80762035", "0.80697745", "0.80689955", "0.80652595", "0.8059017", "0.80516344", "0.80514413", "0.80460405", "0.8041335", "0.8033423", "0.802942", "0.80169994", "0.80110866", "0.8009053", "0.80026764", "0.79970187", "0.79964596", "0.799294", "0.79852146", "0.7983585", "0.79819465", "0.7980045", "0.79798424", "0.79791313", "0.7977001", "0.79734135", "0.7969845", "0.79671323", "0.7965696", "0.79629254", "0.7960878", "0.7958796", "0.7956208", "0.79550207", "0.794904", "0.7946009", "0.7942468", "0.7938039", "0.7937805", "0.7929828", "0.7928935", "0.7927073", "0.79224116", "0.7918239", "0.791805", "0.79116756" ]
0.0
-1
Display the list of saved cards
public function indexAction() { $this->loadLayout(); $this->_initLayoutMessages('customer/session'); $this->_initLayoutMessages('catalog/session'); $this->getLayout()->getBlock('head')->setTitle($this->__('My Saved Cards')); $this->renderLayout(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $cards = Card::all();\n\n return view('card.card', compact('cards'));\n }", "public function show(Card $card)\n {\n //\n }", "public function show(Card $card)\n {\n //\n }", "public function show(Card $card)\n {\n //\n }", "public function show(Card $card)\n {\n //\n }", "public function index()\n {\n return view('card.index', [\n 'cards' => Card::all()\n ]);\n }", "public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }", "public function index()\n {\n $cardtypes = CardType::all()->sortByDesc(\"id\");\n return view('backend.card_type.list',compact('cardtypes'));\n }", "public function index()\n {\n $cards = Card::all(['account_number', 'id', 'expiration', 'cvv']);\n $bg_classes = ['', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info', 'bg-dark'];\n return view('pages.cards')->with(['cards' => $cards, 'bg_classes' => $bg_classes]);\n }", "public function listAction()\n {\n $data = $this->getGiftcards();\n\n $cardCode = $this->getCollection(Giftcards::select('card_id', 'card_code')->orderBy('card_id', 'desc')->get(),\n 'card_code');\n\n return View::make(\"admin.dashboard.index_more\", array(\n \"lists\" => $data,\n \"scope\" => $this->scope,\n \"url\" => Request::url(),\n \"search_arr\" => ['card_code' => \"Card Code\", 'mail_from' => 'Mail From', 'mail_to' => 'Mail To'],\n \"search_key\" => isset($this->search_key) ? $this->search_key : '',\n \"search_by\" => isset($this->search_by) ? $this->search_by : '',\n \"cardCodeCollection\" => $cardCode\n ));\n }", "public function actionCardIndex() {\n $searchModel = new UserCardSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $this->pageSize);\n $card_physical_id = [];\n $cardInfo = [];\n if ($dataProvider->getModels()) {\n// $card_physical_id = $dataProvider->query->asArray()->all();\n// $card_physical_id = array_column($all, 'card_id');\n foreach ($dataProvider->getModels() as $model) {\n $card_physical_id[] = $model->getAttributes();\n }\n }\n if ($card_physical_id) {\n try {\n $url = Yii::$app->request->getHostInfo() . Url::to(['@cardCenterCardInfoBySn']);\n $cardInfo = Common::curlPost($url, ['f_card_id' => $card_physical_id]);\n $cardInfo = $cardInfo ? json_decode($cardInfo, true) : '';\n } catch (Exception $exc) {\n $cardInfo = [];\n }\n }\n return $this->render('/card/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'cardInfo' => $cardInfo,\n ]);\n }", "function displayCards() {\n global $deck;\n foreach ($deck as $card){\n $value = $card['value'];\n $suit = $card['suit'];\n }\n }", "public function index()\n {\n //\n $cards = Card::all();\n return $cards;\n }", "public function index()\n {\n $cards = Cards::orderBy('id')->paginate(1);\n return view('cards', ['cards'=>$cards]);\n }", "function showCardContainer()\n {\n // instantiate template class\n $tpl = new template;\n $tpl->setCacheLevel($this->cachelevel);\n $tpl->setCacheTtl($this->cachetime);\n $usecache = checkParameters();\n\n $template = $GLOBALS[\"templates_\".$this->language][$this->tmpl][1] . \"/\" . \"module_isic_list2.html\";\n\n $tpl->setInstance($_SERVER[\"PHP_SELF\"] . \"?language=\" . $this->language . \"&module=isic_experimental\");\n $tpl->setTemplateFile($template);\n\n // PAGE CACHED\n if ($tpl->isCached($template) == true && $usecache == true) {\n $GLOBALS[\"caching\"][] = \"isic_experimental\";\n if ($GLOBALS[\"modera_debug\"] == true) {\n return \"<!-- module isic_experimental cached -->\\n\" . $tpl->parse();\n }\n else {\n return $tpl->parse();\n }\n }\n\n $tpl->addDataItem(\"DATA_URL\", \"/?content={$this->vars['content']}\");\n $tpl->addDataItem(\"DATA_MAXROWS\", $this->maxresults);\n $tpl->addDataItem(\"DATA_FIELDS\", $this->getFieldList($this->fieldData['listview'], 'list'));\n $tpl->addDataItem(\"DATA_GRID_COLUMN\", $this->getFieldList($this->fieldData['listview'], 'grid_column'));\n $tpl->addDataItem(\"DATA_FILTERS\", $this->getFieldList($this->fieldData['filterview'], 'filters'));\n\n $tpl->addDataItem(\"DATA_FORM_COLUMNS\", $this->getColumnList());\n $fs_list = $this->getFieldSetList();\n $tpl->addDataItem(\"DATA_FORM_FIELDSETS\", JsonEncoder::encode($fs_list));\n $tpl->addDataItem(\"DATA_FORM_FIELDS\", $this->getFieldList($this->fieldData['detailview'], 'detail', $fs_list));\n $tpl->addDataItem(\"DATA_FORM_FIELDS_MAPPING\", $this->getFieldList($this->fieldData['detailview'], 'list'));\n return $tpl->parse();\n }", "public function index()\n {\n // ID Card Dashboard\n $print_list = PrintList::printing()->with('member')->get(); //Those that have NOT been printed yet.\n $receive_list = PrintList::receiving()->with('member')->get(); //Those that have NOT been delivered yet.\n\n return view('idcard.index',compact('print_list','receive_list'));\n }", "function index()\n {\n // $params['limit'] = RECORDS_PER_PAGE; \n $params['offset'] = ($this->input->get('per_page')) ? $this->input->get('per_page') : 0;\n \n $config = $this->config->item('pagination');\n $config['base_url'] = site_url('card/index?');\n $config['total_rows'] = $this->Card_model->get_all_card_count();\n // $this->pagination->initialize($config);\n\n $data['card'] = $this->Card_model->get_all_card($params);\n \n $data['_view'] = 'card/index';\n $this->load->view('layouts/main',$data);\n }", "public function index() {\n $cards = Card::all(); // This is using Laravels built in stuff.\n return view('cards.index', compact('cards'));\n }", "public function getCards();", "public function index()\n {\n // Get to index\n $cards = Card::with('user') -> get();\n\n return view('pages.cards.index', compact('cards'));\n }", "public function card()\r\n {\r\n return [\r\n [\r\n 'title' => Az::l('Первый этап'),\r\n 'shows' => true,\r\n 'items' => [\r\n [\r\n 'title' => Az::l('Форма'),\r\n 'shows' => true,\r\n 'items' => [\r\n [\r\n 'name',\r\n ],\r\n [\r\n 'class_name',\r\n ],\r\n [\r\n 'title',\r\n ],\r\n [\r\n 'icon',\r\n ],\r\n [\r\n 'relationBtn',\r\n ],\r\n [\r\n 'extraConfig',\r\n ],\r\n [\r\n 'makeMenu',\r\n ],\r\n [\r\n 'genName',\r\n ],\r\n [\r\n 'makeInsert',\r\n ],\r\n [\r\n 'filter',\r\n ],\r\n ],\r\n ],\r\n ],\r\n ],\r\n ];\r\n }", "function imageCard($data){\r\n\t\tforeach ($data as $key => $value) {\r\n\t\t\t$URL = checkTextFormValuesGet(\"search\");\r\n\r\n\t\t//Chencking if contribution was update \r\n\t\t\tif (!empty($value[\"UpdateDate\"])) {\r\n\t\t\t\t$UpdateDate = \"<p>Aktualizováno: \".$value[\"UpdateDate\"].\"</p>\";\r\n\t\t\t} else{\r\n\t\t\t\t$UpdateDate = null;\r\n\t\t\t}\r\n\t\t\r\n\t\t//Setting current page\r\n\t\t\tif (!empty($_SESSION[\"pages\"])) {\r\n\t\t\t\t$pages = $_SESSION[\"pages\"];\r\n\t\t\t} else{\r\n\t\t\t\t$pages = 0;\r\n\t\t\t}\r\n\r\n\t\t\tif (!empty($_GET[\"page\"])) {\r\n\t\t\t\tif (is_numeric($_GET[\"page\"]) && $_GET[\"page\"] <= $pages) {\r\n\t\t\t\t\t$page = $_GET[\"page\"];\r\n\t\t\t\t} else{\r\n\t\t\t\t\t$page = 0;\r\n\t\t\t\t}\r\n\t\t\t} else{\r\n\t\t\t\t$page = 0;\r\n\t\t\t}\r\n\r\n\t\t//Generating card\r\n\t\t\techo \"<div class='card'>\r\n\t\t\t\t\t<p class='image'><img src='\".$value[\"URL\"].\"' title='\".$value[\"header\"].\"'></p>\r\n\t\t\t\t\t<h2>\".$value[\"header\"].\"</h2>\r\n\t\t\t\t\t<p>\".$value[\"description\"].\"</p>\r\n\t\t\t\t\t<div class='information'>\r\n\t\t\t\t\t\t<p>Nahráno: \".$value[\"Date\"].\"</p>\r\n\t\t\t\t\t\t<p>Autor: \".$value[\"autor\"].\"</p>\r\n\t\t\t\t\t\t\".$UpdateDate.\"\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<form class='favourite' method='POST' action='Action/Favourite.php'>\r\n\t\t\t\t\t\t<input type='submit' name='submit' value='Do oblíbených'>\r\n\t\t\t\t\t\t<input type='hidden' name='img' value='\".$value[\"ID\"].\"'>\r\n\t\t\t\t\t\t<input type='hidden' name='search' value='\".$URL.\"'>\r\n\t\t\t\t\t\t<input type='hidden' name='page' value='\".$page.\"'>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t\t<div class='clear'></div>\r\n\t\t\t\t</div>\";\r\n\t\t}\r\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Cardtype')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $this->authorize('family_cards.manage');\n\n return view('family_cards.index');\n }", "public function index()\n {\n $cards = UpdateCard::orderBy('id','desc')->get();\n $data[\"cards\"] = $cards;\n return view('card.card.update',$data);\n }", "function getCardList()\n {\n $txt = new Text($this->language, $this->translation_module_default);\n\n // sorting order of the query\n if (!$this->vars[\"sort\"]) {\n $sort_order = 'person_name';\n } else {\n $sort_order = $this->vars[\"sort\"];\n }\n\n if (!$this->vars[\"dir\"]) {\n $sort_dir = \"ASC\";\n } else {\n $sort_dir = $this->vars[\"dir\"];\n }\n\n // amount of records to query at once\n if (!$this->vars[\"start\"]) {\n $start_row = 0;\n } else {\n $start_row = $this->vars[\"start\"];\n }\n\n if (!$this->vars[\"limit\"]) {\n $max_rows = $this->maxresults;\n } else {\n $max_rows = $this->vars[\"limit\"];\n }\n\n $condition = array();\n if ($this->card_type_current) {\n $condition[] = \"`module_isic_card`.`type_id` = \" . $this->card_type_current;\n }\n // filter conditions\n foreach ($this->fieldData['filterview'] as $filter_data) {\n if ($this->vars[$filter_data['field']]) {\n switch ($filter_data['type']) {\n case 1: // textfield\n $condition[] = $filter_data['field'] . \" LIKE '%\" . mysql_escape_string($this->vars[$filter_data['field']]) . \"%'\";\n break;\n case 2: // combobox\n $condition[] = $filter_data['field'] . \" = \" . mysql_escape_string($this->vars[$filter_data['field']]);\n break;\n default :\n break;\n }\n }\n }\n\n $sql_condition = implode(\" AND \", $condition);\n if ($sql_condition) {\n $sql_condition = \"AND \" . $sql_condition;\n }\n\n $res =& $this->db->query(\"\n SELECT\n `module_isic_card`.*,\n IF(`module_isic_school`.`id`, `module_isic_school`.`name`, '') AS school_name,\n IF(`module_isic_card_kind`.`id`, `module_isic_card_kind`.`name`, '') AS card_kind_name,\n IF(`module_isic_bank`.`id`, `module_isic_bank`.`name`, '') AS bank_name,\n IF(`module_isic_card_type`.`id`, `module_isic_card_type`.`name`, '') AS card_type_name\n FROM\n `module_isic_card`\n LEFT JOIN\n `module_isic_school` ON `module_isic_card`.`school_id` = `module_isic_school`.`id`\n LEFT JOIN\n `module_isic_card_kind` ON `module_isic_card`.`kind_id` = `module_isic_card_kind`.`id`\n LEFT JOIN\n `module_isic_bank` ON `module_isic_card`.`bank_id` = `module_isic_bank`.`id`\n LEFT JOIN\n `module_isic_card_type` ON `module_isic_card`.`type_id` = `module_isic_card_type`.`id`\n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n ORDER BY ! ! \n LIMIT !, !\", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition, \n $sort_order, \n $sort_dir, \n $start_row, \n $max_rows\n );\n//echo($this->db->show_query());\n $result = array();\n while ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\".jpg\", \"_thumb.jpg\", $data[\"pic\"]);\n if ($t_pic && file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = \"<img src=\\\"\" . $t_pic . \"\\\">\";\n }\n $data[\"pic\"] .= \"<img src=\\\"img/tyhi.gif\\\" height=\\\"100\\\" width=\\\"1\\\">\";\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"m/y\", strtotime($data[\"expiration_date\"]));\n $data[\"active\"] = $txt->display(\"active\" . $data[\"active\"]);\n $data[\"confirm_payment_collateral\"] = $this->isic_payment->getCardCollateralRequired($data[\"school_id\"], $data[\"type_id\"]) ? $txt->display(\"active\" . $data[\"confirm_payment_collateral\"]) : \"-\";\n $data[\"confirm_payment_cost\"] = $this->isic_payment->getCardCostRequired($data[\"school_id\"], $this->isic_common->getCardStatus($data[\"prev_card_id\"]), $data[\"type_id\"], $is_card_first) ? $txt->display(\"active\" . $data[\"confirm_payment_cost\"]) : \"-\";\n $result[] = $data;\n }\n\n $res =& $this->db->query(\"\n SELECT COUNT(*) AS total \n FROM \n `module_isic_card` \n WHERE\n `module_isic_card`.`school_id` IN (!@) AND\n `module_isic_card`.`type_id` IN (!@)\n ! \n \", \n $this->allowed_schools,\n $this->allowed_card_types,\n $sql_condition);\n if ($data = $res->fetch_assoc()) {\n $total = $data[\"total\"];\n }\n \n echo JsonEncoder::encode(array('total' => $total, 'rows' => $result));\n exit();\n }", "public function card()\r\n {\r\n return [\r\n [\r\n 'title' => Az::l('Первый этап'),\r\n 'items' => [\r\n [\r\n 'title' => Az::l('Форма'),\r\n 'items' => [\r\n [\r\n 'id',\r\n 'catalogId',\r\n 'name',\r\n 'amount',\r\n 'title',\r\n 'url',\r\n 'visible',\r\n 'image',\r\n 'new_price',\r\n 'price_old',\r\n 'currency',\r\n 'currencyType',\r\n 'cart_amount',\r\n 'delivery_type',\r\n 'delivery_price',\r\n 'review_count',\r\n 'measure',\r\n 'measureStep',\r\n 'rating',\r\n 'cash_type',\r\n 'action',\r\n ],\r\n ],\r\n ],\r\n ],\r\n ],\r\n ];\r\n }", "public function show(){\n $data=$this->cart->contents();\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n\t}", "public function index()\n {\n $card_types = CardType::orderBy('id')->paginate(10);\n return view('admin.card_types.index', compact('card_types'));\n }", "public function index() {\n\t\t$this->load->database();\n\t\t$this->db->select('*')->from('cards');\n\t\t$this->db->join('cards_releases', 'cards.card_id = cards_releases.card_id', 'left');\n\t\t$this->db->join('editions', 'editions.edition_id = cards_releases.edition_id', 'left');\n\t\t$this->db->join('rarities', 'rarities.rarity_id = cards_releases.rarity_id', 'left');\n\t\t$this->db->where('block', 'Innistrad')->or_where('block', 'Scars of Mirrodin'); \n\t\t$query = $this->db->get();\n\t\tforeach ($query->result() as $row) {\n\t\t echo '<a href=\"/cards/show/'.$row->card_id.'\">'.$row->card_name.'</a>';\n\t\t echo ' - '.$this->manaHelper($row->mana_cost);\n\t\t echo ' - <img src=\"/public/images/extetions_pictos/'.$row->edition_code.'-'.$row->rarity_code.'.png\" alt=\"'.$row->edition_code.'-'.$row->rarity_code.'\" />';\n\t\t echo '<br/>';\n\t\t}\n\t\t\n\t\t$this->viewlinker->view('cards/cards_index', $wiew_data);\n\t}", "public function index() {\n\t\t$data['card_exist'] = array();\n\t\t$data['user_account_info'] = $this->user_model->get_user_payment_account($this->session->userdata('userId'));\n\t\tif (count($data['user_account_info']) != 0 && $data['user_account_info']['card_id'] != \"\") {\n\n\t\t\t$data['card_exist'] = $this->mango_pay->view_a_card($data['user_account_info']['card_id']);\n\t\t}\n\t\t$this->load->view('account_information/edit_account_information', $data);\n\t}", "public function show(Cards $card)\n {\n \n return view('cards.show', ['card'=>$card]);\n }", "public function index(CardRequest $request)\n {\n return $request->availableCards();\n }", "public function index()\n {\n $list = Budget::all();\n return view('/saved', compact('list'));//\n }", "public function card()\r\n {\r\n return [\r\n [\r\n 'title' => Az::l('Первый этап'),\r\n 'shows' => true,\r\n 'items' => [\r\n [\r\n 'title' => Az::l('Форма'),\r\n 'shows' => true,\r\n 'items' => [\r\n [\r\n 'program',\r\n 'passport',\r\n 'passport_give',\r\n 'birthdate',\r\n 'core_user_id',\r\n 'core_country_id',\r\n 'status',\r\n 'edu_start',\r\n 'age',\r\n 'edu_end',\r\n 'currency',\r\n 'core_company_id',\r\n 'company_type',\r\n 'edu_area',\r\n 'edu_sector',\r\n 'edu_type',\r\n 'speciality',\r\n 'edu_place',\r\n 'finance',\r\n 'address',\r\n 'phone',\r\n 'home_phone',\r\n 'email',\r\n 'position',\r\n 'experience',\r\n 'completed',\r\n ],\r\n ],\r\n ],\r\n ],\r\n ],\r\n ];\r\n }", "public function index()\n {\n $cards = DB::table('cards')\n ->join('users', 'users.id', '=', 'cards.user_id')\n ->join('card_types', 'card_types.id', '=', 'cards.card_type_id')\n ->join('grades', 'cards.grade_id', '=', 'grades.id')\n ->join('fields', 'cards.field_id', '=', 'fields.id')\n ->join('card_exercises_xref', 'cards.id', '=', 'card_exercises_xref.card_id')\n ->join('exercises', 'card_exercises_xref.exercise_id', '=', 'exercises.id')\n ->select('cards.*',\n 'exercises.content as exercise_content',\n 'card_types.name as card_type_name',\n 'users.username as user_username',\n 'grades.short_name as grade_short_name',\n 'fields.name as field_name')\n ->limit(100)\n ->groupBy('cards.id')\n ->get();\n return view('cards.cards_index')->with(compact('cards'));\n }", "public function actionCardContent()\n\t{\n\t\tif(FacebookController::getUserID() ==0)\n\t\t{\n\t\t\t$error = new ErrorController('error');\n\t\t\t$error->actionFaildUserID();\n\t\t\treturn ;\n\t\t}\n\t\t$card_id = $_GET[\"card_id\"];\n\t\t$user_id = FacebookController::getUserID();\n\t\t$cat_name = $_GET[\"cat\"];\n\t\t// To be Change\n\t\t$num = $card_id % 7 ;\n\t\t$num++;\n\t\t$picName = array(\"nancyCompBG\", \"nancyfbCover\",\"nancyfbPP\",\"nancymobileBG\");\n\t\t// end change\n\t /** @type string represent card's images urls */\t\t\n\t\t$picURL = array();\n\t\tfor ($i=0 ; $i <count($picName) ; $i++)\n\t\t{\n\t\t\t$picURL[$i] = UtilityController::siteUrl(). $num. \"/\". $picName[$i]. \".jpg\";\n\t\t}\n\t\t/** @type string represent card's css elements */\n\t\t$cssName = array(\"compBG\", \"fbCover\",\"fbPP\",\"mobileBG\");\n\t\t$this->render('cardContent',array('card_id'=>$card_id,'user_id'=>$user_id,'cat_name'=>$cat_name,'picURL'=>$picURL,'cssName'=>$cssName));\n\t}", "public function show($card_id) {\n\t\t$this->load->helper('cards_display');\n\t\t$this->load->database();\n\t\t\n\t\t$this->db->select('*')->from('cards')->where('cards.card_id', $card_id);\n\t\t$card_hdl = $this->db->get();\n\t\tforeach ($card_hdl->result() as $row) {\t\t\t\n\t\t\t$view_data['card_name'] = $row->card_name;\n\t\t\t$view_data['converted_mana_cost'] = $row->converted_mana_cost;\n\t\t\t$view_data['card_type'] = $row->card_type;\n\t\t\t$view_data['card_subtype'] = $row->card_subtype;\n\t\t\t$view_data['card_power'] = $row->power;\n\t\t\t$view_data['card_defense'] = $row->defense;\n\t\t\t$view_data['card_text'] = trim($row->card_text);\n\t\t}\n\n\t\t// On get les infos de mana pour afficher les pictos\n\t\t$this->db->select('*')->from('cards_mana_costs');\n\t\t$this->db->join('mana_forms', 'mana_forms.mana_form_id = cards_mana_costs.mana_form_id', 'left');\t\t\n\t\t$this->db->where('cards_mana_costs.card_id', $card_id)->order_by('mana_forms.display_order', 'ASC'); \n\t\t$card_infos_hdl = $this->db->get();\n\t\t$card_infos = $card_infos_hdl->result();\t\t\n\t\tforeach ($card_infos_hdl->result() as $row) {\n\t\t\t$view_data['mana_cost'][] = $row->mana_form_code;\n\t\t}\n\t\t\n\t\t// On load les editions pour l'affichage et pour trouver un scan de la carte\n\t\t$this->db->select('*')->from('cards_releases');\n\t\t$this->db->join('editions', 'editions.edition_id = cards_releases.edition_id', 'left');\n\t\t$this->db->join('rarities', 'rarities.rarity_id = cards_releases.rarity_id', 'left');\n\t\t$this->db->where('cards_releases.card_id', $card_id)->order_by('editions.date', 'DESC'); \n\t\t$card_infos_hdl = $this->db->get();\n\t\t$card_infos = $card_infos_hdl->result();\n\t\t$view_data['display_edition_code'] = null;\n\t\tforeach ($card_infos_hdl->result() as $row) {\t\t\t\n\t\t\t$view_data['rarity_name'] = $row->rarity_name;\n\t\t\t$view_data['display_editions_img'][] = array('edition_name' => $row->edition_name, 'edition_code' => $row->edition_code, 'rarity_code' => $row->rarity_code);\n\t\t\t\n\t\t\t//On trouve une images qui correspond\n\t\t\tif($view_data['display_edition_code'] == null && file_exists($_SERVER['DOCUMENT_ROOT']._IMAGES_DIR_.'scans/'.$row->edition_code.'/'.$view_data['card_name'].'.full.jpg') ) {\n\t\t\t\t$view_data['display_edition_code'] = $row->edition_code;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t$this->viewlinker->view('cards/cards_show', $view_data);\n\t}", "public function index()\n {\n $cards = Task::all();\n return view('cards.index',compact('cards'));\n }", "public function extendedcardread()\n {\n $id_item = $this->request->getParameter(\"id\");\n $item = $this->item->getItem($id_item);\n $categories = $this->category->getCategories();\n $id_category = $item['catid'];\n $category = $this->category->getCategory($id_category);\n $links = $this->link->getLinks($id_item);\n $this->generateadminView(array(\n 'item' => $item,\n 'category' => $category,\n 'categories' => $categories,\n 'links' => $links\n ));\n }", "public function show(Card $card) {\n //$card = Card::find($card); // This is using Laravels built in stuff.\n \n // This without any of the above and using show(Card $card) is using \n // even more built in stuff from Laravel.\n return view('cards.show', compact('card')); \n\n }", "public function index()\n {\n $titleTag = 'Card Metagame | ';\n $h2Tag = 'Card Metagame';\n\n $latestDate = CardMetagame::orderBy('date', 'desc')->take(1)->pluck('date')[0];\n\n $cards = DB::table('cards')\n ->select('cards.id',\n 'cards.name',\n 'sets_cards.multiverseid',\n 'sets.code',\n 'cards.f_cost',\n 'cards.note',\n 'cards.mana_cost',\n 'card_metagames.md_percentage',\n 'card_metagames.sb_percentage',\n 'card_metagames.total_percentage')\n ->join('sets_cards', 'sets_cards.card_id', '=', 'cards.id')\n ->join('sets', 'sets.id', '=', 'sets_cards.set_id')\n ->join('card_metagames', 'card_metagames.card_id', '=', 'cards.id')\n ->orderBy('cards.f_cost')\n ->where('card_metagames.date', $latestDate)\n ->groupBy('cards.name')\n ->get();\n\n return view('card_metagame.index', compact('titleTag', 'h2Tag', 'latestDate', 'cards'));\n }", "function makeCards() {\n\t\t\n\t\t$cards = explode(\" \", $this->me->get(\"cards\"));\n\t\t$i = 0;\n\t\t$rv = \"gamestate.cards = [];\";\n\t\t\n\t\tforeach ($cards as $value) {\n\t\t\t$name = getOneThing(\"name\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$description = getOneThing(\"description\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"] = new Object();\\n\";\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"].name = '\".$name.\"';\\ngamestate.cards[\".$i.\"].description = '\".$description.\"';\\n\";\n\t\t\t$i++;\n\t\t\t}\n\t\t\n\t\n\t\treturn $rv;\n\t\t\n\t\n\t}", "public function index() {\n\t\t$this->load->database();\n\t\t$card_hdl = $this->db->query('SELECT * FROM cards WHERE cards.mana_cost IS NULL AND card_type <> \\'Vanguard\\' AND card_type NOT LIKE \\'%Scheme%\\' ');\n//\t\tvar_dump($card_hdl->result());\n\t\tforeach ($card_hdl->result() as $row) {\n\t\t echo '<br/>'.$row->card_id.'<br/>';\n\t\t echo $row->card_name.'<br/>';\n\t\t echo $row->card_type.'<br/>';\n//\t\t gatherer.wizards.com/pages/search/default.aspx?name=+[\"Acid Web Spider\"]\n\t\t echo nl2br($row->card_text).'<br/>';\n//\t\t var_dump($row->card_text);\n\t\t\t$ZEcard_id = $row->card_id;\n\t\t echo '<hr/><br/>';\n\t\t \n\t\t $this->db->select('*')->from('cards_releases');\n\t\t\t$this->db->join('editions', 'editions.edition_id = cards_releases.edition_id', 'left');\n\t\t\t$this->db->join('rarities', 'rarities.rarity_id = cards_releases.rarity_id', 'left');\n\t\t\t$this->db->where('cards_releases.card_id', $row->card_id)->order_by('editions.date', 'DESC'); \n\t\t\t$card_infos_hdl = $this->db->get();\n\t\t\t$card_infos = $card_infos_hdl->result();\n\t\t\tforeach ($card_infos_hdl->result() as $release) {\n\t\t\t\tif(file_exists($_SERVER['DOCUMENT_ROOT'].'/public/images/scans/'.$release->edition_code.'/'.$row->card_name.'.full.jpg') ) {\n\t\t\t\t\t\n\t\t\t\t\techo '<img src=\"/public/images/scans/'.$release->edition_code.'/'.str_replace(array('?', '!'), '', $row->card_name).'.full.jpg\" alt=\"'.$release->edition_code.'-'.str_replace('?', '', $row->card_name).'\" />';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t \n\t\t \n//\t\t $card = $row;\n\t\t}\n\t\t\n\t\t$this->load->view('cards_index');\n\t}", "function link_card()\n\t{\n\t\tlog_message('debug', 'Account/link_card');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['featuredBanks'] = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'10', 'isFeatured'=>'Y'));\n\n\t\t$data = load_page_labels('link_card', $data);\n\t\t$this->load->view('account/link_card', $data);\n\t}", "public function show(Postcard $postcard)\n {\n //\n }", "public function printlist(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t$this->title = 'Media list';\t\t\r\n\t\treturn $this->renderWith(array('Media_printresults','Print'));\r\n\t}", "public function card()\r\n {\r\n return [\r\n [\r\n 'title' => Az::l('Первый этап'),\r\n 'items' => [\r\n [\r\n 'title' => Az::l('Форма'),\r\n 'items' => [\r\n [\r\n 'id',\r\n 'name',\r\n 'date_deliver',\r\n 'created_at',\r\n 'status',\r\n 'shipment_type',\r\n 'prepayment',\r\n 'currency_type',\r\n ],\r\n ],\r\n ],\r\n ],\r\n ],\r\n ];\r\n }", "public function rechargeCardList(){\n\n }", "public function index()\n\n {\n\n $card=Card::all();\n\t\t\n return view('user',compact('card'));\n\n }", "public function indexAction ()\n {\n $response = new Response();\n $response->setPublic();\n $response->setMaxAge($this->container->getParameter('short_cache'));\n \n $decklists_recent = $this->recent(0, 10)['decklists'];\n \n $dbh = $this->get('doctrine')->getConnection();\n $rows = $dbh->executeQuery(\"SELECT\n\t\t\t\tdecklist from highlight where id=?\n\t\t\t\t\", array(\n 1\n ))->fetchAll();\n \n if (empty($rows)) {\n \n $decklist = json_decode($this->saveHighlight());\n } else {\n \n $decklist = json_decode($rows[0]['decklist']);\n }\n \n return $this->render('NetrunnerdbBuilderBundle:Default:index.html.twig',\n array(\n 'pagetitle' => \"Android:Netrunner Cards and Deckbuilder\",\n 'locales' => $this->renderView('NetrunnerdbCardsBundle:Default:langs.html.twig'),\n 'recent' => $decklists_recent,\n 'decklist' => $decklist,\n 'url' => $this->getRequest()\n ->getRequestUri()\n ), $response);\n \n }", "public function card_insert($card_list){\n\n }", "public function cardList()\n {\n // $pageIndex = 0;\n // $pageSize = 20;\n $pageIndex = I('get.pageIndex');\n $pageSize = I('get.pageSize');\n $where = I('get.where');\n $orderBy = I('get.orderBy');\n\n $where = htmlspecialchars_decode($where);\n\n $data = array(\n \"userAccount\" => self::USERACCOUNT,\n \"pageIndex\" => $pageIndex,\n \"pageSize\" => $pageSize,\n \"where\" => $where,\n \"orderBy\" => $orderBy,\n );\n $response_data = $this->client->CallHttpPost(\"Get_MembersPagedV2\", $data);\n $this->ajaxReturn($response_data);\n }", "public function price_card(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Price Card';\n\t\t$data['priceCardList'] = $this->common_model->get_all('fr_price_card', '');\n\t\t$this->set_layout('price_card/price_card_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "function showCardsNoDeck($connection) {\n\n $requete = \"SELECT Cartes.titre, Cartes.id_carte, Cartes.type_carte, Cartes.nature, Cartes.famille, Cartes.image\n FROM Cartes\n WHERE Cartes.id_carte NOT IN (\n SELECT Cartes.id_carte\n FROM Cartes\n INNER JOIN Deck_contient_carte ON Cartes.id_carte = Deck_contient_carte.id_carte\n )\";\n\n echo \"<h1> Cartes dans aucun deck </h1>\";\n\n /* execute la requete */\n if($res = $connection->query($requete)) {\n echo \"<table>\";\n echo \"<thead>\";\n echo \"<tr>\";\n echo \"<th><i class=\\\"material-icons\\\">title</i>Titre</th>\";\n echo \"<th><i class=\\\"material-icons\\\">insert_photo</i>Image</th>\";\n echo \"<th><i class=\\\"material-icons\\\">format_list_numbered</i>Id carte</th>\";\n echo \"<th><i class=\\\"material-icons\\\">merge_type</i>Type</th>\";\n echo \"<th><i class=\\\"material-icons\\\">whatshot</i>Nature</th>\";\n echo \"<th><i class=\\\"material-icons\\\">apps</i>Famille</th>\";\n echo \"<th><i class=\\\"material-icons\\\">insert_link</i>Liens</th>\";\n echo \"</tr>\";\n echo \"</thead>\";\n echo \"<tbody>\";\n\n while ($card = $res->fetch_assoc()) {\n echo \"<tr>\";\n echo \"<td>\".$card[\"titre\"].\"</td>\";\n echo \"<td><img src=\\\"\".$card[\"image\"].\"\\\" style=\\\"width:50%;height:121px;\\\"/></td>\";\n echo \"<td>\".$card[\"id_carte\"].\"</td>\";\n echo \"<td>\".$card[\"type_carte\"].\"</td>\";\n echo \"<td>\".$card[\"nature\"].\"</td>\";\n echo \"<td>\".$card[\"famille\"].\"</td>\";\n echo \"<td><a href=\\\"/Cards.php?id=\". $card[\"id_carte\"] .\"\\\"><i class=\\\"material-icons\\\">call_missed_outgoing</i></a>\n <a href=\\\"/DeleteCard.php?id=\".$card[\"id_carte\"].\"\\\"><i class=\\\"material-icons\\\">delete</i></a>\n <a href=\\\"/AddCardToDeck.php?id=\".$card[\"id_carte\"].\"\\\"><i class=\\\"material-icons\\\">add</i></a></td>\";\n echo \"</tr>\";\n }\n $connection->close();\n echo \"</tbody>\";\n echo \"</table>\";\n }\n}", "public function actionIndex() {\n $searchModel = new CardRechargeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $this->pageSize);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getAllCard(){\n $cards = Card::all();\n\n return response()->json([\n 'response_code' => 200,\n 'status' => 'success',\n 'message' => \"berhasil mendapatkan semua card\",\n 'error' => (Object)[],\n 'cards' => $cards\n ],200);\n }", "function displayCard($cards) {\n \n echo \"<img src= '../challenges2/img-2/cards/clubs/$cards.png' />\";\n }", "public function printed(PrintList $id_card)\n {\n $id_card->printed();\n\n flash()->success('ID Card Printed');\n return redirect()->back();\n }", "public function actionIndex()\n {\n $searchModel = new RechargeCardSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function export()\n {\n $print_list = PrintList::printing()->with('member')->get();\n return view('idcard.export',compact('print_list'));\n }", "public function actionCategoryCards()\n\t{\n\t\tif(FacebookController::getUserID() ==0)\n\t\t{\n\t\t\t$error = new ErrorController('error');\n\t\t\t$error->actionFaildUserID();\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\t$user_id = FacebookController::getUserID();\n\t\t$cat_name = $_GET['catg'];\n\t\t$cards = Card::model()->findAll('cat_name=:cat_name',array('cat_name'=>$cat_name));\n\t\t$userCards = UserCard::model()->findAll('fb_id=:fb_id',array('fb_id'=>$user_id)); \n\t\t$cardsUsed = array();\n\t\tfor($i=0;$i<count($userCards);$i++)\n\t\t{\n\t\t\t$card = &$userCards[$i]->card_id ;\n\t\t\t$cardsUsed[$card] = true;\n\t\t}\n\t\t$this->render('categoryCards',array('user_id'=>$user_id,'cat_name'=>$cat_name,'cards'=>$cards,'cardsUsed'=>$cardsUsed));\n\t}", "function CardInfo(){\r\n }", "public function show(Card $card)\n {\n return view('admin.cards.show', compact('card'));\n }", "public function actionIndex()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t//$this->render('index');\n\t\t$this->redirect($this->createUrl('cards/index',array('type'=>1,)));\n\t}", "public function listDisplay() {\n $stores = Store::orderBy('created_at','desc')->get();\n\n return view('home.storeList')\n ->with('stores',$stores);\n }", "function showEvent($card) {\n $txt = new Text($this->language, \"module_isic_card\");\n\n // instantiate template class\n $tpl = new template;\n $tpl->setCacheLevel($this->cachelevel);\n $tpl->setCacheTtl($this->cachetime);\n $usecache = checkParameters();\n\n $template = $GLOBALS[\"templates_\".$this->language][$this->tmpl][1] . \"/\" . \"module_isic_show.html\";\n\n $tpl->setInstance($_SERVER[\"PHP_SELF\"].\"?language=\".$this->language.\"&module=isic&type=showcard\");\n $tpl->setTemplateFile($template);\n\n // PAGE CACHED\n if ($tpl->isCached($template) == true && $usecache == true) {\n $GLOBALS[\"caching\"][] = \"isic\";\n if ($GLOBALS[\"modera_debug\"] == true) {\n return \"<!-- module isic cached -->\\n\" . $tpl->parse();\n }\n else {\n return $tpl->parse();\n }\n }\n\n $r = &$this->db->query(\"\n SELECT\n `module_isic_card`.*,\n IF(`module_isic_card_language`.`id`, `module_isic_card_language`.`name`, '') AS language_name,\n IF(`module_isic_school`.`id`, `module_isic_school`.`name`, '') AS school_name,\n IF(`module_isic_card_kind`.`id`, `module_isic_card_kind`.`name`, '') AS card_kind_name,\n IF(`module_isic_bank`.`id`, `module_isic_bank`.`name`, '') AS bank_name,\n IF(`module_isic_card_type`.`id`, `module_isic_card_type`.`name`, '') AS card_type_name\n FROM\n `module_isic_card`\n LEFT JOIN\n `module_isic_card_language` ON `module_isic_card`.`language_id` = `module_isic_card_language`.`id`\n LEFT JOIN\n `module_isic_school` ON `module_isic_card`.`school_id` = `module_isic_school`.`id`\n LEFT JOIN\n `module_isic_card_kind` ON `module_isic_card`.`kind_id` = `module_isic_card_kind`.`id`\n LEFT JOIN\n `module_isic_bank` ON `module_isic_card`.`bank_id` = `module_isic_bank`.`id`\n LEFT JOIN\n `module_isic_card_type` ON `module_isic_card`.`type_id` = `module_isic_card_type`.`id`\n WHERE\n `module_isic_card`.`id` = !\n \", $card);\n\n if ($data = $r->fetch_assoc()) {\n if ($this->isic_common->canViewCard($data[\"school_id\"], $data[\"person_number\"])) {\n $tpl->addDataItem(\"DATA_active\", $txt->display(\"active\" . $data[\"active\"]));\n $tpl->addDataItem(\"DATA_language_name\", $data[\"language_name\"]);\n $tpl->addDataItem(\"DATA_kind_name\", $data[\"card_kind_name\"]);\n $tpl->addDataItem(\"DATA_bank_name\", $data[\"bank_name\"]);\n $tpl->addDataItem(\"DATA_type_name\", $data[\"card_type_name\"]);\n $tpl->addDataItem(\"DATA_school_name\", $data[\"school_name\"]);\n $tpl->addDataItem(\"DATA_person_name_first\", $data[\"person_name_first\"]);\n $tpl->addDataItem(\"DATA_person_name_last\", $data[\"person_name_last\"]);\n $tpl->addDataItem(\"DATA_person_birthday\", date(\"d.m.Y\", strtotime($data[\"person_birthday\"])));\n $tpl->addDataItem(\"DATA_person_number\", $data[\"person_number\"]);\n $tpl->addDataItem(\"DATA_delivery_addr1\", $data[\"delivery_addr1\"]);\n $tpl->addDataItem(\"DATA_delivery_addr2\", $data[\"delivery_addr2\"]);\n $tpl->addDataItem(\"DATA_delivery_addr3\", $data[\"delivery_addr3\"]);\n $tpl->addDataItem(\"DATA_delivery_addr4\", $data[\"delivery_addr4\"]);\n $tpl->addDataItem(\"DATA_person_email\", $data[\"person_email\"]);\n $tpl->addDataItem(\"DATA_person_phone\", $data[\"person_phone\"]);\n $tpl->addDataItem(\"DATA_person_position\", $data[\"person_position\"]);\n $tpl->addDataItem(\"DATA_person_class\", $data[\"person_class\"]);\n $tpl->addDataItem(\"DATA_activation_date_m\", date(\"m\", strtotime($data[\"activation_date\"])));\n $tpl->addDataItem(\"DATA_activation_date_y\", date(\"y\", strtotime($data[\"activation_date\"])));\n $tpl->addDataItem(\"DATA_expiration_date_m\", date(\"m\", strtotime($data[\"expiration_date\"])));\n $tpl->addDataItem(\"DATA_expiration_date_y\", date(\"y\", strtotime($data[\"expiration_date\"])));\n $tpl->addDataItem(\"DATA_isic_number\", $data[\"isic_number\"]);\n $tpl->addDataItem(\"DATA_card_number\", $data[\"card_number\"]);\n if ($data[\"pic\"] != \"\") {\n $big_picture = ereg_replace(\"_thumb\\.\", \".\", $data[\"pic\"]);\n if (@file_exists(SITE_PATH . substr($big_picture, strpos($big_picture, \"upload\")-1))) {\n $tpl->addDataItem(\"DATA_pic\", SITE_URL . $data[\"pic\"]);\n } else {\n $tpl->addDataItem(\"DATA_pic\", SITE_URL . $data[\"pic\"]);\n }\n } else {\n $tpl->addDataItem(\"DATA_pic\", \"img/tyhi.gif\");\n }\n // showing modify button in case of admin-users and card not being exported\n if ($data[\"exported\"] == \"0000-00-00 00:00:00\" && ($this->user_type == 1 || $this->user_type == 2 && !$data[\"confirm_admin\"])) {\n $tpl->addDataItem(\"MODIFY.MODIFY\", $txt->display(\"modify\"));\n $tpl->addDataItem(\"MODIFY.URL_MODIFY\", processUrl($_SERVER[\"PHP_SELF\"], $_SERVER[\"QUERY_STRING\"], \"&card_id=\" . $data[\"id\"] . \"&action=modify\", array(\"card_id\")));\n }\n if ($this->user_type == 1 && $data[\"status_id\"]) {\n $tpl->addDataItem(\"REPLACE.REPLACE\", $txt->display(\"replace\"));\n $tpl->addDataItem(\"REPLACE.URL_REPLACE\", processUrl($_SERVER[\"PHP_SELF\"], $_SERVER[\"QUERY_STRING\"], \"&card_id=\" . $data[\"id\"] . \"&action=replace\", array(\"card_id\")));\n }\n } else {\n redirect(processUrl(SITE_URL,$_SERVER[\"QUERY_STRING\"], \"error=view\", array(\"card_id\")));\n }\n }\n\n $tpl->addDataItem(\"BACK\", $txt->display(\"back\"));\n $tpl->addDataItem(\"URL_BACK\", processUrl($_SERVER[\"PHP_SELF\"], $_SERVER[\"QUERY_STRING\"], \"\", array(\"card_id\")));\n return $tpl->parse();\n }", "public function shareholders() { \n $data['page'] = 'Shareholders List';\n $data['page_title'] = 'Shareholders List';\n $data['page_module'] = 'share'; \n $data['shareholders_list'] = $this->Share_Model->shareHoldersList(); \n $this->load->view('share/shareholders_list', $data);\n }", "public function printCard($card)\n {\n $card->printHtml();\n }", "public function edit(Cards $cards)\n {\n //return view('cards.edit', ['cards'=>$cards]);\n }", "public function create()\n {\n return view('back.cards.create');\n }", "public function show(CreditCard $creditCard)\n {\n //\n }", "public function indexAction()\n {\n return new ViewModel(array(\n 'creditcards' => $this->getCreditcardTable()->fetchAll(),\n )); \n }", "public function actionIndex()\n {\n $searchModel = new ArticlecardSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getUserCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the cards list\n return $this->vaultHandler->getUserCards($customerId);\n }", "public function creditcardsAction() {\n if (!$this->_getSession()->isLoggedIn()) {\n $this->_redirect('customer/account/login');\n return;\n }\n\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getParams();\n if (isset($data)) {\n $result = $this->_save($data);\n switch ($result->getResponseCode()) {\n case self::RESPONSE_CODE_SUCCESS:\n Mage::getSingleton('core/session')->addSuccess('Credit card has been added.');\n break;\n case self::RESPONSE_CODE_FAILURE:\n Mage::getSingleton('core/session')->addError('Credit card has not been saved. Please try again.');\n break;\n }\n\n $this->_redirect('payments/customer/creditcards');\n }\n }\n\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function vcardsAction() {\n\t\t$data = Array();\n\t\t$data = $this->contactRepository->findAll();\n\t\t$this->view->assign('addresses', $data);\n\t\t$this->response->setHeader('Content-Type','text/x-vCard');\n\t\t$this->response->setHeader('Content-Disposition','attachment; filename= \"addresses.vcf\"');\n\t}", "function getCardDetail()\n {\n $disabled = array();\n $required = array();\n \n if ($this->vars[\"card_id\"]) {\n $action = 2; // modify\n // find all the disabled fields for current action\n foreach ($this->fieldData[\"detailview\"] as $dkey => $dval) {\n if (in_array($action, $dval[\"disabled\"])) {\n $disabled[] = $dkey;\n }\n }\n // find all the required fields for current action\n foreach ($this->fieldData[\"detailview\"] as $rkey => $rval) {\n if (in_array($action, $rval[\"required\"])) {\n $required[] = $rkey;\n }\n }\n\n $res =& $this->db->query(\"SELECT * FROM `module_isic_card` WHERE `id` = !\", $this->vars[\"card_id\"]);\n $result = array();\n if ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\"_thumb.jpg\", \".jpg\", $data[\"pic\"]);\n if (file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = $t_pic;\n } else {\n $data[\"pic\"] = \"\";\n }\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"d/m/Y\", strtotime($data[\"expiration_date\"]));\n $data[\"status_id\"] = $data[\"status_id\"] ? $data[\"status_id\"] : '';\n $data[\"bank_id\"] = $data[\"bank_id\"] ? $data[\"bank_id\"] : '';\n $result[] = $data;\n echo JsonEncoder::encode(array('success' => true, 'data' => $result, 'disable' => $disabled, 'require' => $required));\n } else {\n echo JsonEncoder::encode(array('error' => 'cold not load data'));\n }\n } else {\n $action = 1; // add\n // find all the disabled fields for current action\n foreach ($this->fieldData[\"detailview\"] as $dkey => $dval) {\n if (in_array($action, $dval[\"disabled\"])) {\n $disabled[] = $dkey;\n }\n }\n // find all the required fields for current action\n foreach ($this->fieldData[\"detailview\"] as $rkey => $rval) {\n if (in_array($action, $rval[\"required\"])) {\n $required[] = $rkey;\n }\n }\n $result[] = array(\"pic\" => \"\");\n echo JsonEncoder::encode(array('success' => true, 'data' => $result, 'disable' => $disabled, 'require' => $required));\n }\n exit();\n }", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "function addLearnCards($learnList)\n{\n\t$htmllearnList = \"\";\n\t$dateUtil = new DateUtil();\n\tforeach($learnList as $learn)\n\t{\n\t\t//var_dump($learn->{createTimeStamp});\n\t\t$imageIconName = \"ProvCard_ViewedPDF_v5.png\";\n\n\t\t$pos = stripos($learn->{content}->{contentType} ,'pdf');\n\n\t\tif($pos === FALSE)\t\t$imageIconName = \"dashboard_content_video.png\";\n\n\t\t$title = $learn->{customTitle};\n\n\t\tif($title === VMCPortalConstants::$PHP_EMPTY)\n\t\t{\n\t\t\t$title = $learn->{content}->{title};\n\t\t}\n\n\t\t$htmllearnList = $htmllearnList.\"<div class='learn_content_bg bordered' id='delete\".$learn->{educationalContentId}.\"'>\n\t\t<div class='row'>\n\t\t\t<div class='col-md-1 learn_box_img'>\n\t\t\t\t<a class='\".$learn->{educationalContentId}.\"' id='content\".$learn->{educationalContentId}.\"' onclick='contentOpen(this.id)'><img src='/gladstone/portal/bloom/login/images/\".$imageIconName.\"' alt=''/></a>\n\t\t\t</div>\n\t\t\t<div class='col-md-4 learn_box_content'>\n\t\t\t\t<h2> \".$title.\"</h2>\n\t\t\t</div>\n\t\t\t<div class='col-md-4'>\n\t\t\t\t<span class='date_span learnTime'>\".$learn->{createTimeStamp}.\"</span>\n\t\t\t</div>\n\n\t\t\t<div class='col-md-3 learn_box_content_button text-right'>\n\t\t\t\t<a href='#' class='delete' name='\".$learn->{contentId}.\"' id='\".$learn->{educationalContentId}.\"'>Delete</a>\n\t\t\t</div>\n\t\t</div>\n\n\t</div>\";\n}\n\nreturn $htmllearnList;\n}", "public function index()\n {\n $banks = Bank::all();\n Session::put('menu','banks');\n return view('dashboard.banks',compact('banks'));\n }", "public function getStoredCards() {\n // TODO get from model or user select\n $customerId = 2;\n\n return $this->paymentTokenManagement->getListByCustomerId($customerId);\n }", "public function index()\n\t{\n\t\t$cardTypes = $this->cardTypeRepository->all();\n\n\t\treturn $this->sendResponse($cardTypes->toArray(), \"CardTypes retrieved successfully\");\n\t}", "public function create()\n {\n return view('cards.create');\n }", "public function create()\n {\n return view('cards.create');\n }", "public function card_list_query($deck){\n\n }", "public function index()\n {\n //All cards\n $allCards = Card::where('state', 'like', 1)->get();\n\n\n //TODO: Find out what Auth is/does, how is it different from a model?\n //Only the cards from the user\n\n $user = Auth::user();\n\n //Lazy eager loading\n $cards = $user->load(['cards' => function($query)\n {\n $query->where('state', 'like', 1);\n }]);\n\n //Eager loading\n// $cards = Auth::user()\n// ->with('cards')\n// ->where('state', 'like', 1)\n// ->get();\n\n// $cards = Auth::user()->with(['cards' => function($query)\n// {\n// $query->where('state', 'like', 1);\n//\n// }])->get();\n\n return view('home', compact(['cards', 'allCards']));\n }", "public function create()\n {\n $powers = Power::orderBy('name')->get();\n $rarities = Rarity::orderBy('level')->get();\n $card = new Card;\n return view('admin.cards.create', compact('card', 'powers', 'rarities'));\n }", "public function cards(Request $request) {\n return [];\n }", "public function showSingle(Card $card){\n \t//$card= Card::with('notes.user')->find(1); \n\n \t$card->load('notes.user');\n \t//return $card;\n\n \t//return $card->notes[0]; //n+1 problem will occur here is the number of loop and the nuber of quary will hit\n \treturn view('cards.showSingle', compact('card'));\n\n //return $card->notes[0]->user;\n\n //return $card;\n }", "public function extendedcardsbin()\n {\n $number_of_items_deleted = $this->calculate->getTotalOfItemsDeleted();\n if (null != $this->request->ifParameter(\"id\")) {\n $items_deleted_current_page = $this->request->getParameter(\"id\");\n } else {\n $items_deleted_current_page = 1;\n }\n $items_deleted = $this->item->getItemsDeleted($items_deleted_current_page);\n $page_previous_items_deleted = $items_deleted_current_page - 1;\n $page_next_items_deleted = $items_deleted_current_page + 1;\n $number_of_items_deleted_pages = $this->calculate->getNumberOfPagesOfExtDeleted();\n $this->generateadminView(array(\n 'items_deleted' => $items_deleted,\n 'number_of_items_deleted' => $number_of_items_deleted,\n 'items_deleted_current_page' => $items_deleted_current_page,\n 'page_previous_items_deleted' => $page_previous_items_deleted,\n 'page_next_items_deleted' => $page_next_items_deleted,\n 'number_of_items_deleted_pages' => $number_of_items_deleted_pages\n ));\n }", "public function carrouselListAction()\n {\n $listFilter = new Llv_Services_Cms_Filter_Carrousel();\n// $listFilter->online = true;\n $listFilter->includeDeleted = false;\n $this->view->assign('list', Llv_Context_Cms::getInstance()->carrouselGetList($listFilter));\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function display()\n\t{\n\t\t$this->list_table->prepare_items( $this->orderby );\n\n\t\t$this->form_start_get( 'process-all-items', null, 'process-all-items' );\n\t\t\t?><button>Process All Items</button><?php\n\t\t$this->form_end();\n\t\t\n\t\t$this->form_start_get( 'clear', null, 'clear' );\n\t\t\t?><button>Clear Items</button><?php\n\t\t$this->form_end();\n\n\t\t$this->form_start( 'upload-table' );\n\t\t\t$this->list_table->display();\n\t\t$this->form_end();\n\t}", "function link_card_in_page()\n\t{\n\t\tlog_message('debug', 'Account/link_card_in_page');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['featuredBanks'] = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'10', 'isFeatured'=>'Y'));\n\t\t$this->native_session->set('link_in_page','Y');\n\t\t$this->load->view('account/choose_bank', $data);\n\t}", "public function index()\n {\n $cfplayers = new \\App\\Models\\crossfire\\Cfplayers();\n $records = $cfplayers->findAll();\n \n // get a template parser\n $parser = \\Config\\Services::parser();\n \n // tell it about the substitions\n return $parser->setData(['records' => $records])\n // and have it render the template with those\n ->render('crossfire/cfplayerList');\n }", "public function displayCards($deckofCards)\n {\n for($i=0;$i<count($this->deckofCards);$i++){\n //displaying cards of each player\n echo \"Player \".($i+1).\": \";\n for($j=0;$j<count($this->deckofCards[$i]);$j++){\n echo \"\\\"\".$this->deckofCards[$i][$j].\"\\\"\".\" \";\n }\n echo \"\\n\\n\";\n }\n echo \"\\n\";\n }", "public function show(Whitecard $whitecard)\n {\n \n }" ]
[ "0.6704915", "0.66653955", "0.66653955", "0.66653955", "0.66653955", "0.6584204", "0.65477234", "0.6513434", "0.6508328", "0.6490301", "0.64776397", "0.64429545", "0.6429528", "0.6379577", "0.63323474", "0.6314259", "0.62990457", "0.6295611", "0.62953407", "0.6269108", "0.62574106", "0.62558", "0.6245486", "0.6206728", "0.62049264", "0.6196", "0.6152912", "0.61268985", "0.6101364", "0.6097663", "0.60714823", "0.6049795", "0.602494", "0.60181415", "0.6007747", "0.5994044", "0.5985592", "0.5967664", "0.59583604", "0.59561646", "0.5948816", "0.5946103", "0.5932256", "0.5928756", "0.5924543", "0.59116215", "0.5910216", "0.5902711", "0.5880698", "0.5874812", "0.58702636", "0.586932", "0.5863703", "0.5862052", "0.585856", "0.58225334", "0.5821807", "0.5815846", "0.5814948", "0.5804354", "0.5793005", "0.5781923", "0.5777", "0.577377", "0.5755842", "0.5734314", "0.5729029", "0.57117254", "0.5710551", "0.57078284", "0.5707595", "0.5705147", "0.5704632", "0.5698205", "0.56964487", "0.569488", "0.56879383", "0.5679361", "0.5670257", "0.56689924", "0.56681854", "0.5665392", "0.56438833", "0.5627165", "0.5627165", "0.5592116", "0.5591341", "0.55901754", "0.5588487", "0.5587088", "0.55790824", "0.5575134", "0.55748856", "0.55748856", "0.55748856", "0.5574557", "0.5566934", "0.5562756", "0.5560925", "0.5555738" ]
0.62310624
23
Switch the main functionality as a customer level
public function switchAction() { $value = $this->getRequest()->getParam('value'); if (is_null($value)) $value = 1; try { $customer = Mage::helper('mp_gateway')->getCustomer(); $customer->setData('enable_savedcards', $value)->save(); $this->_getSession()->addSuccess(sprintf('The card functionality has been successfully %s', ($value) ? 'enabled' : 'disabled')); } catch (Exception $e) { $this->_getSession()->addError('Error in the request, please try again'); } return $this->_redirectReferer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cust_lead(){\n }", "public function customer()\n {\n //try catch\n try {\n echo (\"\\n----------FACADE DESIGN PATTERN------------\\n\");\n echo (\"---------BEGIN TESTING FACADE PATTERN----------\\n\");\n echo (\"\\n\");\n //asking the user for input\n echo \"\\nPress 1 for twoWheelerVehicle \\nPress 2 for fourWheelerVehicle \\nPress 3 for Both twoNfourWheelerVehicles \\nPress 4 to exit \\n\";\n //validating the input using utility function\n $choice = utility::getInt(); \n //creating new manager class\n $manager = new Manager(); \n //switch statement is used to perform different actions based on different conditions\n switch ($choice) {\n case 1:\n //if customer chooses twoWheeler\n $twoWheelVehicle = $manager->getTwoWheelerVehicle(); \n echo \"\\n\";\n //calling customer function to show the menu to user again\n $this->customer(); \n break;\n case 2:\n //if customer chooses nonveg menu\n $fourWheelVehicle= $manager->getFourWheelerVechicle(); \n echo \"\\n\";\n echo \"\\n\";\n //calling customerFacing function to show the menu to user again\n $this->customer();\n break;\n case 3:\n //if customer chooses two and fourWheel vehicles\n $both = $manager->getBothVehicles(); //calling getVegNonMenu function on hotelKeeper object to show the menu\n echo \"\\n\";\n echo \"\\n\";\n $this->customer(); //calling customerFacing function to show the menu to user again\n break;\n default:\n //if customer chooses to exit\n echo \"Thank You for visiting Come again ...\\n\";\n echo \"\\n\";\n break;\n }\n } catch (Exception $e) {\n echo \"\\n\", $e->getMessage();\n } finally {\n echo (\"------------END TESTING FACADE PATTERN----------------\\n\");\n echo (\"\\n\");\n }\n }", "public function processGuestToCustomer()\n {\n }", "function bootCustomerAction()\n\t{\n\t\tif($this->_request->isPost() && $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$request = $this->_request->getParams();\n\t\t\t$quote_obj = new Ep_Quote_Quotes();\n\t\t\t$quote_obj->updateQuote(array('boot_customer'=>date('Y-m-d')),$request['qid']);\n\t\t\techo 'Client relanc&eacute; le '.date('d/m/Y');\n\t\t}\t\n\t}", "function customer_pre_process() {\n global $user;\n if (!$user || $user['role'] != ROLE_CUSTOMER) {\n redirect('/');\n }\n}", "function controller()\n\t\t{\t\n\t\t\t$this->admin_page_header();\n\t\t\t$this->admin_menu();\n\t\t}", "protected function activateSelf() {}", "public function customer() {\n $this->access_lib->_is(\"adm,mgr\");\n\n $data['header'] = $this->header;\n\n $this->load->view('report_customer_v', $data);\n }", "function customerMenu()\r\n{\r\n echo \"\\n================ CUSTOMER MENU ==================\\n\";\r\n echo \"1.check loans\\n2.apply loan\\n3.pay loan\\n4.get details\\n5.EMI calculator\\n6.pay installment\";\r\n}", "public function main(){\r\n\t\t//first check for permission\r\n\t\tif($this->users->is_logedin() && $this->users->has_permission('administrator_admin_panel')\t){\r\n\t\t\t\r\n\t\t\t//check for that user come from login process\r\n\t\t\tif($_GET['p'] == 'users' && $_GET['a'] == 'login'){\r\n\t\t\t\t//user come from login process and now should jump to default administrator page\r\n\t\t\t\tcore\\router::jump_page(core\\general::create_url(array('service','1','plugin','administrator','action','main','p','administrator','a','dashboard')\t)\t);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//going to show content\r\n\t\t\t\treturn $this->module_main();\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif(!$this->users->is_logedin()){\r\n\t\t\t//user do not has any permission to access to administrator area\r\n\t\t\tif($_GET['p'] == 'users' && $_GET['a'] == 'login'){\r\n\t\t\t\t//show login page\r\n\t\t\t\treturn $this->module_login_page();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//jump to login page\r\n\t\t\t\tcore\\router::jump_page(core\\general::create_url(array('service','1','plugin','administrator','action','main','p','users','a','login')\t)\t);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t//show no permission message\r\n\t\telseif($this->users->has_permission('administrator_admin_panel') != true){\r\n\t\t\treturn $this->module_no_permission();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public function bootstrap()\n\t{\n\t\tif ($this->bootstrapped)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->bootstrapped = TRUE;\n\n\t\t// Define the request type\n\t\t// Note: admin.php defines REQ=CP\n\t\tif ( ! defined('REQ'))\n\t\t{\n\t\t\tdefine('REQ', ((ee()->input->get_post('ACT') !== FALSE) ? 'ACTION' : 'PAGE'));\n\t\t}\n\n\t\t// Set a liberal script execution time limit, making it shorter for front-end requests than CI's default\n\t\tif (function_exists(\"set_time_limit\") == TRUE)\n\t\t{\n\t\t\t@set_time_limit((REQ == 'CP') ? 300 : 90);\n\t\t}\n\n\t\t// If someone's trying to access the CP but EE_APPPATH is defined, it likely\n\t\t// means the installer is still active; redirect to clean path\n\t\tif (ee()->config->item('subclass_prefix') != 'EE_' && ee()->uri->segment(1) == 'cp')\n\t\t{\n\t\t\theader('Location: '.SELF);\n\t\t\texit;\n\t\t}\n\n\t\t// some path constants to simplify things\n\t\tdefine('PATH_ADDONS', SYSPATH . 'ee/EllisLab/Addons/');\n\t\tdefine('PATH_MOD', SYSPATH . 'ee/EllisLab/Addons/');\n\t\tdefine('PATH_PI', SYSPATH . 'ee/EllisLab/Addons/');\n\t\tdefine('PATH_EXT', SYSPATH . 'ee/EllisLab/Addons/');\n\t\tdefine('PATH_FT', SYSPATH . 'ee/EllisLab/Addons/');\n\t\tdefine('PATH_RTE', APPPATH . 'rte_tools/');\n\t\tdefine('PATH_THIRD', SYSPATH . 'user/addons/');\n\t\tdefine('PATH_CACHE', SYSPATH . 'user/cache/');\n\t\tdefine('PATH_TMPL', SYSPATH . 'user/templates/');\n\t\tdefine('PATH_JS', 'compressed');\n\t\tdefine('PATH_DICT', SYSPATH . 'user/config/');\n\n\t\t// retain in case third-party add-ons expect IS_CORE to be defined\n\t\tdefine('IS_CORE',\t\tFALSE);\n\n\t\t// application constants\n\t\tdefine('APP_NAME',\t\t'ExpressionEngine');\n\t\tdefine('APP_BUILD',\t\t'20200422');\n\t\tdefine('APP_VER',\t\t'5.3.2');\n\t\tdefine('APP_VER_ID',\t'');\n\t\tdefine('SLASH',\t\t\t'&#47;');\n\t\tdefine('LD',\t\t\t'{');\n\t\tdefine('RD',\t\t\t'}');\n\t\tdefine('AMP',\t\t\t'&amp;');\n\t\tdefine('NBS', \t\t\t'&nbsp;');\n\t\tdefine('BR', \t\t\t'<br />');\n\t\tdefine('NL',\t\t\t\"\\n\");\n\t\tdefine('AJAX_REQUEST',\tee()->input->is_ajax_request());\n\t\tdefine('USERNAME_MAX_LENGTH', 75);\n\t\tdefine('PASSWORD_MAX_LENGTH', 72);\n\t\tdefine('DOC_URL', 'https://docs.expressionengine.com/v5/');\n\t\tdefine('URL_TITLE_MAX_LENGTH', 200);\n\n\t\tee()->load->helper('language');\n\t\tee()->load->helper('string');\n\n\t\t// Load the default caching driver\n\t\tee()->load->driver('cache');\n\n\t\tee()->load->database();\n\t\tee()->db->swap_pre = 'exp_';\n\t\tee()->db->db_debug = FALSE;\n\n\t\t// boot the addons\n\t\tee('App')->setupAddons(SYSPATH . 'ee/EllisLab/Addons/');\n\t\tee('App')->setupAddons(PATH_THIRD);\n\n\t\t// Set ->api on the legacy facade to the model factory\n\t\tee()->set('api', ee()->di->make('Model'));\n\n\t\t// If debug is on we enable the profiler and DB debug\n\t\tif (DEBUG == 1 OR ee()->config->item('debug') == 2)\n\t\t{\n\t\t\t$this->_enable_debugging();\n\t\t}\n\n\t\t// Assign Site prefs now that the DB is fully loaded\n\t\tif (ee()->config->item('site_name') != '')\n\t\t{\n\t\t\tee()->config->set_item('site_name', preg_replace('/[^a-z0-9\\-\\_]/i', '', ee()->config->item('site_name')));\n\t\t}\n\n\t\tee()->config->site_prefs(ee()->config->item('site_name'));\n\n\t\t// earliest point we can apply this, makes sure that PHPSESSID cookies\n\t\t// don't leak to JS by setting the httpOnly flag\n\t\t$secure = bool_config_item('cookie_secure');\n\t\t$httpOnly = (ee()->config->item('cookie_httponly')) ? bool_config_item('cookie_httponly') : TRUE;\n\t\tsession_set_cookie_params(0, ee()->config->item('cookie_path'), ee()->config->item('cookie_domain'), $secure, $httpOnly);\n\n\t\t// this look backwards, but QUERY_MARKER is only used where we MUST\n\t\t// have a ?, and do not want to double up\n\t\t// question marks on sites who are forcing query strings\n\t\tdefine('QUERY_MARKER', (ee()->config->item('force_query_string') == 'y') ? '' : '?');\n\n\t\t// Load the settings of the site you're logged into, however use the\n\t\t// cookie settings from the site that corresponds to the URL\n\t\t// e.g. site1.com/system/ viewing site2\n\t\t// $last_site_id = the site that you're viewing\n\t\t// config->item('site_id') = the site who's URL is being used\n\n\t\t$last_site_id = ee()->input->cookie('cp_last_site_id');\n\n\t\tif (REQ == 'CP' && ee()->config->item('multiple_sites_enabled') == 'y')\n\t\t{\n\t\t\t$cookie_prefix = ee()->config->item('cookie_prefix');\n\t\t\t$cookie_path = ee()->config->item('cookie_path');\n\t\t\t$cookie_domain = ee()->config->item('cookie_domain');\n\t\t\t$cookie_httponly = ee()->config->item('cookie_httponly');\n\n\t\t\tif ($cookie_prefix)\n\t\t\t{\n\t\t\t\t$cookie_prefix .= '_';\n\t\t\t}\n\n\t\t\tif (! empty($last_site_id) && is_numeric($last_site_id) && $last_site_id != ee()->config->item('site_id'))\n\t\t\t{\n\t\t\t\tee()->config->site_prefs('', $last_site_id);\n\t\t\t}\n\n\t\t\tee()->config->cp_cookie_prefix = $cookie_prefix;\n\t\t\tee()->config->cp_cookie_path = $cookie_path;\n\t\t\tee()->config->cp_cookie_domain = $cookie_domain;\n\t\t\tee()->config->cp_cookie_httponly = $cookie_httponly;\n\t\t}\n\n\t\t// This allows CI compatibility\n\t\tif (ee()->config->item('base_url') == FALSE)\n\t\t{\n\t\t\tee()->config->set_item('base_url', ee()->config->item('site_url'));\n\t\t}\n\n\t\tif (ee()->config->item('index_page') == FALSE)\n\t\t{\n\t\t\tee()->config->set_item('index_page', ee()->config->item('site_index'));\n\t\t}\n\n\t\t// Backwards compatibility for the removed secure forms setting.\n\t\t// Developers are still checking against this key, so we'll wait some\n\t\t// time before removing it.\n\t\t$secure_forms = (bool_config_item('disable_csrf_protection')) ? 'n' : 'y';\n\t\tee()->config->set_item('secure_forms', $secure_forms);\n\n\t\t// Set the path to the \"themes\" folder\n\t\tif (ee()->config->item('theme_folder_path') !== FALSE &&\n\t\t\tee()->config->item('theme_folder_path') != '')\n\t\t{\n\t\t\t$theme_path = preg_replace(\"#/+#\", \"/\", ee()->config->item('theme_folder_path').'/');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$theme_path = substr(APPPATH, 0, - strlen(SYSDIR.'/expressionengine/')).'themes/';\n\t\t\t$theme_path = preg_replace(\"#/+#\", \"/\", $theme_path);\n\t\t}\n\n\t\t// Maybe the site has been moved.\n\t\t// Let's try some basic autodiscovery if config items are set\n\t\t// But the directory does not exist.\n\t\tif ( ! is_dir($theme_path.'/ee'))\n\t\t{\n\t\t\tif (is_dir(FCPATH.'../themes/')) // We're in the system directory\n\t\t\t{\n\t\t\t\t$theme_path = FCPATH.'../themes/';\n\t\t\t}\n\t\t\telseif (is_dir(FCPATH.'themes/')) // Front end.\n\t\t\t{\n\t\t\t\t$theme_path = FCPATH.'themes/';\n\t\t\t}\n\t\t}\n\n\t\t$theme_url = ee()->config->slash_item('theme_folder_url');\n\n\t\tdefine('PATH_THEMES', $theme_path.'ee/');\n\t\tdefine('URL_THEMES', $theme_url.'ee/');\n\t\tdefine('PATH_THEMES_GLOBAL_ASSET', PATH_THEMES.'asset/');\n\t\tdefine('URL_THEMES_GLOBAL_ASSET', URL_THEMES.'asset/');\n\t\tdefine('PATH_CP_THEME', PATH_THEMES.'cp/');\n\n\t\tdefine('PATH_THIRD_THEMES', $theme_path.'user/');\n\t\tdefine('URL_THIRD_THEMES', $theme_url.'user/');\n\n\t\tdefine('PATH_MBR_THEMES', PATH_THEMES.'member/');\n\t\tdefine('PATH_CP_GBL_IMG', URL_THEMES_GLOBAL_ASSET.'img/');\n\n\t\tdefine('PATH_THEME_TEMPLATES', SYSPATH . 'ee/templates/_themes/');\n\t\tdefine('PATH_THIRD_THEME_TEMPLATES', SYSPATH . 'user/templates/_themes/');\n\n\n\t\tunset($theme_path);\n\n\t\t// Load the very, very base classes\n\t\tee()->load->library('functions');\n\t\tee()->load->library('extensions');\n\t\tee()->load->library('api');\n\t}", "function main(){\n\n switch($_SESSION[\"action\"]){\n\n case ACTION_ADD:\n Reference::select_type();\n break;\n case ACTION_SEARCH:\n if($_SESSION[\"confirm\"] == \"TRUE\"){\n Reference::search();\n unset($_SESSION[\"confirm\"]);\n } else {\n Reference::view_search();\n }\n break;\n case ACTION_BROWSE:\n Reference::browse();\n break;\n default:\n include($GLOBALS[\"draw_includes_path\"].\"/Reference/.Reference.html\");\n\n }\n\n }", "function weAbstractCustomerFilter($mode=WECF_OFF, $specificCustomers=array(), $blackList=array(), $whiteList=array(), $filter=array()) {\n\t\t$this->setMode($mode);\n\t\t$this->setSpecificCustomers($specificCustomers);\n\t\t$this->setBlackList($blackList);\n\t\t$this->setWhiteList($whiteList);\n\t\t$this->setFilter($filter);\n\t}", "public function customers()\n {\n if ($_SESSION['role'] == 1)\n { \n //get customers info from the database\n $Customer = $this->model('Customer');\n $this->customers = $Customer->adminGetCustomers(); \n $this->view('AdminDashboard/customers', ['viewName' => 'Dashboard - Customers']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n\n }", "static function handle_activate()\n\t{\n\t\tself::handle_multi_site( 'activate' );\n\t}", "function auto_run()\n\t{\n\t\t$this->html = $this->ipsclass->acp_load_template('cp_skin_tools');\n\n\t\tswitch($this->ipsclass->input['code'])\n\t\t{\n\t\t\tcase 'master_xml_export':\n\t\t\t\t$this->master_xml_export();\n\t\t\t\tbreak;\n\n\t\t\tcase 'manage':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );\n\t\t\t\t$this->components_list();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_add':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );\n\t\t\t\t$this->components_form('add');\n\t\t\t\tbreak;\n\t\t\tcase 'component_add_do':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );\n\t\t\t\t$this->components_save('add');\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_edit':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_form('edit');\n\t\t\t\tbreak;\n\t\t\tcase 'component_edit_do':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_save('edit');\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_delete':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_delete();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_export':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':export' );\n\t\t\t\t$this->components_export('single');\n\t\t\t\tbreak;\n\t\t\tcase 'component_import':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':import' );\n\t\t\t\t$this->components_import();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_uninstall':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_uninstall();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_move':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_move();\n\t\t\t\tbreak;\n\t\t\tcase 'component_toggle_enabled':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_toggle_enabled();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );\n\t\t\t\t$this->components_list();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function scl_activate()\n{\n //\n}", "function homeAction(){\n \n switch($_SESSION['level']){\n \n case 'Admin':\n require_once MODULES.'/finance/controllers/revenue.php';\n require_once MODULES.'/finance/controllers/expense.php';\n require_once MODULES.'/business/controllers/enroll.php';\n \n /**\n * Get Cash Receipts from Finance Module\n */\n $cr = new Viven_Finance_Revenue;\n $creceipts = $cr -> getRevenueAction();\n \n $er = new Viven_Finance_Expense;\n $ereports = $er -> getExpensesAction();\n \n $ne = new Viven_Business_Enroll;\n $nenrollments = $ne -> getEnrollmentsAction();\n \n $this -> view -> revenue = $creceipts;\n $this -> view -> expense = $ereports;\n $this -> view -> enrollment = $nenrollments;\n $this -> view -> render('account/home','user');\n break;\n \n case 'Manager':\n require_once MODULES.'/data/models/logindata.php';\n $obj = new Viven_Data_Model();\n $records = $obj -> getRecords('0,100');\n\n $this -> view -> data1 = $records;\n $this -> view -> data2 = $records;\n $this -> view -> data3 = $records;\n $this -> view -> data4 = $records;\n $this -> view -> render('account/home','user');\n break;\n \n case 'Standard': \n default:\n require_once MODULES.'/data/models/logindata.php';\n $obj = new Viven_Data_Model();\n $records = $obj -> getRecords('0,100');\n\n $this -> view -> data1 = $records;\n $this -> view -> data2 = $records;\n $this -> view -> data3 = $records;\n $this -> view -> data4 = $records;\n $this -> view -> render('account/home','user');\n break;\n \n } \n \n }", "public function activate();", "public function activate();", "public function frontend() {\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tinclude_once $this->includes_path() . 'class-mobile-detect.php';\n\t\t\t$this->mobile = new cyprus_Mobile_Detect();\n\n\t\t\tinclude_once $this->includes_path() . 'functions-cyprus-attr.php';\n\t\t\tinclude_once $this->includes_path() . 'functions-cyprus-template-tags.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-layout.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-scripts.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-head.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-footer.php';\n\n\t\t\t$this->add_filter( 'pre_get_posts', 'modify_search_filter' );\n\t\t\t$this->add_filter( 'pre_get_posts', 'homepage_ignore_sticky' );\n\t\t}", "public function preDispatch()\n {\n parent::preDispatch();\n \n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n \n // adding message in customer login page\n Mage::getSingleton('core/session')\n ->addSuccess(Mage::helper('ordercustom')->__('Please sign in or create a new account'));\n }\n }", "public function customer()\n {\n \n // Sustomer is stil step 0\n $this->set_step(0);\n\n\n\n // You are logged in, you dont have access here\n if($this->current_user)\n {\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n }\n\n\n\n // Check to see if a field is available\n if( $this->input->post('customer') )\n {\n\n $input = $this->input->post();\n switch($input['customer'])\n {\n case 'register':\n $this->session->set_userdata('nitrocart_redirect_to', NC_ROUTE .'/checkout/billing');\n redirect('users/register');\n break;\n case 'guest':\n $this->session->set_userdata('user_id', 0);\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n break;\n default:\n break;\n }\n //more like an system error!\n $this->session->set_flashdata( JSONStatus::Error , 'Invalid selection');\n redirect( NC_ROUTE . '/checkout');\n }\n\n $this->set_step(0);\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('User Account')\n ->build( $this->theme_layout_path . 'customer');\n }", "public static function activate(){\n }", "function activateClinicPlan(){\n $clinic_id = $this->clinicInfo(\"clinic_id\");\n if( is_numeric($clinic_id) ) {\n $plan_id = $this->value('plan_id');\n \n if( is_numeric($plan_id)){\n \n //Get plan status\n $query = \"select is_public from plan where plan_id = '{$plan_id}' \"; \n $result = @mysql_query($query);\n if( $row = @mysql_fetch_array($result) ){\n $is_public = $row['is_public'];\n }\n if( (is_null($is_public) || $is_public != 1) && $this->value('act') == 'publish' ){\n $this->copy_plan_to_all_account_clinic($clinic_id, $plan_id);\n $is_public_sql = \" ,is_public = 1 \";\n }\n else{\n $is_public_sql = \"\";\n }\n \n $query = \" update plan set status = 1 $is_public_sql where plan_id = '{$plan_id}' \"; \n @mysql_query($query);\n }\n //unset($_SESSION['plan_id']);\n \n }\n // Redirect to Home page.\n header(\"location:index.php?action=therapist\");\n \n \n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public function run() {\n\n\t\t// Add the admin page.\n\t\t$admin_page = new AdminPage();\n\t\t$admin_page->init();\n\n\t\t// Log frontend visits.\n\t\t$log = new Log();\n\t\t$log->run();\n\n\t\t$cloverly = new PaymentAPICloverly();\n\t\t$cloverly->init();\n\t}", "public function myCustomers(){\n $obj = new Customer(); \n \n dashboard_add_plugin_js(array('bootbox/bootbox.min.js', 'bootstrap-fileinput/bootstrap-fileinput.js', 'data-tables/jquery.dataTables.js', 'data-tables/DT_bootstrap.js', 'uniform/jquery.uniform.min.js'));\n \n dashboard_add_footer_js(array('custom/common_js/table-ajax.js', 'custom/common_js/datatable.js', 'custom/common_js/app.js'));\n dashboard_add_plugin_css(array('bootstrap-fileinput/bootstrap-fileinput.css', 'data-tables/DT_bootstrap.css', 'bootstrap/css/bootstrap.min.css'));\n dashboard_add_css(array('common/common.css', 'plugins.css', 'style-metronic.css'));\n\n $data['title'] = lang(\"account_menu_my_customers\");\n $data['tag'] = lang(\"account_menu_my_customers\");\n $data['module'] = \"customers\";\n $data['breadcrumb'] = array('Home' => 'coach/dashboard', $data['tag'] => '');\n $data['view_file'] = \"coach/my_customers\";\n $this->tamplate->coach_template($data);\n\n }", "public function main()\n {\n // check if user logged if not redirect to login page.\n if(Session::logged() == NULL){\n header(\"location: /\" . ROOT . 'login');\n }\n // if logged only administrator with role owner or manager have access to administration page.\n else if(Session::logged()['role'] == 'manager' || Session::logged()['role'] == 'owner'){\n // creating administration page.\n\n $data = NULL;\n $p = new Page(\"Administration Page\");\n $p->setComponent(\"htmlAdministrator.php\", $data);\n $p->addCss(\"administrator.css\");\n $p->addJs('administrator.js');\n $p->dumpView();\n }\n // not owner or manager trying access to administrator page, redirect to school page.\n else{\n header(\"location: /\" . ROOT . 'school');\n }\n }", "public function switchView()\n {\n if ( !$this->ownerLoggedIn() )\n {\n $this->redirect(\"index.php\");\n\n }\n \n require_once('views/SwitchView.class.php'); \n \n $site = new SiteContainer($this->db);\n \n $sv = new SwitchView();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $sv->printHtml($this->businesses);\n $site->printFooter(); \n \n \n }", "function customerOperations($obj)\r\n{\r\n do\r\n {\r\n # displaying customer menu \r\n customerMenu();\r\n \r\n $option = readline(\"\\nEnter customer option : \");\r\n\r\n # performing operations based on option entered\r\n switch ($option)\r\n {\r\n # for checking available loans \r\n case 1:\r\n $obj->checkLoans();\r\n break;\r\n\r\n # for applying loan\r\n case 2:\r\n $obj->applyLoan();\r\n break;\r\n\r\n # for clearing the loan\r\n case 3:\r\n $obj->payLoan();\r\n break;\r\n\r\n # get the details of customer\r\n case 4:\r\n $obj->getDetails();\r\n break;\r\n\r\n # EMI calculator\r\n case 5: \r\n $amount = readline(\"Enter principal amount : \");\r\n $intrest = readline(\"Intrest per annum : \");\r\n $months = readline(\"Number of months : \");\r\n\r\n # using emiCalculator from namespace calc\r\n echo \"The EMI is :\" . calc\\emiCalculator($amount, $intrest, $months);\r\n break; \r\n\r\n # to pay monthly installment\r\n case 6:$obj->payInstallment();\r\n break;\r\n \r\n # to exit from customer menu \r\n case \"exit\":\r\n echo \"you are exited from Customer Menu\";\r\n break;\r\n }\r\n\r\n }while ($option != \"exit\");\r\n}", "public function promote_your_business()\r\n\t{\r\n\t\t// Load template\r\n\t\tinclude(BLUPATH_TEMPLATES.'/site/modules/promote_your_business.php');\r\n\t}", "function customers_init(&$options, $memberInfo, &$args){\n\n\t\treturn TRUE;\n\t}", "function adminMenu()\r\n{\r\n echo \"=============== ADMIN MENU ================\\n\";\r\n echo \"1.ADD LOAN\\n2.ADD CUSTOMER\\n3.check loans\\n4.get customer details\\n\";\r\n}", "function wp_dashboard_primary_control()\n {\n }", "static function activate() {\n\t}", "public function main () {\r\n\t\t$debugLevel = Configure::read('debug');\r\n\t\tif ($debugLevel < 1) {\r\n\t\t\tdie('Can\\'t run in production mode...');\r\n\t\t}\r\n\t\t$dont_unload = array(\r\n\t\t);\r\n\t\tforeach ($this->uses as $Model) {\r\n\t\t\tif (array_search($Model, $dont_unload) === false) {\r\n\t\t\t\t$this->{$Model}->Behaviors->unload('Elasticsearch.Searchable');\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t\t$this->dataSource = ConnectionManager::getDataSource('old');\r\n\t\t$this->_connect();\r\n\t\tmysql_select_db($this->dataSource->config['database'], $this->sql);\r\n\t\tmysql_query(\"set names '\" . $this->dataSource->config['encoding'] . \"'\");\r\n\r\n\t\t$this->out('Transferring Users');\r\n\t\t$this->transfer_400_users();\r\n\t\t$this->out('Delivery Addresses');\r\n\t\t$this->transfer_delivery_addresses();\r\n\t}", "function wp_dashboard_secondary_control()\n {\n }", "public function main()\n {\n $role = Auth::user()->role_id;\n if (env('ENV') == 'ADMIN' && $role=='1'){\n return redirect('user-management');\n }else if(env('ENV') == 'DEVELOPER' && $role=='2'){\n return redirect('apps-developer');\n }else{\n Auth::logout();\n return redirect('login')->with('err_message', 'Akun anda tidak memiliki akses kesini');\n }\n }", "public function activate() {\n\t\t\n\t}", "function UKMpush_to_front_dash_hook( $TWIGdata ) {\n\tif( get_option('site_type') == 'fylke' ) {\n\t\trequire_once(dirname( __FILE__ ) .'/controller/dashboard.controller.php');\n\t}\n\treturn $TWIGdata;\n}", "public function index()\n {\n // load function main\n $this->main();\n }", "abstract protected function switchOnBySuiteName($name);", "private function actions() {\n\n $this->prefix = CUSTOM_LOGIN_OPTION;\n\n register_activation_hook( CUSTOM_LOGIN_FILE, array( $this, 'activate' ) );\n\n add_action( 'login_head', array( $this, 'cl_version_in_header' ), 1 );\n add_action( 'wp_head', array( $this, 'cl_version_in_header' ) );\n add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 );\n add_action( 'admin_init', array( $this, 'load_settings' ), 8 );\n add_action( $this->prefix . '_after_sanitize_options', array( $this, 'delete_transients' ), 8 );\n\n add_action( 'admin_notices', array( $this, 'show_notifications' ) );\n add_action( 'admin_init', array( $this, 'notification_ignore' ) );\n\n do_action( $this->prefix . '_actions' );\n }", "public function run()\n {\n DB::table('users')->insert([\n 'email' => '[email protected]',\n 'name' => 'jude',\n 'password' => bcrypt('abc'),\n ]);\n \\Bouncer::allow('customer')->to('view', \\App\\Airport::class);\n \t\n $cust = User::where('email', '[email protected]')->first();\n $cust->assign('customer');\n }", "protected function main() {\n $this->ControllerView->mainpage();\n }", "public function mainscreen()\r\n\t{\r\n\t\t$this->setRedirect( 'index.php?option=com_jblesta&controller=default' );\r\n\t\t$this->redirect();\r\n\t}", "function Functionality()\r\n\t{\r\n\t\tglobal $_REQUEST;\r\n\t\tglobal $_SESSION;\r\n\t\tglobal $_SETTINGS;\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * User Accounts\r\n\t\t *\r\n\t\t */\r\n\t\tif(checkActiveModule('0000005'))\r\n\t\t{\t\t\r\n\t\t\t$UserAccounts = new UserAccounts();\t\t\t\r\n\t\t\t$UserAccounts->LoginForm();\r\n\t\t\t$UserAccounts->ForgotPasswordForm();\r\n\t\t\t$UserAccounts->RegistrationForm(0,0);\r\n\t\t\t$UserAccounts->SendVerificationEmailForm();\r\n\t\t\t$UserAccounts->AccountForm();\r\n\t\t\t$UserAccounts->UnsubscribeEmailForm();\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * Contact\r\n\t\t *\r\n\t\t */\r\n\t\tif(checkActiveModule('0000006'))\r\n\t\t{\t\t\t\r\n\t\t\t$Contact = new Contact();\t\t\t\r\n\t\t\t$Contact->ContactForm();\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * Slideshow\r\n\t\t *\r\n\t\t */\r\n\t\tif(checkActiveModule('0000015'))\r\n\t\t{\t\t\r\n\t\t\t$ImageSlider3 = new ImageSlider3();\t\t\t\t\r\n\t\t\t$ImageSlider3->DisplayImageSlider3();\r\n\t\t}\t\t\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * Portfolio\r\n\t\t *\r\n\t\t */\r\n\t\tif(checkActiveModule('0000017'))\r\n\t\t{\t\t\r\n\t\t\t$Portfolio = new Portfolio();\t\t\t\t\r\n\t\t\t$Portfolio->DisplayPortfolio();\r\n\t\t}\t\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * Events\r\n\t\t *\r\n\t\t\r\n\t\tif(checkActiveModule('0000019'))\r\n\t\t{\t\t\r\n\t\t\t$Events = new Events();\t\t\t\t\r\n\t\t\t$Events->DisplayEvents();\t\t\t\r\n\t\t}\t\r\n\t\t */\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * Ecommerce\r\n\t\t *\r\n\t\t */\r\n\t\tif(checkActiveModule('0000012'))\r\n\t\t{\r\n\t\t\t$Ecommerce = new Ecommerce();\r\n\t\t\t//$Ecommerce->SearchAndDisplayProducts();\r\n\t\t\t$Ecommerce->DisplayProductDetails();\r\n\t\t\t$Ecommerce->DisplayShoppingCart();\r\n\t\t\t$Ecommerce->CheckoutInformationForm();\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t *\r\n\t\t * Properties\r\n\t\t *\r\n\t\t */\r\n\t\tif(checkActiveModule('0000020'))\r\n\t\t{\r\n\t\t\t$Properties = new Properties();\r\n\t\t\t$Properties->DisplayProperties();\r\n\t\t}\r\n\t}", "private function process_frontend_actions() {\n\t\t\n\t\tif(is_admin()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t$this->extras->page_load_actions();\n\t\t}\n\n\t\n\t}", "function adminOperations()\r\n{\r\n do\r\n {\r\n #displaying admin menu\r\n adminMenu();\r\n $option = readline(\"Enter admin option : \");\r\n\r\n # executing operation based on option entered\r\n switch ($option)\r\n {\r\n case 1:\r\n $GLOBALS['adminObj']->addLoan();\r\n break;\r\n case 2:\r\n $GLOBALS['adminObj']->addCustomer();\r\n break;\r\n case 3:\r\n $GLOBALS['adminObj']->checkLoans();\r\n break;\r\n case 4: $GLOBALS['adminObj']->getCustDetails();\r\n break; \r\n case \"exit\":\r\n echo \"you are exited from the Admin Menu\";\r\n break;\r\n default:\r\n echo \"Enter a valid option from admin\\n\";\r\n break;\r\n\r\n }\r\n }while ($option != \"exit\");\r\n\r\n}", "public function customers(){\r\n if(isset($_SESSION['admindata'])){\r\n $this->load->view('layout/header', $nav['navdisable'] = \"none\");\r\n $this->load->view('admin/customer');\r\n $this->load->view('layout/footer');\r\n } else {\r\n $this->load->view('layout/header');\r\n $this->load->view('admin/login');\r\n $this->load->view('layout/footer'); \r\n }\r\n }", "function admin_demoMode()\n{\n\tstatic $once = false;\n\tif ($once) {\n\t\treturn;\n\t}\n\n\tglobal $g_user_login;\n\tif ($g_user_login->userID() === '1') # If the logged user is the super administrator, then disable the demo mode !!!\n\t{\n\t\tadmin_demoMode_message(LANG_ADMIN_DEMO_MODE_TIPS_SUPER_ADMIN);\n\t} else {\n\t\tadmin_demoMode_message(LANG_ADMIN_DEMO_MODE_TIPS);\n\n\t\t$_REQUEST\t= NULL;\n\t\t$_POST\t\t= NULL;\n\t\tforeach($_GET as $k => $v) {\n\t\t\tif (!in_array($k, array('go', 'tab', 'menu'))) { # Preserve the admin navigation !\n\t\t\t\tunset($_GET[$k]);\n\t\t\t}\n\t\t}\n\t}\n\n\t$once = true;\n}", "function sportal_main()\n{\n\tglobal $smcFunc, $context, $sourcedir;\n\n\tif (WIRELESS)\n\t\tredirectexit('action=forum');\n\n\t$context['page_title'] = $context['forum_name'];\n\n\tif (isset($context['page_title_html_safe']))\n\t\t$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));\n\n\tif (!empty($context['standalone']))\n\t\tsetupMenuContext();\n\n\t$actions = array(\n\t\t'articles' => array('PortalArticles.php', 'sportal_articles'),\n\t\t'categories' => array('PortalCategories.php', 'sportal_categories'),\n\t\t'credits' => array('', 'sportal_credits'),\n\t\t'index' => array('', 'sportal_index'),\n\t\t'pages' => array('PortalPages.php', 'sportal_pages'),\n\t\t'shoutbox' => array('PortalShoutbox.php', 'sportal_shoutbox'),\n\t);\n\n\tif (!isset($_REQUEST['sa']) || !isset($actions[$_REQUEST['sa']]))\n\t\t$_REQUEST['sa'] = 'index';\n\n\tif (!empty($actions[$_REQUEST['sa']][0]))\n\t\trequire_once($sourcedir . '/' . $actions[$_REQUEST['sa']][0]);\n\n\t$actions[$_REQUEST['sa']][1]();\n}", "function auto_run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Load some more caches\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->init_load_cache( array( 'components', 'languages' ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init the nav\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, '(FSY23) Universal Mod Installer' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Load the XML class\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( KERNEL_PATH.\"class_xml.php\" );\n\t\t$this->ipsclass->xml = new class_xml();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init the settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->settings_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init ACP Help\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->acp_help_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get our installed mods\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->installed_mods_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init the mod\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->mod_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// What are we doing?\n\t\t//-----------------------------------------\n\t\t\n\t\tswitch ( $this->ipsclass->input['code'] )\n\t\t{\n\t\t\tcase 'settings':\n\t\t\t\t$this->view_settings();\n\t\t\t\tbreak;\n\t\t\tcase 'view':\n\t\t\t\t$this->view_mods();\n\t\t\t\tbreak;\n\t\t\tcase 'install':\n\t\t\t\t$this->pre_install();\n\t\t\t\tbreak;\n\t\t\tcase 'work':\n\t\t\t\t$this->runme();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->view_mods();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function activate ()\n\t{\n\t\tswitch ($this->getAction ())\n\t\t{\n\t\t\tcase 'modifyUser':\n\t\t\t\tif ($this->getUserName () == 'test')\n\t\t\t\t{\n\t\t\t\t\tdie ('not allowed for test user');\n\t\t\t\t}\n\t\t\t\t$checkPasswd = true;\n\t\t\t\t$user = $this->itemFactory->requestToUser ($checkPasswd);\n\t\t\t\t$this->operations->modifyUser ($this->getUserName(), $user);\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "function vc_before_init_actions() {\n \t require_once( get_template_directory().'/vc-elements/my-first-custom-element.php' );\n require_once( get_template_directory().'/vc-elements/progressbar0.php' );\n\t require_once( get_template_directory().'/vc-elements/card-counter-card.php' );\t \n\t require_once( get_template_directory().'/vc-elements/Services.php' );\t\n require_once( get_template_directory().'/vc-elements/Carousel-Side-Caption.php' );\n\t require_once( get_template_directory().'/vc-elements/InteractiveSVG.php' );\n\t require_once( get_template_directory().'/vc-elements/piechart.php' );\n\t require_once( get_template_directory().'/vc-elements/OurServices.php' );\n\t require_once( get_template_directory().'/vc-elements/Timeline66.php' );\n\t require_once( get_template_directory().'/vc-elements/ServiceBox76.php' );\n\t require_once( get_template_directory().'/vc-elements/project.php' );\n\t require_once( get_template_directory().'/vc-elements/project1.php' );\n\t }", "public function your_business()\r\n\t{\r\n\t\t/* Prepare page. */\r\n\t\t$this->_categorySlug = __FUNCTION__;\r\n\t\t$this->_category = 'Your Business';\r\n\r\n\t\t/* Add breadcrumb */\r\n\t\t$breadcrumbs = BluApplication::getBreadcrumbs();\r\n\t\t$breadcrumbs->add($this->_controllerName, '/'.strtolower($this->_controllerName));\r\n\t\t$breadcrumbs->add($this->_category, '/'.strtolower($this->_controllerName).'/'.__FUNCTION__);\r\n\r\n\t\t/* Display page */\r\n\t\t$this->_categoryPage();\r\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true);\n\n // adding message in customer login page\n Mage::getSingleton('core/session')\n ->addSuccess(Mage::helper('inchoo_tickets')->__('Please sign in or create a new account.'));\n }\n }", "function customers_management()\n\t{\n\t\t\t//GROCERY CRUD SETUP\n\t\t\t$crud = new grocery_CRUD();\n\n\t\t\t$crud->set_table('customers');\n\t\t\t$crud->columns('salesRepEmployeeNumber','customerName','contactLastName','phone','countryID','stateID','cityID');\n\t\t\t$crud->display_as('salesRepEmployeeNumber','From Employeer')\n\t\t\t\t ->display_as('customerName','Name')\n\t\t\t\t ->display_as('cityID','City/Town')\n\t\t\t\t ->display_as('stateID','State/Province')\n\t\t\t\t ->display_as('countryID','Country')\n\t\t\t\t ->display_as('contactLastName','Last Name');\n\t\t\t$crud->set_subject('Customer');\n\t\t\t$crud->set_relation('salesRepEmployeeNumber','employees','extension');\n\t\t\t$crud->set_relation('countryID','country','country_title');\n\t\t\t$crud->set_relation('stateID','state','state_title');\n\t\t\t$crud->set_relation('cityID','city','city_title');\n\t\t\t$crud->fields('customerName','contactLastName','phone','countryID','stateID','cityID');\n\t\t\t$crud->required_fields('countryID','stateID','cityID');\t\t\n\t\t\t\n\t\t\t//IF YOU HAVE A LARGE AMOUNT OF DATA, ENABLE THE CALLBACKS BELOW - FOR EXAMPLE ONE USER HAD 36000 CITIES AND SLOWERD UP THE LOADING PROCESS. THESE CALLBACKS WILL LOAD EMPTY SELECT FIELDS THEN POPULATE THEM AFTERWARDS\n\t\t\t$crud->callback_add_field('stateID', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_edit_field('stateID', array($this, 'empty_state_dropdown_select'));\n\t\t\t$crud->callback_add_field('cityID', array($this, 'empty_city_dropdown_select'));\n\t\t\t$crud->callback_edit_field('cityID', array($this, 'empty_city_dropdown_select'));\n\t\t\t\t\t\t\n\t\t\t$output = $crud->render();\n\t\t\t\n\t\t\t//DEPENDENT DROPDOWN SETUP\n\t\t\t$dd_data = array(\n\t\t\t\t//GET THE STATE OF THE CURRENT PAGE - E.G LIST | ADD\n\t\t\t\t'dd_state' => $crud->getState(),\n\t\t\t\t//SETUP YOUR DROPDOWNS\n\t\t\t\t//Parent field item always listed first in array, in this case countryID\n\t\t\t\t//Child field items need to follow in order, e.g stateID then cityID\n\t\t\t\t'dd_dropdowns' => array('countryID','stateID','cityID'),\n\t\t\t\t//SETUP URL POST FOR EACH CHILD\n\t\t\t\t//List in order as per above\n\t\t\t\t'dd_url' => array('', site_url().'/examples/get_states/', site_url().'/examples/get_cities/'),\n\t\t\t\t//LOADER THAT GETS DISPLAYED NEXT TO THE PARENT DROPDOWN WHILE THE CHILD LOADS\n\t\t\t\t'dd_ajax_loader' => base_url().'ajax-loader.gif'\n\t\t\t);\n\t\t\t$output->dropdown_setup = $dd_data;\n\t\t\t\n\t\t\t$this->_example_output($output);\n\t}", "function customer(){\n $data['customer'] = $this->m_rental->get_data('customer')->result();\n $this->load->view('header');\n $this->load->view('admin/customer',$data);\n $this->load->view('footer');\n }", "public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }", "function activate_wp_book() {\n Inc\\Base\\Activate::activate();\n}", "public function woocommerce_before_main_content()\n {\n self::add( __FUNCTION__, '__return_false', 1 );\n }", "function activate(){\n\n\t\t//$this->deactivate();\n\n\t\t$current_version = FALSE;\n\t\t$general_options = $options[ WPC_OPTIONS ];\n\t\t\n\t\tif ( $general_options !== FALSE && isset( $general_options[ 'WPC_VERSION' ] ) ){\n\t\t\t$current_version = $general_options[ 'WPC_VERSION' ];\t\t\n\t\t}\n\t\t\n\t\tif ( $current_version === FALSE || version_compare( $current_version, \"2.0\" ) == -1 ){\n\t\t\t\n\t\t\t// get the options from the old version\n\t\t\t$options = WordpressConnect::getOldVersionOptions();\n\t\t\t// port the options into the new version\n\t\t\tWordpressConnect::setOptions( $options );\n\t\t\t\n\t\t}\t\t\n\t\telse {\n\n\t\t\t$options = WordpressConnect::getDefaultOptions();\n\t\t\t\n\t\t\t// apply the options from the current theme\n\t\t\t$options = apply_filters( 'wp_connect_options', $options );\n\t\t\tWordpressConnect::setOptions( $options );\n\t\t\t\n\t\t}\n\t}", "public function index()\n {\n \n if ($this->config['db_name'] == NO_DATABASE)\n {\n $this->redirect(\"setup.php\");\n }\n \n else if ($this->custLoggedIn())\n {\n $this->redirect(\"mainPageCust.php\");\n } elseif ($this->ownerLoggedIn())\n {\n $this->redirect(\"mainPageOwner.php\");\n } else\n {\n $this->redirect(\"login.php\");\n }\n\n }", "public function index()\n {\n //basically reset the steps\n $this->set_step(0);\n\n if($this->current_user)\n {\n $this->session->set_userdata('user_id', $this->current_user->id);\n $this->set_step(1);\n redirect( NC_ROUTE .'/checkout/billing');\n }\n //else\n redirect( NC_ROUTE . '/checkout/customer');\n }", "public function add_actions() {\n\t\tif ( is_admin() ) {\n\n\t\t\t// Add the menu screen for inserting license information\n\t\t\tadd_action( 'admin_init', \t\tarray( $this, 'register_license_settings' ) );\n\t\t\tadd_action( 'admin_init', \t\tarray( $this, 'activate_license' ) );\n\t\t\tadd_action( 'admin_init', \t\tarray( $this, 'deactivate_license' ) );\n\t\t\tadd_action( 'admin_notices', \tarray( $this, 'admin_notices' ) );\n\t\t\tadd_action( 'eael_licensing', [ $this, 'render_licenses_page' ] );\n\n\t\t}\n\t}", "function wooadmin_appearence2website_design() {\n\n global $menu;\n\n global $submenu;\n\n $menu[60][0] = 'Design'; // Change Users to Customers main id\n\n $submenu['users.php'][5][0] = 'All Customers';\n\n $submenu['users.php'][10][0] = 'Add a Customer';\n\n $submenu['users.php'][15][0] = 'Admin Profile';\n\n $submenu[ 'index.php' ][1] = array( __('New'), 'read', 'edit.php?post_type=shop_order' );\n\n}", "public function private_theme_functions()\n {\n // Adds plus button\n add_action('in_admin_header', [ & $this, 'addParallaxBlock'], -200);\n\n // Replace the common scripts\n add_action('wp_default_scripts', [$this, 'changeCommonScript'], 11);\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public static function activate() {\n\n }", "public function actionCustomer()\n {\n $tab = Yii::$app->request->get('tab') ? Yii::$app->request->get('tab') : '1';\n $title = '多客服管理';\n $keywords = 'wechat customer service 微信 客服';\n $description = '多客服管理';\n \n switch ($tab) \n {\n case 1:\n $page = 'customer';\n break;\n case 2:\n $page = 'customer1';\n break;\n case 3:\n $page = 'customer2';\n break;\n }\n return $this -> render($page,[\n 'tab' => $tab,\n 'title' => $title,\n 'keywords' => $keywords,\n 'description' => $description\n ]);\n }", "function charity_before() {\n do_action('charity_before');\n}", "function index()\n {\n\t\t//echo '<pre>';print_r($this->session->userdata);exit;\n //profiling\n $this->data['controller_profiling'][] = __function__;\n //login check\n $this->__commonAdmin_LoggedInCheck();\n //get the action from url\n $action = $this->uri->segment(3);\n\t\t//echo '<pre>';print_r();exit;\n //get data\n $this->__pulldownLists();\n\t\t\t\n //route the rrequest\n switch ($action) {\n\t\t\tcase 'register':\n $this->__addcustomer();\n\t\t\t\tbreak;\n\t\t\tcase 'updateprofile':\n\t\t\t\t//$this->data['template_file'] = PATHS_ADMIN_THEME . 'profile.html';\n $this->__updateprofile();\n\t\t\t\tbreak;\n\t\t\tcase 'profile':\n\t\t\t\tif(intval($this->session->userdata['customer']['company']) > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->data['template_file'] = PATHS_ADMIN_THEME . 'companyprofile.html';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->data['template_file'] = PATHS_ADMIN_THEME . 'profile.html';\n\t\t\t\t}\n\t\t\t\t\n $this->__profile();\n\t\t\t\t$this->__getOrders();\n break;\n\t\t\tcase 'companyprofile':\n\t\t\t\t$this->data['template_file'] = PATHS_ADMIN_THEME . 'companyprofile.html';\n $this->__profile();\n\t\t\t\t$this->__getOrders();\n break;\n\t\t\tcase 'logout':\n\t\t\t\t$this->flmLogOut();\n break;\n\t\t\tcase 'addsaldo':\n\t\t\t $this->__addsaldo();\n\t\t\tbreak;\n\n\t\t\tcase 'validateGiftcard':\n\t\t\t $this->__validateGiftcard();\n\t\t\tbreak;\t\n\t\t\t\t\t\n\t\t\tcase 'account':\n\t\t\t\t $this->data['template_file'] = PATHS_ADMIN_THEME . 'customer.account.log.html';\n\t\t\t\t $this->__getCustomerDetail();\n\t\t\t\t $this->__getAccountLog();\n break;\n\t\t\tcase 'ajaxaccount':\n\t\t\t\t$this->__getajaxAccountLog();\n break;\t\n case 'search-account-log':\n $this->__cachedCustomerAccountLog();\n break;\n\t\t\tcase 'company':\n\t\t\n\t\t\t\t$this->data['template_file'] = PATHS_ADMIN_THEME . 'companycustomer.html';\n\t\t\t\t $this->__getCustomersList();\n $this->__company();\n break;\n\t\t\tcase 'mobileDetails':\n\t\t\t\t$this->__mobileDetails();\n break;\n\t\t\tcase 'saldoprint':\n\t\t\t\t$this->data['template_file'] = PATHS_ADMIN_THEME . 'print.saldo.html';\n\t\t\t\t$this->__saldoprint();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\n\t\t\tif(isset($_POST['company_type']) && isset($_POST['cart_type']) && isset($_POST['cmobile']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$newdata = array('company_status'=> 1);\n\t\t\t\t$this->session->set_userdata($newdata);\n\t\t\t\t\n\t\t\t\t$this->data['template_file'] = PATHS_ADMIN_THEME . 'companycustomer.html';\n\t\t\t\t$this->__getCustomersList();\n $this->__company();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t $this->data['template_file'] = PATHS_ADMIN_THEME . 'customer.html';\n\t\t\t\t $this->__mobileVerification();\n\t\t\t\t $this->__getCustomersList();\n\t\t\t}\n\t\t\t break;\n }\n //load view\n $this->__flmView('admin/main');\n }", "public function relatorio4(){\n $this->isAdmin();\n }", "function run_wcfm_order_splitter() {\n\t// This file holds all the custom reusable functions.\n\trequire_once 'includes/wcfmos-functions.php';\n\n\t// The core plugin class that is used to define internationalization and admin-specific hooks.\n\trequire_once 'includes/class-wcfmos-order-splitter-admin.php';\n\tnew WCFMOS_Order_Splitter_Admin();\n\n\t// The core plugin class that is used to define internationalization and public-specific hooks.\n\trequire_once 'includes/class-wcfmos-order-splitter-public.php';\n\tnew WCFMOS_Order_Splitter_Public();\n}", "public function activate()\n\t{\n\t\techo \"fight...\\n\";\n\t}", "public function activate()\n {\n Cleeng_Core::load('Cleeng_WpClient');\n Cleeng_Client::checkCompatibility();\n $this->migrate_database();\n //$cleengAdmin = Cleeng_Core::load('Cleeng_Admin');\n //$cleengAdmin->message(\"Cleeng for WordPress installed.\");\n }", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "public function AdminStarter($fetch){\n\t\t\n\t\t//Setup the class page\n\t\t$ac = new AdminController($fetch);\n\t}", "public static function activate()\n {\n }", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function main()\n\t{\t\t$this->viewProperties['show_exclude_low_population'] = true;\n\t\t$this->handleLowPopulation();\n\t\tparent::main();\n\t}", "public function mainPageCust()\n {\n // Restricted access\n if ( ! $this->custLoggedIn() )\n $this->redirect(\"login.php?error=login_required\");\n\n // here the login form view class is loaded and method printHtml() is called \n require_once('views/CustMainPageView.class.php');\n \n $site = new SiteContainer($this->db);\n $page = new CustMainPageView();\n\n // Load the Customer model, because this is a customer page & AppType which is needed to retrieve correct calendar\n require_once('models/Customer.class.php');\n require_once('models/AppType.class.php'); \n \n // Give the model the email address in the session and the database object\n try{\n $this->user = new Customer($_SESSION['email'], $this->db);\n } catch (Exception $e)\n {\n $this->redirect(\"login.php?error=login_required\");\n echo \"err_user_not_found\";\n }\n\n $query = \"SELECT fName, lName, empID\n FROM Employees;\";\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $res = $stmt->get_result();\n $empArray = $res->fetch_all(MYSQLI_ASSOC);\n // Fetch each employees associated types \n $empTypes = array();\n foreach ($empArray as $e)\n {\n $tarr = array();\n $etypes = AppType::get_types_for_employee($e['empID'], $this->db);\n foreach ($etypes as $t)\n $tarr[$t->get_id()] = $t->get_appType();\n $empTypes[$e['empID']] = $tarr;\n }\n \n $types = AppType::get_all_types($this->db);\n $site->printHeader();\n $site->printNav($this->user->type);\n $page->printHtml($this->user, $types, $empArray);\n $page->printCalendar($empArray, $empTypes);\n $site->printSpecialFooter(array('calendar.js','calendarByType.js'));\n\n }", "function run()\n\t{\n\t\trequire_code('templates_donext');\n\t\trequire_code('menus');\n\n\t\trequire_all_lang();\n\n\t\t$type=get_param('type','misc');\n\n\t\tif (((!has_specific_permission(get_member(),'avoid_simplified_adminzone_look')) || ($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member()))) && (num_staff_icons()<MIN_STAFF_ICONS_BEFORE_COLLAPSE))\n\t\t{\n\t\t\tif ($type=='misc') return do_next_manager_admin_simplified();\n\t\t}\n\n\t\t// Warning about whether the Setup Wizard still needs running\n\t\tif ((get_param_integer('cancel_sw_warn',0)==1) || (!addon_installed('setupwizard')))\n\t\t{\n\t\t\tset_value('setup_wizard_completed','1');\n\t\t} else\n\t\t{\n\t\t\t$_done_sw_once=get_value('setup_wizard_completed');\n\t\t\t$done_sw_once=!is_null($_done_sw_once);\n\t\t\tif ((!$done_sw_once) && (get_param('page','')!='admin_setupwizard') && (has_actual_page_access(get_member(),'admin_setupwizard')))\n\t\t\t{\n\t\t\t\t$setup_wizard_url=build_url(array('page'=>'admin_setupwizard'),get_module_zone('admin_setupwizard'));\n\t\t\t\t$cancel_sw_url=get_self_url(false,false,array('cancel_sw_warn'=>1));\n\t\t\t\tattach_message(do_lang_tempcode('SETUP_WIZARD_NOT_RUN',escape_html($setup_wizard_url->evaluate()),escape_html($cancel_sw_url->evaluate())),'notice');\n\t\t\t}\n\t\t}\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 'misc':\n\t\t\t\treturn do_next_manager_hooked('ADMIN_ZONE','DOC_ADMIN_ZONE','');\n\t\t\tcase 'structure':\n\t\t\t\treturn do_next_manager_hooked('STRUCTURE','DOC_STRUCTURE','structure');\n\t\t\tcase 'usage':\n\t\t\t\treturn do_next_manager_hooked('USAGE','DOC_USAGE','usage');\n\t\t\tcase 'style':\n\t\t\t\treturn do_next_manager_hooked('STYLE','DOC_STYLE','style');\n\t\t\tcase 'setup':\n\t\t\t\treturn do_next_manager_hooked('SETUP','DOC_SETUP','setup');\n\t\t\tcase 'tools':\n\t\t\t\treturn do_next_manager_hooked('TOOLS','DOC_TOOLS','tools');\n\t\t\tcase 'security':\n\t\t\t\treturn do_next_manager_hooked('SECURITY','DOC_SECURITY','security');\n\n\t\t\tcase 'search':\n\t\t\t\treturn $this->search();\n\t\t}\n\n\t\treturn new ocp_tempcode();\n\t}", "public function before()\n\t{\n\t\tparent::before();\n\t\t$this->_rest = Model_RestAPI::factory('RestCustomer', $this->_user);\n\t}", "public function preDispatch() {\r\n parent::preDispatch();\r\n if (!$this->getRequest()->isDispatched()) {\r\n return;\r\n }\r\n \r\n if (!$this->_getSession()->authenticate($this)) {\r\n Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'));\r\n } elseif ($this->_getSession()->getCustomerGroupid() == 0) {\r\n Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('reseller/index/login'));\r\n } else {\r\n Mage::getSingleton('core/session')->setResellersession(1);\r\n if ($this->_getSession()->getCustomerGroupId() == 1 || $this->_getSession()->getCustomerGroupId() == 2) {\r\n Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(''));\r\n }\r\n }\r\n }", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public function bookAsCustomerView($cust = '')\n {\n if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return false;\n }\n \n require_once('views/CustMainPageView.class.php');\n require_once('models/BusinessOwner.class.php');\n require_once('models/Customer.class.php');\n \n $site = new SiteContainer($this->db);\n $page = new CustMainPageView();\n\n // Load the Customer model, because this is a customer page\n require_once('models/Customer.class.php');\n // Give the model the email address in the session and the database object\n\n $query = \"SELECT fName, lName, empID\n FROM Employees;\";\n $stmt = $this->db->prepare($query);\n $stmt->execute();\n $res = $stmt->get_result();\n $empArray = $res->fetch_all(MYSQLI_ASSOC);\n\n $site->printHeader();\n $site->printNav($_SESSION['type']); //print the owner navbar\n \n \n require_once('models/AppType.class.php');\n $types = AppType::get_all_types($this->db);\n \n // Get types associated with each employee\n $empTypes = array();\n foreach ($empArray as $e)\n {\n $tarr = array();\n $etypes = AppType::get_types_for_employee($e['empID'], $this->db);\n foreach ($etypes as $t)\n $tarr[$t->get_id()] = $t->get_appType();\n $empTypes[$e['empID']] = $tarr;\n }\n \n // Handle errors for searchbox\n $serr = isset($_GET['errors']) ? $_GET['errors'] : '';\n // Disabled for now AY\n //$this->searchCustomerBox($serr);\n //if (! empty($cust))\n //{\n // $page->printHtml($cust, $types, $empArray); //pass in details for the customer\n $page->printHtml(null, $types, $empArray);\n $page->printCalendar($empArray, $empTypes);\n //}\n // $site->printFooter();\n $site->printSpecialFooter(array('calendarByType.js','calendarOwnerBookForCust.js'));\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "function main() {\n\n session_start();\n\n // Process the request data.\n\n if ($_SERVER['REQUEST_METHOD'] === 'GET') {\n\n get();\n\n } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n post();\n }\n\n // If logged in, then move to the employees page.\n\n if ($_SESSION['username']) {\n\n // Redirect to the index page.\n\n header('Location: /index.php');\n }\n\n // Fall through to the login-vew HTML.\n}", "abstract protected function bootstrap();", "public function main() {\n $this->content['html'] = '';\n\n if(empty($this->customer['id'])) {\n $this->response['error'][] = $this->locale['ERR_4002'];\n $this->response['logout'] = 1;\n return false;\n }\n\n $items = $this->orderModel->get($this->customer['id'], $this->language['id']);\n\n $orders = '';\n if($items) {\n $orders = $this->htmlOrders($items);\n }\n\n $this->template->set( $this->tplPath . 'main.html');\n\n $tplVars = [\n 'STR_INVOICE' => $this->locale['STR_INVOICE'], \n 'STR_ORDER_DATE' => $this->locale['STR_ORDER_DATE'], \n 'STR_PRICE' => $this->locale['STR_PRICE'], \n 'STR_DETAILS' => $this->locale['STR_DETAILS'], \n 'STR_STATUS' => $this->locale['STR_STATUS'], \n 'STR_ACTIONS' => $this->locale['STR_ACTIONS'], \n 'STR_MY_ORDERS' => $this->locale['STR_MY_ORDERS'], \n 'TXT_MY_ORDERS' => $this->locale['TXT_MY_ORDERS'], \n 'STR_MY_PROFILE' => $this->locale['STR_MY_PROFILE'], \n 'LINK_PROFILE' => $this->links['profile'],\n 'LINK_ORDERS' => $this->links['orders'],\n 'ITEMS' => $orders, \n 'HIDDEN' => $orders == '' ? ' hidden' : ''\n ];\n\n $this->template->setVars( $tplVars );\n\n $this->content['html'] = $this->template->parse();\n $this->response['status'] = $this->statusSuccess;\n }", "function activate() {\n\t\t// do not generate any output here\n\t}", "public function kiwip_action_caller(){\n\t\t/* Grab options of Kiwip Framework Options */\n\t\t$this->options = get_option('Kiwip');\n\n\t\tif($this->options['delete_revisions'] == 1){\n\t\t\t$this->kiwip_action_delete_revisions();\n\t\t}\n\t}", "function uc_order_pane_customer($op, $order, &$form = NULL, &$form_state = NULL) {\n switch ($op) {\n case 'view':\n $build['uid'] = array('#markup' => t('Customer number: !user_link', array('!user_link' => $order->uid ? l($order->uid, 'user/' . $order->uid) : '0')));\n $build['primary_email'] = array('#markup' => '<br />' . t('Primary e-mail:') . '<br />' . check_plain($order->primary_email));\n\n return $build;\n\n case 'edit-form':\n $form['customer']['uid'] = array(\n '#type' => 'hidden',\n '#default_value' => $order->uid,\n );\n $form['customer']['uid_text'] = array(\n '#type' => 'textfield',\n '#title' => t('Customer number'),\n '#default_value' => $order->uid,\n '#maxlength' => 10,\n '#size' => 10,\n '#disabled' => TRUE,\n );\n $form['customer']['primary_email'] = array(\n '#type' => 'textfield',\n '#title' => t('E-mail address'),\n '#default_value' => $order->primary_email,\n '#maxlength' => 64,\n '#size' => 32,\n );\n return $form;\n\n case 'edit-theme':\n $output = '<div class=\"order-pane-icons\">';\n $output .= ' <img src=\"' . base_path() . drupal_get_path('module', 'uc_store')\n . '/images/order_view.gif\" alt=\"' . t('Search for an existing customer.') . '\" '\n . 'title=\"' . t('Search for an existing customer.') . '\" onclick=\"load_customer_search();\" />';\n $output .= ' <img src=\"' . base_path() . drupal_get_path('module', 'uc_store')\n . '/images/menu_customers_small.gif\" alt=\"' . t('Create a new customer.') . '\" '\n . 'title=\"' . t('Create a new customer.') . '\" onclick=\"load_new_customer_form();\" />';\n $output .= '</div>';\n $output .= '<div id=\"customer-select\"></div>';\n $output .= drupal_render($form['customer']);\n return $output;\n\n case 'edit-process':\n $changes['uid'] = $form_state['values']['uid'];\n $changes['primary_email'] = $form_state['values']['primary_email'];\n return $changes;\n }\n}", "function on_activate()\n\t{\n\t\t// Disable buggy sitewide activation in WPMU and WP 3.0\n\t\tif ((is_multisite() && isset($_GET['sitewide'])) || ($this->is_network_mode() && isset($_GET['networkwide'])))\n\t\t\t$this->network_activate_error();\n\t\t\n\t\t// Default options\n\t\tupdate_option('ld_http_auth', 'none');\n\t\tupdate_option('ld_hide_wp_admin', 'no');\n\t}", "public function run()\n {\n Bouncer::allow('administrator')->everything();\n Bouncer::allow('shop-manager')->to('view', Order::class);\n Bouncer::allow('shop-manager')->to('view', Product::class);\n\n }" ]
[ "0.6144274", "0.61234736", "0.6094907", "0.5800198", "0.57832026", "0.57189184", "0.5658437", "0.5619734", "0.56148845", "0.56081945", "0.5595142", "0.5592124", "0.55812657", "0.5580458", "0.55785584", "0.5569308", "0.5567161", "0.5566123", "0.5541312", "0.5541312", "0.552714", "0.55196476", "0.5504599", "0.55004704", "0.5486117", "0.54832757", "0.5481805", "0.54722995", "0.5471282", "0.54508406", "0.5448741", "0.5439922", "0.5436476", "0.54359365", "0.5435593", "0.54348457", "0.5421903", "0.5418669", "0.5416271", "0.5406498", "0.54016066", "0.5398899", "0.53894633", "0.5376273", "0.5365045", "0.5364996", "0.53608876", "0.5355803", "0.53541845", "0.53379476", "0.5334397", "0.533349", "0.5329692", "0.532346", "0.5319123", "0.5318751", "0.53186256", "0.53169215", "0.5316341", "0.53162396", "0.5306235", "0.53053176", "0.5301922", "0.52983433", "0.5286198", "0.52846044", "0.5281616", "0.5279243", "0.5275768", "0.52746874", "0.52746236", "0.526365", "0.5249878", "0.5245413", "0.52422595", "0.5237465", "0.52370787", "0.5233872", "0.5227721", "0.52267104", "0.52238977", "0.5220278", "0.5220278", "0.5217611", "0.5217223", "0.5215366", "0.52121174", "0.5208559", "0.52056074", "0.52056074", "0.5201471", "0.5200865", "0.5200865", "0.51990354", "0.5187388", "0.5186071", "0.5184891", "0.5182804", "0.5180729", "0.5179482", "0.5178612" ]
0.0
-1
Set the card entry specified in token as default
public function defaultAction() { $token = $this->getRequest()->getParam('token'); if (!$token || !($card = Mage::getModel('mp_gateway/card')->getCardByVaultId($token))) { $this->_getSession()->addError('Please select a card entry to set as default'); return $this->_redirectReferer(); } try { $card->setAsDefault(); $this->_getSession()->addSuccess('The card has been successfully set as default'); } catch (Exception $e) { $this->_getSession()->addError('Error in the request, please try again'); } return $this->_redirectReferer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDefaultCard(?string $defaultCard): self\n {\n $this->defaultCard = $defaultCard;\n\n return $this;\n }", "public function default_card(Request $request) {\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'card_id' => 'required|integer|exists:cards,id,user_id,'.$request->id,\n ),\n array(\n 'exists' => 'The :attribute doesn\\'t belong to user:'.$request->id\n )\n );\n\n if($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_messages' => $error_messages, 'error_code' => 101);\n\n } else {\n\n $user = User::find($request->id);\n \n $old_default = Card::where('user_id' , $request->id)->where('is_default', DEFAULT_TRUE)->update(array('is_default' => DEFAULT_FALSE));\n\n $card = Card::where('id' , $request->card_id)->update(array('is_default' => DEFAULT_TRUE));\n\n if($card) {\n\n if($user) {\n\n $user->card_id = $request->card_id;\n\n $user->save();\n }\n\n $response_array = Helper::null_safe(array('success' => true, 'data'=>['id'=>$request->id,'token'=>$user->token]));\n\n } else {\n\n $response_array = array('success' => false , 'error_messages' => tr('something_error'));\n\n }\n }\n return response()->json($response_array , 200);\n \n }", "protected function makeCardDefault($args) {\n\n if ($args['ent_cc_id'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n if ($this->User['stripe_id'] == '')\n return $this->_getStatusMessage(51, 51);\n\n $remCardArr = array('stripe_id' => $this->User['stripe_id'], 'card_id' => $args['ent_cc_id']);\n\n $cardsArr = array();\n\n $card = $this->stripe->apiStripe('updateCustomerDefCard', $remCardArr);\n\n if ($card->error)\n return array('errNum' => 16, 'errFlag' => 1, 'errMsg' => $card->error->message);\n\n foreach ($card->cards->data as $c) {\n $cardsArr[] = array('id' => $c->id, 'last4' => $c->last4, 'type' => $c->brand, 'exp_month' => $c->exp_month, 'exp_year' => $c->exp_year);\n }\n\n $errMsgArr = $this->_getStatusMessage(52, 52);\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'cards' => $cardsArr, 'def' => $card->default_card);\n }", "public function setDefaultAccount($key);", "public function setCard(?bool $card): void\n {\n $this->card = $card;\n }", "public function setToken(string $token): void;", "public function set($token);", "public function giveCard(Card $card)\n\t{\n\t\t$card->setGiven(true);\n\t\t$this->save($card, false);\n\t}", "function setToken($token)\n {\n $this->token = $token;\n }", "public function __construct($card)\n {\n $this->card = $card;\n }", "public function setToken($token){\n $this->token = $token;\n }", "public function setToken($token);", "public function setDefault($memberId, $cardId) {\n $this->where(['member_id'=>$memberId, 'card_id'=>['neq', $cardId]])->data(['is_default'=>0])->save();\n return $this->where(['member_id'=>$memberId, 'card_id'=>$cardId])->data(['is_default'=>1, 'update_time'=>time()])->save();\n }", "public function set_card(INT $_card){\n $this->_card = $_card;\n\n return $this;\n }", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "public function getDefaultCard(): ?string\n {\n return $this->defaultCard;\n }", "public function setCard(?string $card): self\n {\n $this->card = $card;\n\n return $this;\n }", "public function setToken($token): void\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function setDefault()\r\n {\r\n if (($this->dx_auth->is_logged_in()) || ($this->facebook_lib->logged_in()))\r\n {\r\n $user_id = $this->dx_auth->get_user_id();\r\n\r\n if ($this->input->post())\r\n {\r\n //unset the previous default email\r\n $condition = array(\"user_id\" => $user_id);\r\n $unset_default_email['is_default'] = 0;\r\n $this->Common_model->updateTableData('payout_preferences', NULL, $condition, $unset_default_email);\r\n\r\n //set new default email\t \r\n $default_email = $this->input->post('default_email');\r\n $data['is_default'] = 1;\r\n $condition = array(\"id\" => $default_email);\r\n $this->Common_model->updateTableData('payout_preferences', NULL, $condition, $data);\r\n\r\n $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success', translate('Your default payout updated successfully.')));\r\n }\r\n\r\n redirect('account/payout');\r\n }\r\n else\r\n {\r\n redirect('users/signin');\r\n }\r\n }", "public function setToken(string $token): void\n {\n $this->token = $token;\n }", "public function setCard($index,Card $val) :void\n {\n if($index>=0 && $index<=47)\n $this->cards[$index]=$val;\n }", "public function setCard($parameters = NULL) {\n\n if ($parameters === NULL) {\n $this->card = $parameters;\n return;\n }\n\n if (is_array($parameters)) {\n $this->card = (empty($parameters) ? NULL : new CreditCard($parameters));\n }\n }", "public static function setToken($token)\n {\n self::$_data[self::KEY_TOKEN] = $token;\n }", "public function setCardNonce(?string $cardNonce): void\n {\n $this->cardNonce['value'] = $cardNonce;\n }", "public function initCard()\n {\n $baseCard = $this->getBaseCard();\n /*\n * fix return;\n */\n if(!$baseCard)\n return false;\n $this->current_hp = $this->hp;\n $this->current_name = $baseCard->name;\n $this->current_defense = $this->defense;\n $this->current_dmg_min = $this->dmg_min;\n $this->current_dmg_max = $this->dmg_max;\n $this->current_dmg_critical = $this->dmg_critical;\n $this->current_critical_chance = $this->critical_chance;\n $this->update();\n }", "public function buyerSetDefaultCard(Request $request, $id){\n \\App::call('App\\Http\\Controllers\\PaymentController@setDefaultCard', [$id]);\n $cards = \\App::call('App\\Http\\Controllers\\PaymentController@getCards');\n return view($request->view? $request->view: 'buyer.payment-card', compact('cards'));\n }", "public function getDefaultCardNumber() : ?string;", "protected function setConfigToken($token)\n {\n $siteConfig = SiteConfig::current_site_config();\n $siteConfig->VimeoFeed_Token = $token;\n $siteConfig->write();\n }", "public function setIdCard($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->id_card !== $v) {\n $this->id_card = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_ID_CARD] = true;\n }\n\n return $this;\n }", "protected function setDefaultValueExtra()\n {\n $this->default_data['address'] = 'xxx.atlassian.net';\n $this->default_data['rest_api_resource'] = '/rest/api/latest/';\n $this->default_data['timeout'] = 60;\n\n $this->default_data['clones']['mappingTicket'] = array(\n array(\n 'Arg' => self::ARG_SUMMARY,\n 'Value' => 'Issue {include file=\"file:$centreon_open_tickets_path/providers/' .\n 'Abstract/templates/display_title.ihtml\"}'\n ),\n array('Arg' => self::ARG_DESCRIPTION, 'Value' => '{$body}'),\n array('Arg' => self::ARG_PROJECT, 'Value' => '{$select.jira_project.id}'),\n array('Arg' => self::ARG_ASSIGNEE, 'Value' => '{$select.jira_assignee.id}'),\n array('Arg' => self::ARG_PRIORITY, 'Value' => '{$select.jira_priority.id}'),\n array('Arg' => self::ARG_ISSUETYPE, 'Value' => '{$select.jira_issuetype.id}'),\n );\n }", "private function setupDefaults() {\n $defaults = array(\n // Indicates to the system the set of fields that will be included in the response: 3.0 is the default version. 3.1 \n // allows the merchant to utilize the Card Code feature, and is the current standard version.\n 'x_version'=>'3.1', \n \n // In order to receive a delimited response from the payment gateway, this field must be submitted with a value\n // of TRUE or the merchant has to configure a delimited response through the Merchant Interface. \n 'x_delim_data'=>'TRUE',\n \n // The character that is used to separate fields in the transaction response. The payment gateway will use the\n // character passed in this field or the value stored in the Merchant Interface if no value is passed. If this field is passed,\n // and the value is null, it will override the value stored in the Merchant Interface and there is no delimiting character in the transaction response.\n // A single symbol Ex. , (comma) | (pipe) \" (double quotes) ' (single quote) : (colon) ; (semicolon) / (forward slash) \\ (back slash) - (dash) * (star)\n 'x_delim_char'=>$this->responseDelimeter,\n \n // SIM applications use relay response. Set this to false if you are using AIM.\n 'x_relay_response'=>'FALSE',\n \n // IP address of the customer initiating the transaction. If this value is not passed, it will default to 255.255.255.255.\n 'x_customer_ip'=>$_SERVER['REMOTE_ADDR'],\n );\n $this->NVP = array_merge($this->NVP, $defaults); \n }", "public function setDefaultProvider($provider) {\n $this->providers[self::PROVIDER_NAME_DEFAULT] = $provider;\n }", "public function setCardInfo($dat,$key = false){\n if($key){\n $this->_cardinfo[$key] = $dat;\n }else{\n $this->_cardinfo = $dat;\n }\n }", "public function setCard(Model\\CardSetting $card): self\n {\n $this->card = $card;\n\n return $this;\n }", "public function getDefaultCardIndex()\n {\n return $this->reel->aliases['_default'];\n }", "public function setNameOnCard($var)\n {\n GPBUtil::checkString($var, True);\n $this->name_on_card = $var;\n\n return $this;\n }", "public function fromContext($key, $default);", "public function editcardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n \n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n \n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->renderLayout();\n }", "public function setDefault($value);", "function flashcards_reset_course_form_defaults($course) {\n return array('reset_flashcard'=>0);\n}", "public function testSetDefault()\n {\n $paymentMethodId = '270283ff-dea9-4f5a-aec7-5fa89eb2508f';\n $customerId = '20e68ad7-ff54-4cb6-8556-f87f58bcf995';\n $this->resource->setDefault($paymentMethodId, $customerId);\n\n $this->assertAttributeEquals(BASE_URL, 'base_url', $this->connector, 'Failed. Base url not correct');\n $this->assertAttributeEquals('PUT', 'method', $this->connector, 'Failed. Method is not correct');\n $this->assertAttributeEquals('paymentmethods/' . $paymentMethodId . '/default?customerId=' . $customerId, 'url', $this->connector, 'Failed. Url is not correct');\n }", "private function set_token_used()\n {\n update_post_meta($this->token_post['ID'], \"zbyva_hlasu\", 0);\n update_post_meta($this->token_post['ID'], \"hlasovani_zacatek\", $this->voting_start);\n update_post_meta($this->token_post['ID'], \"hlasovani_konec\", $this->voting_end);\n }", "public function __construct($cardNo)\n {\n $this->cardNo = $cardNo;\n }", "function resetToken() {\n $this->setToken(make_string(40));\n }", "protected function setDefaultTemplate(): void\n {\n $this->setDefaultData(function(Generator $faker) {\n return [\n 'password' => 'xx',\n 'username' => $faker->email,\n 'modified' => time(),\n // set the model's default values\n // For example:\n // 'name' => $faker->lastName\n ];\n });\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "public function add(Card $card): void\n {\n $this->set($card->getKey(), $card);\n }", "public function edit(Card $card)\n {\n //\n }", "public function edit(Card $card)\n {\n //\n }", "public function edit(Card $card)\n {\n //\n }", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "public function __construct() //card is our node value\n\t{\n\t\t$this->head = null; // starts here...\n\t}", "public function setToken($token, $token_secret = null) {\n\n\t\tparent::setToken($token, $token_secret);\n\t}", "private function _set_default()\r\n\t{\r\n\t\tif($this->input->post('default'))\r\n\t\t{\r\n\t\t\t$this->db->update('showcases',array('default' => 0));\r\n\t\t\t$this->db->where('id', $this->input->post('default'));\r\n\t\t\t$this->db->update('showcases',array('default' => 1));\r\n\t\t\t\r\n\t\t\t$this->set_message('success', 'Vetrina predefinita aggiornata con successo!');\r\n\t\t\tredirect($this->list);\r\n\t\t}\r\n\t}", "public function askForCard()\n {\n }", "public function set_default_data() {\n\t\t$this->button_text_color = '#FFFFFF';\n\t\t$this->button_background_color = '#6699CC';\n\n\t\t$this->header_text_color = '#FFFFFF';\n\t\t$this->header_background_color = '#6699CC';\n\n\t\t$this->button_text = 'Do Not Sell My Data';\n\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\n\t\t$this->ot_logo = '';\n\t\t$this->display_position = 'right';\n\t\t$this->floating_button\t= '';\n\t\t$this->isLinkEnabled \t= 'textlink';\n\t}", "public function setCache($token){\n \n $this->cacheStack->push($token);\n }", "function setTokenFromCookie($token) {\n\t\t\t$this->tokenFromCookie = $token;\n\t\t}", "public function setDefaultValueAccount($account)\n {\n if(!isset($account['account_username']))\n {\n $account['account_username'] = '[email protected]';\n }\n if(!isset($account['account_password']))\n {\n $account['account_password'] = '';\n }\n if(!isset($account['user_id']))\n {\n $account['user_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n }\n if(!isset($account['payment_type']))\n {\n $account['payment_type'] =2;\n }\n if(!isset($account['is_save_password']))\n {\n $account['is_save_password'] =0;\n }\n if(!isset($account['total_amount']))\n {\n $account['total_amount'] = 0;\n }\n if(!isset($account['last_check_out']))\n {\n $account['total_amount'] = '';\n }\n return $account;\n }", "public function setDefaults($param)\n {\n $this->defaultIcons = $param['icons'] ?? [];\n unset($param['icons']);\n $this->currentDefaults = $this->prepareParameters($param, true);\n $this->useTimestamps($param, true);\n }", "public function setAToken($token)\n {\n $this->atoken = $token;\n }", "public function setToken($token, $token_secret) {}", "protected function set_default( $tag_key, $key_id ) {\n\t\t$this->default = $this->calculate_default( $tag_key, $key_id );\n\t}", "public function getDefaultCard($memberId, $scope='default', $forceGetDefault=false) {\n $where = [\n 'member_id' => $memberId,\n 'is_default' => 1,\n 'status' => 0,\n ];\n $card = $this->where($where)->scope($scope)->order('update_time desc, create_time desc')->find();\n /** if forceGetDefault, no matter find or not, return it */\n if($forceGetDefault) {\n return $card;\n }\n /** if not forceGetDefault && no default card found, then find a new added valid card, set as default card && return it */\n if(empty($card)) {\n unset($where['is_default']);\n $card = $this->where($where)->scope($scope)->order('update_time desc, create_time desc')->find();\n $this->setDefault($memberId, $card['card_id']);\n }\n return $card;\n }", "public function setRememberToken($token)\n {\n $this->user[$this->getRememberTokenName()] = $token;\n }", "private function setCurrency()\n {\n $currency = $this->em->getRepository('ClubUserBundle:LocationConfig')->getObjectByKey('default_currency',$this->order->getLocation());\n\n $this->order->setCurrency($currency);\n $this->order->setCurrencyValue(1);\n }", "public function setDeck($cards=''){\n\t\tif (is_array($cards)){\n\t\t\t$this->deck=$cards;\n\t\t}\n\t}", "public function addCard(string $card): void\n {\n if (false === $this->hasCard($card)) {\n $this->setGroup($card, []);\n }\n }", "function setDefault($key, $defvalue) {\n\t\t$this->defaultmap[$key] = $defvalue;\n\t}", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "public function set_default_value($value) {\n\t\t$this->default_value = $value;\n\t\tif ($this->ISOPEN)\n\t\t\t$this->DEFAULTS = array_fill(0, count($this->HEADERS), $this->default_value);\n\t}", "public function __construct(string $token = null) {\n\t\t$this->token = $token ? $token : bin2hex(random_bytes(16));\n\t}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function createToken($cardinfo){\n \\Stripe\\Stripe::setApiKey($this->getApi('secret_key'));\n $token = \\Stripe\\Token::create(array(\n \"card\" => array(\n \"number\" => $cardinfo['number'],\n \"exp_month\" => $cardinfo['exp_month'],\n \"exp_year\" => $cardinfo['exp_year'],\n \"cvc\" => $cardinfo['cvc']\n )\n ));\n $this->_token = $token; \n $this->_card = $token->card;\n return $token->card->id;\n }", "function setDefaults()\n {\n }", "public function backupCurrentToken()\n {\n $stateStorage = $this->getClient()->getStateStorage();\n\n $token = $stateStorage->get($this->getStateStorageKeyName('token'));\n $stateStorage->set($this->getStateStorageKeyName('real_token'), $token);\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}", "public function setDefaultValue ($name, $value) {\n // xxx finish\n }", "public function add_card( $member, $customer, $token ) {\n\t\t$card = false;\n\n\t\ttry {\n\t\t\t// Stripe API since 2015-02-18\n\t\t\tif ( ! empty( $customer->sources ) ) {\n\t\t\t\t$card = $customer->sources->create( array( 'card' => $token ) );\n\t\t\t\t$customer->default_source = $card->id;\n\t\t\t}\n\n\t\t\tif ( $card ) {\n\t\t\t\t$customer->save();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * This action is used by the Taxamo Add-on to check additional country\n\t\t\t * evidence (CC country).\n\t\t\t *\n\t\t\t * @since 1.0.0\n\t\t\t */\n\t\t\tdo_action( 'ms_gateway_stripe_credit_card_saved', $card, $member, $this );\n\n\t\t\t// 2. Save card to WordPress user meta.\n\n\t\t\tif ( $card ) {\n\t\t\t\t$member->set_gateway_profile(\n\t\t\t\t\tself::ID,\n\t\t\t\t\t'card_exp',\n\t\t\t\t\tgmdate( 'Y-m-d', strtotime( \"{$card->exp_year}-{$card->exp_month}-01\" ) )\n\t\t\t\t);\n\t\t\t\t$member->set_gateway_profile( self::ID, 'card_num', $card->last4 );\n\t\t\t\t$member->save();\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\t// Failed.\n\t\t}\n\t}", "function setToken($_token) {\n $this->token = $_token;\n return $this;\n }", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "public function updateDefaultsFromObject() {\n parent::updateDefaultsFromObject();\n // Tags\n if(isset($this->widgetSchema['tags'])) {\n $tags = $this->getObject()->getTags();\n if($this->getUser()->getAttribute('enable_keyboard', false)) {\n $tags = implode(', ', $tags);\n }\n $this->widgetSchema['tags']->setDefault($tags);\n }\n // Elements\n if(isset($this->widgetSchema['elements_list'])) {\n $this->widgetSchema['elements_list']->setDefault($this->getObject()->getElements());\n }\n if($this->getUser()->getAttribute('enable_keyboard', false) && isset($this->widgetSchema['demandeur_id']) && !$this->isNew())\n {\n $this->setDefault('demandeur_id', $this->getObject()->getDemandeur()->getName());\n }\n }", "function flashcard_reset_course_form_defaults($course) {\n return array('reset_flashcard_all' => 1);\n}", "function _setDefaults() {}", "protected function setMemberDefaults(){\n parent::setMemberDefaults();\n if(!$this->id) $this->id = UniqId::get(\"faq-\");\n }", "public function reset()\n {\n $this->values[self::NAME] = null;\n $this->values[self::VCARD] = null;\n }", "public function setValueDefault()\n {\n $this->isActive = true;\n $this->createdAt = new \\DateTime();\n }", "public function setPreviousToken() {\n\t\t$this->_token = $this->_previousToken;\n\t\t$this->_session->key = $this->_previousToken;\n\t}", "function setCardnumber($cardnumber) {\n\t\tif (strlen($cardnumber)>=13 and strlen($cardnumber)<=16 and is_numeric($cardnumber)) {\n\t\t\t$this->cardnumber = $cardnumber;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Credit Card Number\";\n\t\t}\n\t}", "function setCardnumber($cardnumber) {\n\t\tif (strlen($cardnumber)>=13 and strlen($cardnumber)<=16 and is_numeric($cardnumber)) {\n\t\t\t$this->cardnumber = $cardnumber;\n\t\t} else {\n\t\t\t$this->error[] = \"Invalid Credit Card Number\";\n\t\t}\n\t}", "public function setDefaultValue($value);", "public function setResumeToken(Token $token)\n {\n \t$this->update(['resume_token' => $token->id]);\n }", "public function get_card(){ return $this->_card;}", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "public function makeDefault() {\n $this->update([\n 'color' => null,\n 'size' => null\n ]);\n }", "public function __construct($token, array $initialData = []);", "public function getDefaultAccount();", "protected function cardPoolSwitch()\n {\n $request = $this->request();\n\n $this->result()\n ->changeRequest('card_pool', (isset($request['card_pool']) && $request['card_pool'] == 'yes') ? 'no' : 'yes')\n ->setCurrent('Decks_edit');\n }" ]
[ "0.6607148", "0.5953983", "0.58115923", "0.565794", "0.56404537", "0.5556458", "0.5509617", "0.54612297", "0.5452767", "0.54354423", "0.54179394", "0.5411092", "0.5402526", "0.53953683", "0.5335088", "0.5331888", "0.5327442", "0.5281987", "0.5245831", "0.5245831", "0.5226078", "0.52176464", "0.52140826", "0.5189117", "0.51777035", "0.5169642", "0.51463294", "0.5143217", "0.5112984", "0.50964093", "0.50934094", "0.507267", "0.5059096", "0.5036268", "0.5026004", "0.5022569", "0.49905905", "0.4962175", "0.4955551", "0.49539307", "0.49471372", "0.4938664", "0.49384373", "0.49347505", "0.49040812", "0.49006295", "0.49003786", "0.4872294", "0.48530838", "0.48463047", "0.48463047", "0.48463047", "0.48458868", "0.48390642", "0.48290843", "0.48270482", "0.4821749", "0.48198205", "0.48162258", "0.4815448", "0.4795948", "0.47946677", "0.478161", "0.47650015", "0.47644854", "0.4759373", "0.47579014", "0.47555754", "0.4752423", "0.47468048", "0.474604", "0.474407", "0.47399667", "0.47369567", "0.47334534", "0.47320288", "0.47207153", "0.4704869", "0.47021", "0.46960786", "0.46917066", "0.46916988", "0.46824518", "0.4678591", "0.46723878", "0.46655405", "0.46640727", "0.4661095", "0.46543723", "0.465192", "0.4651871", "0.4651871", "0.46503615", "0.46458647", "0.46435612", "0.46330673", "0.4611013", "0.46108547", "0.46079448", "0.46078345" ]
0.7625479
0
Remove the card entry specified in token
public function removeAction() { $token = $this->getRequest()->getParam('token'); if (!$token) { $this->_getSession()->addError('Please select a card entry to remove'); return $this->_redirectReferer(); } try { Mage::getModel('mp_gateway/vault')->deleteDetails($token); $this->_getSession()->addSuccess('The card has been successfully deleted'); } catch (Exception $e) { $this->_getSession()->addError('Error in deletion, please try again'); } return $this->_redirectReferer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeAction()\n {\n /** @var Mage_Customer_Model_Session $session */\n $session = Mage::getSingleton('customer/session');\n\n if ($session->isLoggedIn()) {\n $customer = Mage::getModel('customer/customer')->load($session->getCustomerId());\n $customer\n ->setData('mpgs_card_token', '')\n ->save();\n\n $this->_prepareDataJSON(array());\n } else {\n $this->getResponse()\n ->setHeader('HTTP/1.1', '502 Error Deleting Token')\n ->sendResponse();\n }\n }", "public function deletecardAction()\n {\n $isValidToken = false;\n $token = $this->getRequest()->getParam('t');\n $customer = $this->_getCustomer();\n $api = $this->_getApi();\n $paymentMethods = $api->getPaymentMethods($customer->getId(), true);\n \n foreach($paymentMethods as $key => $pm) {\n if($pm->getData('paymentMethodToken') == $token) {\n $isValidToken = true;\n }\n }\n \n if($isValidToken) {\n $this->_delete($customer->getId(), $token);\n Mage::getSingleton('core/session')->addSuccess('Credit card has been deleted.');\n $this->_redirect('payments/customer/creditcards');\n } else {\n Mage::getSingleton('core/session')->addError('Credit card token is not valid. Please try again.');\n $this->_redirect('payments/customer/creditcards');\n }\n }", "public function deleteCard()\n {\n }", "public function deleteCard($card)\n {\n $customer = Customer::find($card->customer_id);\n\n $stripeCus = Stripe\\Customer::retrieve(Customer::where('id', $card->customer_id)->first()->token);\n\n $stripeCus->sources->retrieve($customer->cards->where('token', $card->token)->first()->token)->delete();\n }", "public function omise_delete_card()\n\t\t{\n\t\t\t$cardId = isset( $_POST['card_id'] ) ? wc_clean( $_POST['card_id'] ) : '';\n\n\t\t\tif ( empty( $cardId ) ) {\n\t\t\t\tOmise_Util::render_json_error( 'card_id is required' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t$nonce = 'omise_delete_card_' . $_POST['card_id'];\n\n\t\t\tif ( ! wp_verify_nonce( $_POST['omise_nonce'], $nonce ) ) {\n\t\t\t\tOmise_Util::render_json_error( 'Nonce verification failure' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t$cardDeleted = $this->customerCard->delete($cardId, $this->omise_customer_id);\n\n\t\t\techo json_encode([ 'deleted' => $cardDeleted ]);\n\t\t\tdie();\n\t\t}", "public function destroy(Card $card)\n {\n //\n }", "public function destroy(Card $card)\n {\n //\n }", "public function destroy(Card $card)\n {\n //\n }", "public function destroy(Card $card)\n {\n //\n }", "public function deleteConsumerRequestToken( $token ) {\n\t\t$tokens = get_option('oauth_consumer_tokens');\n\t\tif (array_key_exists($token, $tokens)) {\n\t\t\tunset($tokens[$token]);\n\t\t\tupdate_option('oauth_consumer_tokens', $tokens);\n\t\t}\n\t}", "public final function destroy($token)\n {\n }", "public function testRemoveTokenWithTokenRemove(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest,array(PayUParameters::TOKEN_ID => $responseCreditCardToken->creditCardToken->creditCardTokenId));\n\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\n\t}", "protected function removeCard($args) {\n\n if ($args['ent_cc_id'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n if ($this->User['stripe_id'] == '')\n return $this->_getStatusMessage(51, 51);\n\n $remCardArr = array('stripe_id' => $this->User['stripe_id'], 'card_id' => $args['ent_cc_id']);\n\n $cardsArr = array();\n\n $card = $this->stripe->apiStripe('deleteCard', $remCardArr);\n\n if ($card->error)\n return array('errNum' => 16, 'errFlag' => 1, 'errMsg' => $card->error->message);\n\n foreach ($card->data as $card) {\n $cardsArr = array('id' => $card->data->id, 'last4' => $card->data->last4, 'type' => $card->data->brand, 'exp_month' => $card->data->exp_month, 'exp_year' => $card->data->exp_year);\n }\n\n $errMsgArr = $this->_getStatusMessage(52, 52);\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'cards' => $cardsArr);\n }", "public function destroy($token)\n {\n $tokenKey = Token::whereRaw('token = ? ', [$token])->get()->first();\n\n if (is_null($tokenKey)) { \n return response()->json(['errors'=>array(['code'=>404,'message'=>'Incorrect token.'])],404); \n }else{\n $tokenKey->delete();\n return response()->json(['status'=>'ok'],200);\n }\n }", "public function removeAction() {\n $params = $this->getRequest()->getParams();\n $customer_id = Mage::getSingleton('customer/session')->getCustomer()->getId();\n\n //Perform security checks to ensure the customer is allowed to remove this credit card\n if (!(isset($params['cc_id']))) {\n $this->_getSession()->addError($this->__('The requested URL does not appear to be valid.'));\n return $this->_redirect('*/*/index');\n }\n\n $cc = Mage::getModel('savedcc/savedcreditcards')->load($params['cc_id']);\n if ($cc->getCustomer_id() != $customer_id) {\n $this->_getSession()->addError($this->__('The requested URL does not appear to be valid.'));\n return $this->_redirect('*/*/index');\n }\n\n $str = 'The credit card ending in '.$cc->getLast4().' was successfully removed.';\n $cc->delete();\n\n $this->_getSession()->addSuccess($this->__($str));\n\n return $this->_redirect('*/*/index');\n }", "function token_destroy(string $token)\r\n{\r\n\tglobal $DATABASE;\r\n\t\r\n\t$DATABASE->execute_query('DELETE FROM `logged_in` WHERE token = ?', 's', $token);\r\n}", "private function removeToken(string $token): void\n {\n $this->setTokens(array_filter(\n $this->getTokens(),\n function ($t) use ($token) {\n return $token !== $t;\n }\n ));\n }", "public function destroy(Postcard $postcard)\n {\n //\n }", "public function delete_row($token)\n {\n return $this->where('token', $token)->delete();\n }", "public function testRemoveTokenWithPayerIdEmpty(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\n\t\t$parametersBasicTokenRequest[PayUParameters::PAYER_ID]= \"\";\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest,array(PayUParameters::TOKEN_ID => $responseCreditCardToken->creditCardToken->creditCardTokenId));\n\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\n\t}", "public function delete($token)\n\t{\n\t\t$this->deleteKey($token, $this->tables['tokens']);\n\n\t\t$this->deleteSet(null, $this->tables['tokens'], $token);\n\n\t\t$this->deleteKey($token, $this->tables['token_scopes']);\n\t}", "public static function deleteByToken($token)\n {\n static::findByToken($token)->delete();\n }", "public function unsetCardNonce(): void\n {\n $this->cardNonce = [];\n }", "public function removeCard($card) : void\n {\n if ($this->isEmpty()) {\n throw new \\Exception('Empty deck nothing to remove');\n }\n\n $cards = array_filter($this->cards, function (Card $c) use ($card) {\n return !$c->isEqual($card);\n });\n\n $this->cards = array_values($cards);\n }", "public function unsetCustomerCardId(): void\n {\n $this->customerCardId = [];\n }", "public function testRemoveTokenWithDifferentPayerId(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\t\n\t\t$parametersBasicTokenRequest[PayUParameters::PAYER_ID]= \"Payer_id_555\";\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest,array(PayUParameters::TOKEN_ID => $responseCreditCardToken->creditCardToken->creditCardTokenId));\n\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\n\t}", "function clear_token($token)\n{\n global $DB_connect;\n\n $statement = $DB_connect->prepare(\"UPDATE db.user set token = NULL WHERE token = :token\");\n $statement->execute(['token' => $token]);\n}", "function forgetToken($token);", "private function removeToken(string $token): void\n {\n $_SESSION[$this->sessionKey] = array_filter(\n $_SESSION[$this->sessionKey] ?? [],\n function ($t) use ($token) {\n return $token !== $t;\n }\n );\n \n }", "public function destroy_token($token) {\n $result = $this->call_json( $this->appliance_url.\"/api/destroy_token.php\", array(\"token\"=>$token));\n if($result->status != \"ok\") {\n throw new Exception(\"Failed to delete token $token from \".$this->appliance_url.\": \".$result->error);\n } \n }", "public function destroy($request)\n {\n $tokenKey = Token::whereRaw('token = ? ', [$request->token])->get()->first();\n if (!$tokenKey) { \n return response()->json(['status'=>'error','errors'=>array(['code'=>404,'message'=>'Bad Token'])],404);\n }else{\n $tokenKey->delete();\n //OK\n return response()->json(['status'=>'ok'],200);\n }\n }", "function EliminaCarrito($CardCode){\n\t\tif($this->con->conectar()==true){\n\t\treturn mysql_query(\"DELETE FROM `Carrito` WHERE `CardCode` = '\" .$CardCode. \"'\");\n\t\t}\n\t}", "public function cleanOldCards() {\r\n\t\t$cards = Mage::getModel('authnetcim/card')->getCollection()\r\n\t\t\t\t\t\t->addFieldToFilter( 'added', array( 'lt' => (time() - (120*86400)) ) );\r\n\t\t\r\n\t\tforeach( $cards as $card ) {\r\n\t\t\tif( $this->deletePaymentProfile( $card->getPaymentId(), $card->getProfileId() ) ) {\r\n\t\t\t\t$card->delete();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function deleteMembershipEntry($token, $id)\n {\n $this->deleteQuery($this->getFullUrl('/group_memberships/' . $id), $token);\n }", "function deleteChangeRequest($token) {\n return $this->databaseDeleteRecord(\n $this->tableChangeRequests, 'surferchangerequest_token', $token\n );\n }", "public function card_delete(){\n\n }", "public function deleteRememberToken($identifier, $token);", "public function delete_apartment($token){\r\n\r\n $apartment_id = $this->fetch_single($token);\r\n\r\n $delete_sql = \"DELETE FROM `apartments` WHERE `id`='$apartment_id'\";\r\n $this->query($delete_sql);\r\n\r\n $delete_sql_i = \"DELETE FROM `update_delete_requests` WHERE `apartment_id`='$apartment_id'\";\r\n if($this->query($delete_sql_i)){\r\n $return_value = \"Apartment deleted successfully\";\r\n }else{\r\n $return_value = \"Error: please contact admin!\";\r\n }\r\n return $return_value;\r\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "abstract public function removeAuthToken();", "public function uninstall()\r\n {\r\n $this->db->query('DROP TABLE IF EXISTS `' . DB_PREFIX . 'accept_cards_tokens`;');\r\n }", "function token_delete( $p_token_id ) {\r\n\t\t$c_token_id = db_prepare_int( $p_token_id );\r\n\r\n\t\t$t_tokens_table\t= config_get( 'mantis_tokens_table' );\r\n\t\t# Remove\r\n\t\t$query = \"DELETE FROM $t_tokens_table\r\n\t\t \tWHERE id='$c_token_id'\";\r\n\t\tdb_query( $query, 1 );\r\n\t\treturn true;\r\n\t}", "public function remove() {}", "public function remove() {}", "protected function _removeCurrentToken()\n {\n $session = new Session();\n $session->remove('token');\n }", "function rm($key) {\n }", "public function remove_material()\n {\n if (Authenticate::is_player()) {\n if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {\n $this->model_material = Material::getInstance();\n\n $material = $_POST[\"material_id\"];\n $result = $this->model_material->remove_material($material);\n\n $binding = array(\n \"result_var\" => \"session_ready\",\n \"status_var\" => $result\n );\n\n binding_data($binding);\n } else {\n transport(\"error404\");\n }\n } else {\n $binding = array(\"result_var\" => \"no_session\");\n binding_data($binding);\n }\n }", "public function removeSessionTokenFromRegistry() {}", "function EliminaEncabezadoPedido($CardCode){\n\t\tif($this->con->conectar()==true){\n\t\treturn mysql_query(\"DELETE FROM `arquitect_bourne`.`ENC_PedidosSolicitados` WHERE `CardCode` = '\" .$CardCode. \"'\");\n\t\t}\n\t}", "public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}", "public function destroy(Cards $card)\n {\n $card->delete();\n session()->flash('mensagem', 'Atividade excluída com sucesso!');\n return redirect()->route('cards.index');\n }", "public function removeAccessToken();", "public function destroy(Pacijent $pacijent,Card $card)\n {\n \n }", "function remove()\n {\n $gameId = $this->registry->params[0];\n\n if (isset($gameId, $_SESSION['cart'])) {\n Util::deleteElement($gameId, $_SESSION['cart']);\n }\n\n $count = 0;\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n $count++;\n if ($_SESSION['cart'][$index][0] == $gameId) {\n unset($_SESSION['cart'][$index]);\n }\n }\n if($count == 0){\n unset($_SESSION['cart']);\n }\n\n header(\"Location: /cart\");\n }", "public function postDeleteCard(DeleteCardRequest $request)\n {\n try {\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n if (count($customer->sources['data']) > 1) {\n if ($customer->sources->retrieve($request->cardId)->delete()) {\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.card_deleted');\n } else {\n $this->response['success'] = false;\n $this->response['message'] = trans('messages.no_card');\n }\n } else {\n $this->response['success'] = false;\n $this->response['message'] = trans('messages.cannot_delete_card');\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public static function removeByToken($token)\n {\n try {\n self::where('token', $token)->delete();\n\n return true;\n } catch (\\Exception $e) {\n return false;\n }\n }", "public function cancel(Token $token): Payment;", "public function decryptToken($token) {\n $temp = substr($token, 0, -16);\n \n # Pegar tamanho da string temporaria\n $tString = strlen($temp);\n unset($temp);\n\n # Pegar a data\n $this->data = $this->descriptografar(substr($token, $tString));\n unset($tString);\n \n # Pegar o id cripitografado\n $id = substr($token, 0, -48);\n # Pegar id\n $this->id = $this->descriptografar($id);\n # Pegar tamanho do id cripitografado\n $tId = strlen($id);\n unset($id);\n \n # Pegar Token\n $this->token = substr($token, $tId, -16);\n\n # Pegar Data\n unset($token);\n unset($tId);\n }", "function card_remove(int $user_id, int $unit_own_id): bool\r\n{\r\n\tglobal $DATABASE;\r\n\t\r\n\t$info = $DATABASE->execute_query(\"SELECT unit_table, deck_table, main_deck FROM `users` WHERE user_id = $user_id\")[0];\r\n\t$deck_list = [];\r\n\t\r\n\tforeach($DATABASE->execute_query(\"SELECT deck_num, deck_members FROM `{$info[1]}`\") as $a)\r\n\t{\r\n\t\t$b = explode(':', $a[1]);\r\n\t\t$deck_list[$a[0]] = $b;\r\n\t\t\r\n\t\tforeach($b as &$unit)\r\n\t\t{\r\n\t\t\tif($unit == $unit_own_id)\r\n\t\t\t{\r\n\t\t\t\tif($info[2] == $a[0])\r\n\t\t\t\t\t/* In main deck. Cannot remove */\r\n\t\t\t\t\treturn false;\r\n\t\t\t\telse\r\n\t\t\t\t\t/* Remove */\r\n\t\t\t\t\t$unit = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tforeach($deck_list as $k => $v)\r\n\t\tdeck_alter($user_id, $k, $v);\r\n\t\r\n\t/* Last: update database */\r\n\t$DATABASE->execute_query(\"DELETE FROM `{$info[0]}` WHERE unit_id = $unit_own_id\");\r\n\t\r\n\treturn true;\r\n}", "public static function clearToken($db, $username, $token){\n try{\n $db->beginTransaction();\n\n $sql = \"DELETE FROM user_auth \n WHERE Username = :username AND RS_Token = :token;\";\n\t \t$stmt = $db->prepare($sql);\n\t\t $stmt->bindParam(':username', $username, PDO::PARAM_STR);\n $stmt->bindParam(':token', $token, PDO::PARAM_STR);\n \t\t$stmt->execute();\n\n $sql = \"DELETE FROM user_auth \n WHERE Username = :username AND Expired < current_timestamp;\";\n\t \t$stmt = $db->prepare($sql);\n\t\t $stmt->bindParam(':username', $username, PDO::PARAM_STR);\n \t\t$stmt->execute();\n \n $db->commit();\n\n $data = [\n\t\t\t \t\t'status' => 'success',\n\t\t\t \t'code' => 'RS305',\n\t\t\t\t 'message' => CustomHandlers::getreSlimMessage('RS305')\n\t\t\t\t];\n } catch (PDOException $e){\n $data = [\n\t\t \t\t'status' => 'error',\n\t\t\t\t 'code' => $e->getCode(),\n\t\t\t\t 'message' => $e->getMessage()\n \t\t\t];\n $db->rollBack();\n }\n return $data;\n $db = null;\n }", "private function removeTokenKey(&$settings)\n {\n unset($settings['_token']);\n }", "function remove($key);", "function remove($key);", "public function remove($key) {}", "public function remove(string $entryIdentifier): bool;", "public function removeCard($args)\n {\n return $this->buildQuery('RemoveCard', $args);\n }", "public function delete(AuthCodeEntity $token)\n\t{\n\t\t$this->run('DELETE FROM oauth_auth_codes WHERE auth_code = ?', [$token->getId()]);\n\t}", "public function destroy(Task $card)\n {\n $card->delete();\n return redirect()->route('card.index')->with('message','item has been deleted successfully');\n }", "public final function destroy_others($token_to_keep)\n {\n }", "function remove ($key);", "public function delete_payment_method( $token ) {\n\n\t\t$this->set_resource( 'paymentMethod' );\n\t\t$this->set_callback( 'delete' );\n\n\t\t$this->request_data = $token;\n\t}", "public function del($key);", "public function removeClaimed()\n\t{\n\t\t$items = CreditModel::whereRaw('value = claimed')->get();\n\n\t\tif ($items->count() > 0)\n\t\t{\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\t$item->delete();\n\t\t\t}\n\t\t}\n\t}", "function InfDeleteCreditCard($inf_card_id) {\n\t$object_type = \"Product\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$res = Infusionsoft_ProductService::deactivateCreditCard($inf_card_id);\n\t\n\treturn $res;\n}", "public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}", "public function deleteCard(Card $card)\n {\n $this->stripeCardRepository->delete($card);\n\n return $this->cardRepository->delete($card);\n }", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "public function remove($key);", "function deleteTrelloCard($id) {\n\t\t\t$urlT = 'https://api.trello.com/1/cards/'.$id.'?key='.$this->trelloKey.'&token='.$this->trelloToken;\n\t\t\t$chT = curl_init();\n\t\t\tcurl_setopt($chT, CURLOPT_URL, $urlT);\n\t\t\tcurl_setopt($chT, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t\t\tcurl_setopt($chT, CURLOPT_HEADER, false);\n\t\t\tcurl_exec($chT);\n\t\t\tcurl_close($chT);\n }", "public function destroy(Request $request, Token $token)\n {\n\t\t//$this->authorize('delete', $token);\n\t\t$token->delete();\n\t\treturn response()->json(['status' => 'SUCCESS','message' => __('admin.action_ok',['item'=>__('tokens.Token'),'action'=> __('admin.Deleted')])]);\n\n }", "function removefromnew($card) {\n\tglobal $new_deck ;\n\tforeach ( $new_deck->main as $id => $new_card ) {\n\t\tif ( $card->id == $new_card->id ) {\n\t\t\tarray_splice($new_deck->main, $id, 1) ;\n\t\t\treturn false ;\n\t\t}\n\t}\n\tforeach ( $new_deck->side as $id => $new_card ) {\n\t\tif ( $card->id == $new_card->id ) {\n\t\t\tarray_splice($new_deck->side, $id, 1) ;\n\t\t\treturn false ;\n\t\t}\n\t}\n\treturn true ;\n}", "public function delete_card(Request $request) {\n \n $card_id = $request->card_id;\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'card_id' => 'required|integer|exists:cards,id,user_id,'.$request->id,\n ),\n array(\n 'exists' => 'The :attribute doesn\\'t belong to user:'.$request->id\n )\n );\n\n if ($validator->fails()) {\n \n $error_messages = implode(',', $validator->messages()->all());\n \n $response_array = array('success' => false , 'error_messages' => $error_messages , 'error_code' => 101);\n \n } else {\n\n $user = User::find($request->id);\n\n\n if ($user->card_id == $card_id) {\n\n $response_array = array('success' => false, 'error_messages'=> tr('card_default_error'));\n\n } else {\n\n Card::where('id',$card_id)->delete();\n\n if($user) {\n\n $cards = Card::where('user_id' , $request->id)->count();\n\n if ($cards > 1) {\n\n\n } else {\n\n if($check_card = Card::where('user_id' , $request->id)->first()) {\n\n $check_card->is_default = DEFAULT_TRUE;\n\n $user->card_id = $check_card->id;\n\n $check_card->save();\n\n } else { \n\n $user->payment_mode = COD;\n\n $user->card_id = DEFAULT_FALSE;\n }\n\n }\n\n $user->save();\n }\n\n $response_array = array('success' => true, \n 'message'=>tr('card_deleted'), \n 'data'=> ['id'=>$request->id,'token'=>$user->token, 'position'=>$request->position]);\n\n }\n \n }\n \n return response()->json($response_array , 200);\n \n }", "public function remove(string $key);", "public function remove($key){\n\n }", "public function removeResetToken()\n {\n $this->reset_token = null;\n }", "public function deleteServerToken ( $consumer_key, $token, $user_id, $no_user_check = false ) { \n\t\t$tokens = get_option('oauth_server_tokens');\n\t\tif (array_key_exists($token, $tokens)) {\n\t\t\tunset($tokens[$token]);\n\t\t\tupdate_option('oauth_server_tokens', $tokens);\n\t\t}\n\t}", "public function doRemove() {\r\n\t\t$host = xn(\"host\");\r\n\t\t\r\n\t\t$ret = $this->_mongo->selectDB(\"admin\")->command(array(\r\n\t\t\t\"removeshard\" => $host\r\n\t\t));\r\n\t\t\r\n\t\t$this->ret = $this->_highlight($ret, \"json\");\r\n\t\t\r\n\t\t$this->display();\r\n\t}", "public function destroy(Card $card)\n {\n $card->delete();\n\n session()->flash('flash', 'The card was deleted successfully!');\n\n if (request()->wantsJson()) {\n return response([], 204);\n }\n\n return redirect(route('admin.cards.index'));\n }", "protected function _removeKey($key) {}", "public function destroy(Entry $entry)\n {\n //\n }", "function removeuserfromteam(){\n $this->auth(COMP_ADM_LEVEL);\n $key_id = $this->uri->segment(3);\n $team_id = $this->uri->segment(4);\n $contest_id = $this->uri->segment(5);\n $this->m_key->removeUserByKeyId($key_id);\n $this->teamedit($team_id);\n }" ]
[ "0.7235823", "0.6776277", "0.6575148", "0.65642446", "0.6512117", "0.6345298", "0.6345298", "0.6345298", "0.6345298", "0.6301701", "0.62934774", "0.62905335", "0.62757635", "0.62338436", "0.6182004", "0.60913724", "0.60604966", "0.6019151", "0.6001497", "0.59845823", "0.5982961", "0.5960784", "0.5958239", "0.59429145", "0.59407526", "0.5915473", "0.59102434", "0.5908291", "0.58619326", "0.5842756", "0.5834048", "0.57737637", "0.5769272", "0.5761125", "0.57597", "0.5756891", "0.5701453", "0.569355", "0.56925356", "0.56925356", "0.56925356", "0.56925356", "0.56893027", "0.5686086", "0.56157255", "0.5615172", "0.5614061", "0.5604634", "0.5599752", "0.55666506", "0.5556954", "0.5549532", "0.55115485", "0.5511044", "0.5508845", "0.54962236", "0.547911", "0.54661506", "0.54606164", "0.54548603", "0.5453819", "0.5447771", "0.54434365", "0.5438967", "0.54377186", "0.54377186", "0.54343855", "0.5416409", "0.5413353", "0.5393272", "0.5392638", "0.53910613", "0.5366725", "0.53666574", "0.53645444", "0.5356717", "0.5356393", "0.53547335", "0.5350591", "0.53490025", "0.53490025", "0.53490025", "0.53490025", "0.53490025", "0.53490025", "0.53490025", "0.53490025", "0.53478384", "0.5345583", "0.53225476", "0.5317073", "0.53154635", "0.53039557", "0.52982885", "0.52968675", "0.52968067", "0.5295609", "0.52919865", "0.5285323", "0.52845305" ]
0.79966116
0
Make a function for convenience
function getPDFPages($document) { $cmd = "pdfinfo.exe"; // Windows // Parse entire output // Surround with double quotes if file name has spaces exec("$cmd \"$document\"", $output); // Iterate through lines $pagecount = 0; foreach($output as $op) { // Extract the number if(preg_match("/Pages:\s*(\d+)/i", $op, $matches) === 1) { $pagecount = intval($matches[1]); break; } } return $pagecount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function aFunc()\n {\n }", "public function helper()\n\t{\n\t\n\t}", "public function publicFunction();", "public function temporality();", "function metodo() {\n // Funcion normal\n }", "function uopz_function($class, $function, $handler, $modifiers = NULL)\n{\n}", "function uopz_function($function, $handler, $modifiers = NULL)\n{\n}", "public function method();", "public function method();", "public function method();", "public function method();", "function limpieza_uno($value=''){\n\treturn \"Hola\";\n}", "protected function func_default() {}", "public function example();", "public function f() {}", "function asd()\n{\n\n}", "function mi_valid_function($dato){\r\n\treturn true;\r\n}", "function mike($var);\n func($b,$c); \n mike(A::func(param));", "function name();", "public function xxxxx(){\n\n }", "public function aaa() {\n\t}", "public function __construct($fun) {\n $this->f = $fun;\n }", "function truc() {\n}", "public function f01()\n {\n }", "public function getFunction(): string;", "public static function dummy() {}", "function well()\n{\n return \"foxphp\";\n}", "public function test($arg);", "function alias();", "public function custom()\n\t{\n\t}", "private function fn(): callable {\n\t\treturn function (mixed $expression): string { return $expression; };\n\t}", "function functions() {\n \n }", "function newLike();", "function do_something($something) {\r\n // Place your new code here\r\n }", "public function extension();", "abstract function fromexp();", "public function transform(Closure $func): static;", "public function method() : string;", "function md_function($func, $arr, $type = null) {\n\tif(!is_array($arr)) {\n\t\t$check = 'is_' . $type;\n\t\tif(!$type || $check($arr)) return $func($arr);\n\t\treturn $arr;\n\t}\n\tforeach ($arr as $k=>$v) $arr[$k] = md_function($func, $v, $type);\n\treturn $arr;\n}", "function fooFunc()\n {\n }", "function service();", "public function f()\n {\n }", "abstract protected function create($funcName);", "public function changeFunc() {}", "function do_sth_function_name(){\r\n }", "public function f02()\n {\n }", "function testf1($aa)\n{\n return \"ee\";\n}", "public function aa()\n {\n }", "function foo($a) {\n return $a + 2;\n}", "function myExample()\n{\n return 'Good practice';\n}", "function create_function(string $args, string $code): string\n{\n error_clear_last();\n $safeResult = \\create_function($args, $code);\n if ($safeResult === false) {\n throw FunchandException::createFromPhpError();\n }\n return $safeResult;\n}", "function hello($name) {\n return 'Hello, ' . $name;\n}", "function hello($name) {\n return 'Hello, ' . $name;\n}", "public function __construct($fun=null) {\n $this->f = $fun;\n }", "function myFunction()\n {\n }", "function test15(Test $foo) {\n\n}", "public function test_add_filter_create_function() {\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, function() {\n return rand_str();\n } );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "function __($cadena) {\n return idioma::traducir($cadena);\n}", "function zend_reflection_function2($one, $two = 'two') {\n \n return 'blah';\n}", "public function make(): string;", "function test () {}", "public static function via();", "protected function func() { return $this->f; }", "function myFunction()\n{\n}", "function test10($foo) {\n\n}", "public function demo();", "public function demo();", "function PrimaryReturn($otype){\r\n}", "function test9($foo) {\n\n}", "function aggiungiAllegato($pratica,$documento){\n \n}", "public function someStuff()\n {\n \n }", "function acf()\n{\n}", "function hello($name) {\n \n return 'Hello, ' . $name;\n\n\n }", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "function specialop() {\n\n\n\t}", "public function makeCallableMethod()\n {\n return function(){\n // N/A;\n $x = mt_rand(1, 10);\n return $x;\n };\n }", "abstract protected function external();", "function s(...$args)\n {\n return Helpers::s(...$args);\n }", "public abstract function Ataca();", "function somar($a , $b){\n\n return $a + $b;\n\n}", "function sexy_button_to_function($name, $function, $options = array())\n{\n $html_options = _convert_options($options);\n $html_options['href'] = isset($html_options['href']) ? $html_options['href'] : '#';\n $html_options['onclick'] = \"$function; return false;\";\n return sexy_button_to( $name, null, $html_options);\n}", "public function extension() {}", "static function helloWorld ($num1){\nreturn true;\n}", "function test21($arg1, $arg2, $arg3) {\n}", "function myFunction($a, $lot, $of, $params)\n : array {\n return null;\n}", "function test13($user) {\n\n}", "function testFuncton($first, $second) {\n //echo \"hello\". $first . $second;\n return $first;\n}", "abstract protected function mini(): string;", "public function a2(){\n }", "function test33($a, $b) {\n\n}", "public function getF() {}", "public static function definition();", "function simpleFunction(){\n echo 'Hello!';\n}", "function user_func(): string\n{\n return 'hello';\n}", "public function someFunction($someObject)\n {\n }", "function hello(string $prenom): string {\n\n return \"hello \" . $prenom;\n}", "public function func_search() {}", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function opa(){\n echo \"opa<br>\";\n}", "function overload() { }", "function overload() { }" ]
[ "0.6478525", "0.64279985", "0.6325586", "0.61822975", "0.61716044", "0.6083403", "0.6080519", "0.6069152", "0.6069152", "0.6069152", "0.6069152", "0.6045724", "0.5967387", "0.591629", "0.5884364", "0.58772725", "0.5856494", "0.5845735", "0.5838262", "0.5797393", "0.57886857", "0.5760539", "0.5741187", "0.5736657", "0.5722001", "0.5693826", "0.5680707", "0.5675429", "0.5665048", "0.563743", "0.5624633", "0.56152415", "0.5611335", "0.56060886", "0.56026703", "0.5584855", "0.5583404", "0.55830824", "0.55774504", "0.5574154", "0.5560676", "0.5547275", "0.55453855", "0.55451393", "0.55427414", "0.5541874", "0.5536245", "0.55269706", "0.55207884", "0.5519891", "0.5519805", "0.5505241", "0.5505241", "0.54904896", "0.54740924", "0.54739374", "0.5460861", "0.54533744", "0.54527825", "0.5445771", "0.54445106", "0.5431161", "0.5421005", "0.5421002", "0.5419277", "0.5419202", "0.5419202", "0.5418076", "0.5400695", "0.5397789", "0.53962374", "0.53886163", "0.53881145", "0.5383484", "0.53804076", "0.537861", "0.53544766", "0.5344704", "0.5339385", "0.53279847", "0.5327632", "0.5324824", "0.5323971", "0.5317327", "0.53114706", "0.53100854", "0.530776", "0.52976674", "0.5293187", "0.5285919", "0.52745384", "0.5274352", "0.527387", "0.5271394", "0.52713484", "0.5268884", "0.52673745", "0.5263494", "0.52622133", "0.52610046", "0.52610046" ]
0.0
-1
Run the database seeds.
public function run() { \App\Models\Book::create([ 'code' => '0408951', 'name' => 'The History of Tom Jones, a Foundling', 'writer' => 'Henry Fielding', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408952', 'name' => 'Pride and Prejudice', 'writer' => 'Jane Austen', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408953', 'name' => 'The Red and the Black', 'writer' => 'Stendhal', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408954', 'name' => 'Le Père Goriot', 'writer' => 'Honoré de Balzac', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408955', 'name' => 'David Copperfield', 'writer' => 'Charles Dickens', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408956', 'name' => 'Madame Bovary', 'writer' => 'Gustave Flaubert', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408957', 'name' => 'Mock-Dick', 'writer' => 'Herman Melville', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408958', 'name' => 'Wuthering Heights', 'writer' => 'Emily Brontë', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '0408959', 'name' => 'The Brothers Karamazov', 'writer' => 'Dostoevsky', 'year' => '1954', ]); \App\Models\Book::create([ 'code' => '04089510', 'name' => 'War and Peace', 'writer' => 'Tolstoy', 'year' => '1954', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82678324", "0.8173564", "0.78118384", "0.7706353", "0.76816905", "0.7659159", "0.74858105", "0.7406485", "0.7298472", "0.7253435", "0.7196091", "0.7174443", "0.7016074", "0.6989523", "0.69837826", "0.69728553", "0.69640046", "0.69357765", "0.6897687", "0.689282", "0.68775725", "0.6868809", "0.68633306", "0.6839021", "0.6779905", "0.6705274", "0.6670987", "0.66623807", "0.6652613", "0.6643801", "0.6616729", "0.66143125", "0.65891534", "0.6449129", "0.64461046", "0.6429425", "0.6426337", "0.63015336", "0.6298573", "0.6294075", "0.62801653", "0.6259914", "0.62554234", "0.6167662", "0.61630553", "0.61601174", "0.6141946", "0.6137726", "0.6134302", "0.6133732", "0.61287725", "0.6110795", "0.60950965", "0.6089703", "0.60768735", "0.6066286", "0.60595477", "0.6055387", "0.60451794", "0.6028352", "0.60246956", "0.60228956", "0.6019088", "0.6012698", "0.6011448", "0.60113615", "0.60076576", "0.6004189", "0.5998927", "0.5997798", "0.5993557", "0.59863526", "0.59863526", "0.59863526", "0.59706056", "0.59546155", "0.59493065", "0.5940633", "0.59251904", "0.59143347", "0.5913916", "0.59121555", "0.59111917", "0.5909761", "0.59026676", "0.59009403", "0.5899209", "0.58973104", "0.58964044", "0.58933777", "0.5888429", "0.58760023", "0.5869122", "0.5863149", "0.58622074", "0.5849116", "0.5838678", "0.5831741", "0.5824525", "0.58167094", "0.58122987" ]
0.0
-1
Show the application dashboard.
public function index() { return view('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Comprueba que la franquicia completa funcione correctamente.
public function testFranquiciaCompleta() { $colectivo = new Colectivo(144,"RosarioBus",5); $tarjeta=new Tarjeta(2345); /** * Hay que hacerlo. */ $this->assertEquals(1,1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function complete();", "public function complete();", "public function complete();", "function completeCallback()\r\n { }", "abstract public function isComplete();", "public function completed() {\n\t}", "public function qualifyAsFinished(): bool;", "protected function complete($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "protected function complete()\n {\n parent::complete();\n }", "function executionDone() {\n\tif($err = @error_get_last()) {\n\t\tswitch($err['type']) {\n\t\t\tdefault:\n\t\t\t\tstopForError($err['message'], $err['type'], $err['file'], $err['line']);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif(class_exists('Locker')) {\n\t\tLocker::releaseAll();\n\t}\n}", "public function complete(){\n\n $flag = 0;\n \n $query = \"SET foreign_key_checks = 0\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n \n $query1 = \"DELETE FROM \" . $this->table_name . \"\n WHERE id_ordine=?\";\n $stmt1 = $this->conn->prepare($query1);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt1->bindParam(1, $this->id_ordine);\n $stmt1->execute();\n if($stmt1){\n $query2 = \"UPDATE articolo set id_ordine = NULL \n WHERE id_ordine=?\";\n\n $stmt2 = $this->conn->prepare($query2);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt2->bindParam(1, $this->id_ordine);\n $stmt2->execute();\n\n if($stmt2){\n\n $query3 = \"SET foreign_key_checks = 1\";\n $stmt3 = $this->conn->prepare($query3);\n $stmt3->execute();\n if($stmt3)\n return true;\n }\n }\n else\n return false;\n }", "public function clearFinished();", "public function incomplete()\n {\n $this->complete(false);\n }", "public function completeFlow();", "function guardarReclamo()\n\t\t{\n\t\t}", "public function done();", "public function isCompleted();", "public function can_be_completed(): bool {\n\t\t// TODO: Implement this.\n\t\treturn false;\n\t}", "public function hasComplete(){\n return $this->_has(2);\n }", "function needsExecution() ;", "public function checkIfCompletelyResolved(): void;", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "public function finish() {}", "function finish(){\r\n\t}", "public function succeeded();", "protected function finish() {}", "protected function done()\n {\n }", "private function onCompletion()\n {\n }", "public function complete() {\n\t\t$this->indexable_helper->finish_indexing();\n\t}", "public function isFinished();", "function recuperarFinalistas(){\n\t\t$votopro = new VotaProfesional();\n\t\t$res = $votopro->recuperarFinalistas();\n\t\treturn $res;\n\t}", "function existeLetra(/*>>> Completar parámetros <<<*/ ){\n \n /*>>> Completar cuerpo de la función <<<*/\n\n}", "public static function maybe_mark_complete() {\n\t\t// The install notice still exists so don't complete the profiler.\n\t\tif ( ! class_exists( 'WC_Admin_Notices' ) || \\WC_Admin_Notices::has_notice( 'install' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );\n\t\t// Don't make updates if the profiler is completed, but task list is potentially incomplete.\n\t\tif ( isset( $onboarding_data['completed'] ) && $onboarding_data['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data['completed'] = true;\n\t\tupdate_option( self::PROFILE_DATA_OPTION, $onboarding_data );\n\t\tupdate_option( 'woocommerce_task_list_hidden', 'yes' );\n\t}", "public function progressFinish() {}", "public function finished()\n {\n }", "public function finalize()\n {\n //Can be used for cleaning up stuff after action execution\n return true;\n }", "static function completion(array &$donnees)\r\n {\r\n // ici le code\r\n }", "static function completion(array &$donnees)\r\n {\r\n // ici le code\r\n }", "public function completable()\n {\n $this->status = self::STATUS_COMPLETABLE;\n $this->save();\n\n\t\t$this->fireModelEvent('completable');\n }", "abstract protected function isSuccessfullFinished($output);", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "public function completeTask(){\n $query = \"UPDATE \" . $this->table_name . \" \n SET \n stato = 3\n WHERE id_ordine = :id_ordine\";\n \n $stmt = $this->conn->prepare($query);\n\n $this->id_ordine=htmlspecialchars(strip_tags($this->id_ordine));\n\n $stmt->bindParam(\":id_ordine\", $this->id_ordine);\n\n if($stmt->execute()){\n return true;\n }\n \n return false;\n }", "function completeOrder($order)\n{\n\t//$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);\n\n\tif ($order->getState() != Mage_Sales_Model_Order::STATE_COMPLETE)\n\t{\n\t\tif(abs($order->getGrandTotal() - $order->getBaseTotalPaid()) < 0.00001) {\n\t\t\t$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);\n\t\t\t$order->setStatus(\"complete\");\n\n\t\t\t$order->addStatusHistoryComment('Pedido finalizado pela distribuidora.');\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$order->save();\n\t\t\t\tdebug('Pedido '.$order->getId().' finalizado.');\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tdebug('Pedido não finalizado: ' . $e->getMessage());\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo 'O pedido já foi finalizado'.\"\\n\";\n\t}\n}", "public function finaliza()\n {\n $this -> estadoAtual -> finaliza($this);\n }", "public function done(){\n\t\t$this->done=true;\n\t}", "function trans_complete()\r\n\t{\r\n\t\treturn $this->db->trans_complete();\r\n\t}", "public function isComplete() {\n return $this->getDescription() == 'Done';\n }", "public function isFinished(): bool;", "public function isFinalized()\n {\n return ($this->status == 'processing' || $this->status == 'valid');\n }", "function tquiz_user_complete($course, $user, $mod, $tquiz) {\n}", "public function proceed();", "public function done () {\n return null;\n }", "public function finish(): void\n {\n }", "function complete()\n\t{\n\t\tglobal $db;\n\n\t\t$sqls = array();\n\t\t$complete = @$_POST['complete'];\n\t\tif (!strlen($complete)) { $complete = NO; }\n\n\t\t// set the customer status'\n\t\twhile (list($customerID,$status) = each($this->customer_status))\n\t\t{\n\t\t\t$sqls[] = \"UPDATE preorder_customers SET prc_status=$status WHERE prc_preorderID=$this->preorderID AND prc_customerID=$customerID\";\n\t\t}\n\n\t\tif ($complete)\n\t\t{\n\t\t\t// change the status to complete\n\t\t\t$sqls[] = \"UPDATE preorders SET pre_status=\".PRE_COMPLETED.\" WHERE pre_preorderID=$this->preorderID\";\n\t\t}\n\n\t\twhile (list($a,$sql) = each($sqls))\n\t\t{\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t}\n\n\t\treturn ($complete?'Preorder completed':'Saved preorder information');\n\t}", "public function finish()\n\t{\n\t\t\n\t}", "public function completeAction() {\n\n }", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "function vitero_user_complete($course, $user, $mod, $vitero) {\n\n}", "public function incomplete()\n {\n $this->update(['completion_date' => null]);\n LogController::set(get_class($this).'@'.__FUNCTION__);\n // $this->recordActivity('incompleted_task');\n }", "function free_result($resultado) {\r\n\t\t// \"implementado en la clase <i>\" . get_class($this) . \"</i></h1>\";\r\n\t\treturn FALSE;\r\n\t}", "public function implementation_pending()\n {\n }", "function isSuccessful() ;", "public function routerRebuildFinished() {\n $this->rebuilding = FALSE;\n $this->rebuilt = TRUE;\n }", "function isExecuted() ;", "public function checkConvertionComplete()\r\n\t{\r\n\t\treturn (!file_exists($this->referenceFile) || @filesize($this->referenceFile) == 0);\r\n\t}", "protected function _completeFlush() {\r\n\r\n }", "function dllc_user_complete($course, $user, $mod, $dllc) {\n}", "public function implementation_pending(): void\n {\n }", "public function runSuccess();", "public function extProc_finish() {}", "public function completeBuild()\n {\n $frontend = $this->getCacheableFrontEnd();\n $id = $this->getIdentifier();\n if (!$this->_cached) {\n if (!$cached = $frontend->load($id)) {\n return false;\n }\n $this->_cached = $cached;\n }\n \n $this->_cached->set_completed(true);\n \n return $frontend->save(\n $this->_cached,\n $id,\n array(self::get_default_cache_tag())\n );\n }", "public function extProc_finish() {}", "function cicleinscription_user_complete($course, $user, $mod, $cicleinscription) {\n}", "function finished() {\n\t\treturn $this->tries && ( ( $this->ready() && ! $this->hasSteps() ) || ! $this->needed() );\n\t}", "function isIncomplete()\n {\n return empty($this->comps);\n }", "public function isFinal();", "public function isFinal();", "public function fileNeedsProcessing() {}", "public function finish() {\r\n\t}", "protected function completeJob() {\n\t\t$this->isComplete = 1;\n\t\t$nextgeneration = new CheckExternalLinksJob();\n\t\tsingleton('QueuedJobService')->queueJob($nextgeneration,\n\t\t\tdate('Y-m-d H:i:s', time() + self::$regenerate_time));\n\t}", "function restore_complete(){\r\n\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----dirname dirname-------- \".var_export(dirname(__FILE__),true).\"\\n\",FILE_APPEND);\r\n\tWPTC_Factory::get('config')->set_option('restore_completed_notice','yes'); \r\n\t//delete the bridge files on completion\r\n\tglobal $wp_filesystem;\r\n\t$wp_filesystem->delete(dirname(__FILE__), true);\r\n\t$this_temp_backup_folder = WP_CONTENT_DIR.'/tCapsule';\r\n\t$wp_filesystem->delete($this_temp_backup_folder, true);\r\n\tif ( !$wp_filesystem->is_dir($this_temp_backup_folder) ) {\r\n\t\tif ( !$wp_filesystem->mkdir($this_temp_backup_folder, FS_CHMOD_DIR) )\r\n\t\t\t{\r\n\t\t\t\t//return error message if any\r\n\t\t\t}\r\n\t}\r\n\techo json_encode('over');\r\n\texit;\r\n}", "public function finish(): int;", "public static function trySubmit() {\n\t}", "public function isComplete() \n\t{\n\t\treturn (($this->status == self::STATUS_COMPLETED_IMPORT) || \n\t\t ($this->status == self::STATUS_COMPLETED_UNDO_IMPORT));\n\t}", "public function finalizarTransaccion() {\n $this->ejecutar(\"COMMIT\");\n }", "protected function iterationComplete() { if(!$this->resultFreed) {\n try {\n $this->db->free_result($this->result);\n $this->resultFreed = true;\n } catch(Exception $ex) {}\n }\n }", "function etherpadlite_user_complete($course, $user, $mod, $etherpadlite) {\n return true;\n}", "public function isComplete() {\n return !variable_get('og_7200_ogur_roles', FALSE);\n }", "protected function complete() {\n\t\t\tparent::complete();\n\n\t\t\tastra_sites_error_log( esc_html__( 'All processes are complete', 'astra-sites' ) );\n\t\t\tupdate_site_option( 'astra-sites-batch-status-string', 'All processes are complete', 'no' );\n\t\t\tdelete_site_option( 'astra-sites-batch-status' );\n\t\t\tupdate_site_option( 'astra-sites-batch-is-complete', 'yes', 'no' );\n\n\t\t\tdo_action( 'astra_sites_site_import_batch_complete' );\n\t\t}", "public function onSubmitForm(callable $func): bool\n {\n if (!empty($this->context->getFormData())) {\n $this->runCallback($func);\n return true;\n }\n return false;\n }", "public function isFinalized($id){ \n $q = $this->slcOrdrFild(\"finalized\", $id);\n return $this->check($q, \"yes\");\n }" ]
[ "0.67257446", "0.6558684", "0.6558684", "0.6250089", "0.62099195", "0.5934974", "0.590402", "0.5867913", "0.5857607", "0.56540227", "0.5613888", "0.5596914", "0.55853313", "0.5563248", "0.5560541", "0.5495133", "0.54590577", "0.54439753", "0.54144484", "0.5372289", "0.5349181", "0.53474605", "0.5346598", "0.5346598", "0.5346598", "0.5346598", "0.5346598", "0.5346518", "0.53464913", "0.533512", "0.532932", "0.5326646", "0.53152466", "0.52559614", "0.5226816", "0.5199249", "0.51696473", "0.5168901", "0.5165594", "0.5161596", "0.5156768", "0.51283044", "0.51229525", "0.51229525", "0.51131946", "0.510294", "0.50895566", "0.50867784", "0.5076813", "0.5053103", "0.50505686", "0.5042377", "0.5037261", "0.50343776", "0.5032721", "0.502104", "0.5019847", "0.5019443", "0.5017199", "0.50095236", "0.5003961", "0.5002322", "0.5002236", "0.5002236", "0.5002236", "0.5001673", "0.5001673", "0.49974817", "0.49876258", "0.49783692", "0.49750465", "0.4973973", "0.49604267", "0.4951257", "0.49451804", "0.4942252", "0.49363446", "0.493408", "0.49263433", "0.49231857", "0.4922913", "0.4922389", "0.49193653", "0.49151346", "0.4905671", "0.49005866", "0.49005866", "0.4894659", "0.48855752", "0.4879437", "0.48681334", "0.48541868", "0.48540705", "0.48311597", "0.48296526", "0.48288035", "0.48237777", "0.4823538", "0.48210594", "0.48183832", "0.48177585" ]
0.0
-1
Set the host index
public function setHostIndex($hostIndex): void { $this->hostIndex = $hostIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex($host_index)\n {\n $this->hostIndex = $host_index;\n }", "public function setHostIndex(int $hostIndex): void\n {\n $this->hostIndex = $hostIndex;\n }", "public function setHostIndex($hostIndex)\n {\n $this->hostIndex = $hostIndex;\n }", "public function setHostIndex($hostIndex)\n {\n $this->hostIndex = $hostIndex;\n }", "public function setHostIndex($hostIndex)\n {\n $this->hostIndex = $hostIndex;\n }", "public function setHostIndex($hostIndex)\n {\n $this->hostIndex = $hostIndex;\n }", "public function setHostIndex($hostIndex)\n {\n $this->hostIndex = $hostIndex;\n }", "public function setHostIndex($hostIndex)\n {\n $this->hostIndex = $hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }", "public function getHostIndex()\n {\n return $this->hostIndex;\n }" ]
[ "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.8141259", "0.7646835", "0.7496599", "0.7496599", "0.7496599", "0.7496599", "0.7496599", "0.7496599", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251", "0.6768251" ]
0.7541463
53
Get the host index
public function getHostIndex() { return $this->hostIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHostIndex(): int\n {\n return $this->hostIndex;\n }", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "public function index(): int\n {\n return $this->index;\n }", "public function getGlobalHostInfo()\n {\n return $this->sendServerCommand(\"hostinfo\");\n }", "public function getHashIndex();", "public function numberOfHostEntries()\n {\n return (int)$this->prepareRequest()->GetHostNumberOfEntries();\n }", "public function getIndex() {\n \treturn $this->index;\n }", "public function getIdx()\n {\n return $this->get(self::_IDX);\n }", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\r\n\t\treturn $this->_index;\r\n\t}", "public static function getIndex(): int\n {\n return static::$index;\n }", "public function getDeployedIndex()\n {\n return $this->deployed_index;\n }", "public function getIndex() {\r\n\t\t\treturn $this->index;\r\n\t\t}", "public function getIndex(): int\n {\n return $this->indexRequest;\n }", "public function index()\n {\n return $this->index;\n }", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getIndex() {\n return $this->index;\n }", "public function getIndex() {\n return $this->index;\n }", "public function getIndex() {\n return $this->index;\n }", "public function getHost() {}", "public function getHost() {}", "public function getIndex()\n\t\t{\n\t\t\treturn $this->_index;\n\t\t}", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex() {}" ]
[ "0.86349565", "0.6608364", "0.63823986", "0.62896323", "0.6289402", "0.6251759", "0.6228367", "0.6191273", "0.61437666", "0.61437666", "0.61437666", "0.61437666", "0.61294436", "0.61153907", "0.61076367", "0.610235", "0.60911083", "0.6084486", "0.6083616", "0.6083616", "0.6083616", "0.6083616", "0.6083616", "0.6083616", "0.6081794", "0.6081794", "0.6081794", "0.6079407", "0.6079407", "0.6059974", "0.60509115", "0.60509115", "0.60509115", "0.60509115", "0.6048527" ]
0.87173223
52
Operation activate Activate Subscription
public function activate($id, $activate_subscription_request = null) { list($response) = $this->activateWithHttpInfo($id, $activate_subscription_request); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simplenews_subscription_activate($snids, $status) {\n foreach (simplenews_subscriber_load_multiple($snids) as $subscriber) {\n $subscriber->activated = $status;\n simplenews_subscriber_save($subscriber);\n }\n}", "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function activated_subscription( $order ) {\n\n\t\t// set properties\n\t\t$properties = apply_filters( 'wc_kissmetrics_activated_subscription_properties',\n\t\t\tarray(\n\t\t\t\t'subscription_name' => WC_Subscriptions_Order::get_item_name( $order ),\n\t\t\t\t'total_initial_payment' => WC_Subscriptions_Order::get_total_initial_payment( $order ),\n\t\t\t\t'initial_sign_up_fee' => WC_Subscriptions_Order::get_sign_up_fee( $order ),\n\t\t\t\t'subscription_period' => WC_Subscriptions_Order::get_subscription_period( $order ),\n\t\t\t\t'subscription_interval' => WC_Subscriptions_Order::get_subscription_interval( $order ),\n\t\t\t\t'subscription_length' => WC_Subscriptions_Order::get_subscription_length( $order ),\n\t\t\t\t'subscription_trial_period' => WC_Subscriptions_Order::get_subscription_trial_period( $order ),\n\t\t\t\t'subscription_trial_length' => WC_Subscriptions_Order::get_subscription_trial_length( $order )\n\t\t\t), $order, $this\n\t\t);\n\n\t\t// record event\n\t\t$this->api_record_event( $this->event_name['activated_subscription'],\n\t\t\tarray(\n\t\t\t\t$this->property_name['subscription_name'] => $properties['subscription_name'],\n\t\t\t\t$this->property_name['total_initial_payment'] => $properties['total_initial_payment'],\n\t\t\t\t$this->property_name['initial_sign_up_fee'] => $properties['initial_sign_up_fee'],\n\t\t\t\t$this->property_name['subscription_period'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_interval'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_length'] => $properties['subscription_interval'],\n\t\t\t\t$this->property_name['subscription_trial_period'] => $properties['subscription_trial_period'],\n\t\t\t\t$this->property_name['subscription_trial_length'] => $properties['subscription_trial_length'],\n\t\t\t),\n\t\t\t$this->get_identity( $order->user_id )\n\t\t);\n\n\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "public function activate() {\n\t\t/**\n\t\t * Fires when the plugin is being activated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_activate');\n\t}", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order);", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function activateAction()\r\n {\r\n\t\tUser::activate($this->route_params['token']);\r\n\t\t\r\n\t\t$this->user = Auth::getUser();\r\n\r\n $this->redirect('/signup/activated');\r\n }", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "public function activate() {\n\n\t\t// Get License\n\t\t$license = $this->get_license();\n\n\t\ttry {\n\n\t\t\t// Check License key\n\t\t\tif ( '' === $license->get_key() ) {\n\t\t\t\tthrow new Exception( 'Please enter your license key.' );\n\t\t\t}\n\n\t\t\t// Check license email\n\t\t\tif ( '' === $license->get_email() ) {\n\t\t\t\tthrow new Exception( 'Please enter the email address associated with your license.' );\n\t\t\t}\n\n\t\t\t// Do activate request\n\t\t\t$request = wp_remote_get( self::STORE_URL . self::ENDPOINT_ACTIVATION . '&' . http_build_query( array(\n\t\t\t\t\t'email' => $license->get_email(),\n\t\t\t\t\t'licence_key' => $license->get_key(),\n\t\t\t\t\t'api_product_id' => $this->product_id,\n\t\t\t\t\t'request' => 'activate',\n\t\t\t\t\t'instance' => site_url()\n\t\t\t\t), '', '&' ) );\n\n\t\t\t// Check request\n\t\t\tif ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t}\n\n\t\t\t// Get activation result\n\t\t\t$activate_results = json_decode( wp_remote_retrieve_body( $request ), true );\n\n\t\t\t// Check if response is correct\n\t\t\tif ( ! empty( $activate_results['activated'] ) ) {\n\n\t\t\t\t// Set local activation status to true\n\t\t\t\t$license->set_status( 'active' );\n\t\t\t\t$this->set_license( $license );\n\n\t\t\t\t// Return Message\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'message' => __( 'License successfully activated.', 'download-monitor' )\n\t\t\t\t);\n\n\t\t\t} elseif ( $activate_results === false ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t} elseif ( isset( $activate_results['error_code'] ) ) {\n\t\t\t\tthrow new Exception( $activate_results['error'] );\n\t\t\t}\n\n\n\t\t} catch ( Exception $e ) {\n\n\t\t\t// Set local activation status to false\n\t\t\t$license->set_status( 'inactivate' );\n\t\t\t$this->set_license( $license );\n\n\t\t\t// Return error message\n\t\t\treturn array( 'result' => 'failed', 'message' => $e->getMessage() );\n\t\t}\n\t}", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function activateUser($request)\r\n {\r\n /*\r\n * When registration has done you must activate your account to log in.\r\n * (Application will show you message \"You must confirm account\")\r\n */\r\n\r\n\r\n /*\r\n * In database we want to set field IsActivated to '1'\r\n */\r\n $params = [\r\n 'IsActivated' => '1'\r\n ];\r\n\r\n /*\r\n * Update row in user table where Activativon ==$request['activation']<---\r\n */\r\n $this->primary = 'Activation';\r\n $this->update($request['activation'], $params);\r\n\r\n }", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "public function activate()\n {\n $license = Licenses::find($this->key);\n $license->school_id = $this->auth_school_id;\n $license->activated_at = Carbon::now();\n $license->used=LICENCE_KEY_USED;\n if($license->save()){\n return $this->duration($license->duration);\n }\n return FALSE;\n }", "public function activateAsync($id, $activate_subscription_request = null)\n {\n return $this->activateAsyncWithHttpInfo($id, $activate_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function activate($key)\n {\n // activate account\n $result = $this->user_model->activate_account($key);\n \n switch($result)\n {\n case 0: // If activation key not matched with any account\n $msg = 'No account is related with this activation key, either your account is already activated or key is expired !!!'; \n $type = \"danger\";\n break;\n \n case 1: // Account activated\n $msg = 'Congratulations, your account is activated now. Login here';\n $type = \"success\"; \n break;\n \n case 2: // Activation key expired\n $msg = 'Activation key expired, create new account.';\n $type = \"warning\";\n break; \n \n default:\n break;\n \n }\n\n // set notification message to show on page\n $this->base->set_message($msg, $type); \n \n $this->index();\n\n return true;\n }", "public function activate() {\n add_option( 'wpb_js_composer_do_activation_redirect', true );\n }", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "public function activate($id, $activation_code)\n {\n $user = $this->account()->activate($id, $activation_code);\n \n return redirect($this->redirectTo);\n/*\n return redirect(route('login'))->with('confirmation-success', trans('confirmation::confirmation.success'));\n*/\n }", "public function activate() {\n\t\t\n\t}", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n $msg = __('auth.token_invalid');\n return ApiResponse::errorResponse('UNAUTHORIZED_ERROR', $msg, []);\n //return $this->errorResponse($msg,[]);\n //return response()->json([\n // 'message' => __('auth.token_invalid')\n //], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n $user->notify(new SignupActivated($user));\n $msg = __('auth.active_success');\n return ApiResponse::successResponse('SUCCESS', $msg, []);\n //return $this->successResponse($msg,$user);\n //return $user;\n }", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "public function actionActivate()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', [\n 'required' => true\n ]);\n $model = $this->findModel($username);\n $model->status = User::STATUS_ACTIVE;\n $model->removeEmailConfirmToken();\n $this->log($model->save());\n }", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "public function activate($id)\n {\n // Get the resource\n $object = $this->find($id);\n\n // Make sure we can activate\n if (! $object->isActivationAllowed()) {\n $this->throwException($this->error('activation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('activating', [$object]);\n\n // Activate the resource\n $object->active = 1;\n $object->activated_at = Carbon::now();\n\n // Validate the resource\n if ($object->isInvalid('activating') || ! $object->save()) {\n $this->throwException($object->getErrors(), $this->error('activate'));\n }\n\n // Fire after listeners\n $this->eventFire('activated', [$object]);\n\n return $object;\n }", "public function subscribe(SubscribeRequest $request)\n {\n $subscribe = $this->subscription->findByEmail($request->input('email'));\n\n if($subscribe)\n {\n if(!$subscribe->activated_at)\n {\n alert()->warning('Cet email existe déjà');\n\n return redirect('/')->withInput()->with('resend', true);\n }\n\n $subscriptions = $subscribe->subscriptions->pluck('id')->all();\n\n if(in_array($request->input('newsletter_id'),$subscriptions))\n {\n alert()->warning('Vous êtes déjà inscrit à la newsletter');\n\n return redirect($request->input('return_path', '/'));\n }\n }\n else\n {\n // Subscribe user with activation token to website list and sync newsletter abos\n $subscribe = $this->subscription->create(['email' => $request->input('email'), 'activation_token' => md5($request->email.\\Carbon\\Carbon::now()) ]);\n }\n\n $subscribe->subscriptions()->attach($request->input('newsletter_id'));\n\n \\Mail::send('newsletter::Email.confirmation', array('token' => $subscribe->activation_token, 'newsletter_id' => $request->input('newsletter_id')), function($message) use ($subscribe)\n {\n $message->to($subscribe->email, $subscribe->email)->subject('Inscription!');\n });\n\n alert()->success('<strong>Merci pour votre inscription!</strong><br/>Veuillez confirmer votre adresse email en cliquant le lien qui vous a été envoyé par email');\n\n return redirect($request->input('return_path', '/'));\n }", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function activateAccount()\n {\n // Récupération des variables nécessaires à l'activation\n $email = $_GET['email'];\n $activation_key = $_GET['key'];\n // On active le compte\n $activation = $this->Members->activateAccount($email, $activation_key);\n\n // Préparation de la page\n $page = new Page(array(\n 'title' => 'Inscription réussie',\n 'class_body' => 'signin'\n ));\n // Rendu du contenu\n $variables = compact('activation');\n $content = $this->render('members/signin/validation.php', $variables);\n // Rendu de la page\n echo $page->render($content);\n }", "public static function activate()\n {\n }", "public function activate(){\r\n\t\t$id = $this->uri->segment(3);\r\n\t\t$code = $this->uri->segment(4);\r\n\r\n\t\t//fetch requests details\r\n\t\t$request = $this->requests_model->getRequestById($id);\r\n \r\n\r\n\t\t//if code matches\r\n\t\tif($request['code'] == $code){\r\n\t\t\t//update user active status\r\n\t\t\t// $data['activate'] = true;\r\n\t\t\t$query = $this->accounts_model->updateActivate($id);\r\n\r\n\t\t\tif($query){\r\n\r\n\t\t\t\t$row = $this->accounts_model->getCheckUser($request['email']);\r\n\r\n\t\t\t\t$this->session->set_userdata('is_user', $row['type']);\r\n\t\t\t\t$this->session->set_userdata('myName', \t$row['firstname'].\" \".$row['lastname']);\r\n\t\t\t\t$this->session->set_userdata('myEmail', $row['email']);\r\n\t\t\t\t$this->session->set_userdata('myId', \t$row['id']);\r\n\t\t\t\t$this->session->set_userdata('myRole', \t$row['role']);\r\n\r\n\t\t\t\t$this->session->set_flashdata('msg', 'User activated successfully');\r\n\t\t\t\tredirect('main');\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\t$this->session->set_flashdata('error_msg', 'Something went wrong in activating account');\r\n\t\t\t\tredirect('login'); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\t\t\t\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Cannot activate account. Code didnt match');\r\n\t\t\tredirect('login'); \r\n\t\t}\r\n \r\n\t}", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "function activate() {\n }", "public static function activate() {\n\n }", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }", "public function testActivateBySuperAdmin(): void\n {\n // Login via super-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/3?token=' . $token);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data' =>\n [\n \"tenant_id\",\n \"outro_card\",\n \"active\",\n \"updated_at\",\n \"created_at\",\n \"id\",\n ],\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $success);\n $this->assertEquals(200, $code);\n $this->assertCount(6, $data);\n $this->assertEquals(3, $data['id']);\n $this->assertEquals(3, $data['tenant_id']);\n $this->assertEquals('outroCards/test3.mp4', $data['outro_card']);\n $this->assertEquals(false, $data['active']);\n $this->assertEquals('Status \"active\" was changed.', $message);\n }", "public function activate() {\n global $wp_roles;\n\n if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) {\n // @codingStandardsIgnoreLine\n $wp_roles = new \\WP_Roles();\n }\n\n $all_cap = array(\n 'dokan_view_booking_menu',\n 'dokan_add_booking_product',\n 'dokan_edit_booking_product',\n 'dokan_delete_booking_product',\n 'dokan_manage_booking_products',\n 'dokan_manage_booking_calendar',\n 'dokan_manage_bookings',\n 'dokan_manage_booking_resource',\n );\n\n foreach ( $all_cap as $key => $cap ) {\n $wp_roles->add_cap( 'seller', $cap );\n $wp_roles->add_cap( 'administrator', $cap );\n $wp_roles->add_cap( 'shop_manager', $cap );\n }\n\n // flush rewrite rules after plugin is activate\n $this->flush_rewrite_rules();\n }", "public function activate() {\n $installer = new WeDevs\\Notification\\Installer();\n $installer->run();\n }", "public function activate()\n {\n return view('licenses.activate');\n }", "public function activateWithHttpInfo($id, $activate_subscription_request = null)\n {\n $request = $this->activateRequest($id, $activate_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Payment' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Payment' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Payment', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Payment';\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 '\\OpenAPI\\Client\\Model\\Payment',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function wporphanageex_activate() {\n\tglobal $wpdb;\n\n\t// set default role if not exist\n\tif ( ! get_option( 'wporphanageex_role' ) && get_option( 'default_role' ) ) {\n\t\tupdate_option( 'wporphanageex_role', get_option( 'default_role' ) );\n\t} else {\n\t\tupdate_option( 'wporphanageex_role', 'subscriber' );\n\t}\n\n\t// set default prefix if not exist\n\t$prefixes = array();\n\t$prefixes[] = $wpdb->prefix;\n\tif ( ! get_option( 'wporphanageex_prefixes' ) ) {\n\t\tupdate_option( 'wporphanageex_prefixes', $prefixes );\n\t}\n\n}", "public function activate();", "public function activate();", "public function executeActivateAccount(sfWebRequest $request)\n {\n $tkn = trim($request->getParameter('tk', ''));\n $usr = AppUserTable::getInstance()->findOneByRecoverToken($tkn);\n\n if ($usr) {\n \tif (!$usr->getEnabled()) {\n\t \t$usr->setRecoverToken(NULL);\n\t \t$usr->setEnabled(1);\n\t \t$usr->save();\n\n\t \tServiceAuthentication::startSessionProcess($usr);\n\t\n\t \t$this->getUser()->setFlash('activate', true);\t\n \t}\n }\n $this->redirect('home/index');\n }", "public function activateAccount($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n list($response) = $this->activateAccountWithHttpInfo($id, $x_avalara_client, $body);\n return $response;\n }", "public function activateVersionPress()\n {\n $activateCommand = 'wp plugin activate versionpress';\n $this->exec($activateCommand);\n }", "public function actionActivate($email, $activationKey)\r\n {\r\n if($this->module->activeAfterRegister) // If accounts do not need to be activated.\r\n {\r\n throw new \\yii\\web\\NotFoundHttpException(); // Hide this action.\r\n }\r\n \r\n if(!Yii::$app->user->isGuest) // Only guest can activate accounts.\r\n {\r\n // Redirect instead of throwing a 403, because logged user end up on this page quite often.\r\n $this->redirect($this->module->returnLogoutUrl, 302); // Temporary redirect.\r\n }\r\n \r\n $model= User::find()->where(['email' => $email])->one();\r\n \r\n if($model && (int)$model->status === User::STATUS_ACTIVE) // If the account is already active.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is already active.'));\r\n }\r\n else if($model->activation_key && $model->activation_key == $activationKey) // The activation data checked out.\r\n {\r\n $model->scenario = 'activation';\r\n $model->status = User::STATUS_ACTIVE;\r\n $model->save();\r\n \r\n // Notify the user that activation was sucessful.\r\n return $this->render('message', [\r\n 'model' => $model,\r\n 'message' => Yii::t(__CLASS__, 'Your account is now active. Please log in to start using the service.'),\r\n 'type' => 'success'\r\n ]);\r\n }\r\n else if($model && (int)$model->status !== User::STATUS_ACTIVE && ($model->activation_key == $activationKey)) // The account has been disabled.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is not active.'));\r\n }\r\n \r\n // The activation url was wrong.\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'Incorrect activation URL.'));\r\n }", "public function activate($user_id, $email_key) {\n $activated = $this->authm->activate_user_account($user_id, $email_key);\n if($activated === TRUE) {\n $this->login($user_id, 2);\n redirect('/relationship');\n } else {\n if($activated === 1) {\n show_error($this->lang->line('auth_activate_error_1'));\n } else {\n show_error($this->lang->line('auth_activate_error_2'));\n }\n }\n }", "public function activate()\n {\n $this->fireModelEvent('activating');\n\n $this->active = true;\n $result = $this->save();\n\n $this->fireModelEvent('activated');\n\n return $result;\n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function reActivationAction() {\n //get the container object\n $container = $this->container;\n //get the translator object\n $translator = $this->get('translator');\n //get the session object\n $session = $this->getRequest()->getSession();\n //check if we have a logged in user or company\n if (FALSE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n $session->getFlashBag()->set('note', $translator->trans('You need to Login first.'));\n return $this->redirect($this->generateUrl('login'));\n }\n\n //check if the user is already active\n if (TRUE === $this->get('security.context')->isGranted('ROLE_USER')) {\n //set a notice flag\n $session->getFlashBag()->set('notice', $translator->trans('Your acount is active.'));\n return $this->redirect($this->generateUrl('user_edit'));\n }\n\n //get the logedin user\n $user = $this->getUser();\n\n //prepare the body of the email\n $body = $this->renderView('ObjectsUserBundle:User:Emails\\activate_email.txt.twig', array('user' => $user));\n //prepare the message object\n $message = \\Swift_Message::newInstance()\n ->setSubject($translator->trans('activate your account'))\n ->setFrom($container->getParameter('mailer_user'))\n ->setTo($user->getEmail())\n ->setBody($body)\n ;\n //send the activation mail to the user\n $this->get('mailer')->send($message);\n //set the success flag in the session\n $session->getFlashBag()->set('success', $this->get('translator')->trans('check your email for your activation link'));\n //redirect the user to portal\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public static function activate(){\n }", "public static function activate($activate_token)\n\t{\n\t\t$token = new static(compact('activate_token'));\n\n\t\t$token->raise(new MemberWasActivated($token));\n\n\t\treturn $token;\n\t}", "public function activate_account($token) {\n $con['returnType'] = 'single';\n $con['conditions'] = array(\n 'token' => $token\n );\n $result = $this->Common_Model->getRows($con, 'wh_user_activations');\n if ($result) {\n\n $this->Common_Model->delete($con['conditions'], 'wh_user_activations');\n $this->session->set_flashdata('success', array('message' => 'Activated successfully. Please login.'));\n redirect('Site_Login/login_form');\n } else {\n $redirect = 'Site_Login/login_form';\n $this->error($redirect);\n }\n }", "public function activate($id)\n {\n User::withTrashed()->find($id)->restore();\n $user = User::find($id);\n\n /* revoke user from oauth */\n $client = Client::where('user_id', $id);\n $client_update = array('revoked' => false);\n $client->update($client_update);\n \n Mail::to($user->email)\n ->send(new UserActivated($user));\n\n return response()->json(['success' => 'OK']);\n }", "function activate()\n {\n if (empty($this->userID)) $this->error('No user is loaded', __LINE__);\n if ( $this->is_active()) $this->error('Allready active account', __LINE__);\n $res = $this->db->query(\"UPDATE \".$this->usertable.\" SET \".$this->user_active.\" = 1 \n\tWHERE \".$this->user_id.\" = '\".$this->escape($this->userID).\"' LIMIT 1\");\n if (@count($res) == 1)\n\t{\n\t\t$this->userData[$this->user_active] = true;\n\t\treturn true;\n\t}\n\treturn false;\n }", "public function activateAccount($token) {\n $status = [\n 'approval_status' => 1,\n 'privilege' => 1\n ];\n\n $db = \\Config\\Database::connect();\n $builder = $db->table('users');\n\n return $builder->where('approval_token', $token)\n ->update($status);\n }", "public function activateAccount($token)\n {\n\n $user = Activation::where('code', $token)->get();\n\n if (count($user) == 0) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation = User::find($user[0]->user_id);\n\n if (empty($activation)) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation_update = Activation::findOrFail($user[0]->id);\n\n $activation_update->completed = 1;\n\n if ($activation_update->save()) {\n return Redirect::route('activate.app')->with(\n 'success',\n 'Cuenta activada correctamente'\n );\n //return response()->json(['status' => true, 'message' => \"Cuenta activada\", 'code' => 200]);\n } else {\n return redirect('register')->with(\n 'error',\n 'Error en activar cuenta'\n );\n //return response()->json(['status' => false, 'message' => \"Cuenta no activada\", 'code' => 200]);\n }\n }", "public function activateAccount($email){\n try{\n\n Mage::log(\"Trying to create new User Account with params: \" . print_r($email, 1));\n\n $response = $this->setUnauthorizedRequest()\n ->postMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT_ACTIVATE_ACCOUNT),\n Mage::helper('core')->jsonEncode(['email' => $email])\n )\n ->execute([parent::CREATED_HTTP_CODE, parent::SUCCESS_HTTP_CODE]);\n\n if($this->hasFailed()) {\n Mage::log(\"User account activation has failed\" . print_r($this->getInfo(),1));\n } else {\n Mage::log(\"Successfully user account activation.\");\n }\n return $response;\n\n }catch (Exception $e){\n Mage::log(\"User account activation has failed reason: \" . $e->getMessage());\n Mage::logException($e);\n return false;\n }\n }", "function activate()\n {\n if( $this->attribute( 'is_temporary' ) )\n {\n $this->setAttribute( 'is_temporary', 0 );\n\n $nextID = $this->getNewID();\n $this->setAttribute( 'order_nr', $nextID );\n $this->store();\n\n // Create an order status history element that matches the current status\n $this->createStatusHistory();\n }\n }", "function ActivateSubscriber($IId=array())\n\t\t{\n\t\t\t//$sSQL = \"UPDATE tbl_member set isActive='y' WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t//$response = $this->Execute($sSQL);\n\t\t\t$sSQL\t=\t\"UPDATE tbl_member set isActive='y' WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\n\t\t\t\n\t\t}", "public function activateUser($activateCode, UserRepositoryInterface $userRepository)\n {\n try{\n if($userRepository->UserCountWithActivateCode($activateCode) > 0){\n $user = $userRepository->getUserFromActivateCode($activateCode);\n $userRepository->activateUser($user);\n }\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function activate($username);", "public function signupActivate($token)\n {\n $user = Usuario::where('activation_token', $token)->first();\n if (!$user) {\n return $this->sendError('Este token de activación no es válido.'); \n }\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n return $this->sendResponse($user->toArray(), 'Cuenta activada con éxito');\n }", "public function activateAsyncWithHttpInfo($id, $activate_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Payment';\n $request = $this->activateRequest($id, $activate_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 }", "function testActivateSuccess() {\r\n $this->User =& new User();\r\n \r\n \t//check if the user is not activated yet\r\n \t$activated = $this->User->field('activated', array('id'=>'1'));\r\n \t$this->assertEqual('no', $activated);\r\n \r\n \t// should activate the first user.\r\n $result = $this->User->activate('1bc29b36f623ba82aaf6724fd3b16718');\r\n $this->assertTrue($result);\r\n \t\t\r\n \t\t//check if the activation really worked\r\n \t$activated = $this->User->field('activated', array('id'=>'1'));\r\n \t$this->assertEqual('yes', $activated);\r\n \t\r\n \t\r\n \t\r\n \t//test done, set data back to original values...\r\n \t$this->User->id = 1;\r\n \t$this->User->saveField('activated', 'no');\r\n }", "public function activateAction($key = '')\n {\n if ($key == '') throw new HttpException(400, \"Invalid user credentials. Please try again.\");\n\n $userInfo = $this->get('UserServices')->checkUserEmailMD5($key);\n\n if ( !$userInfo ) throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n\n if ($this->get('UserServices')->activateUsersAccount($userInfo['cu_id'])) {\n $message = $this->translator->trans('Your account is activated.');\n } else {\n throw new HttpException(422, $this->translator->trans('Your activation link has expired.'));\n }\n\n $result = array();\n $result['status'] = \"success\";\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "function activate() {\r\r\n }", "public function activate()\n {\n Cleeng_Core::load('Cleeng_WpClient');\n Cleeng_Client::checkCompatibility();\n $this->migrate_database();\n //$cleengAdmin = Cleeng_Core::load('Cleeng_Admin');\n //$cleengAdmin->message(\"Cleeng for WordPress installed.\");\n }", "public function reactivate($subscription_id)\n {\n // TODO: Check if subscription is cancelled\n return ChargeBee_Subscription::reactivate($subscription_id)->subscription();\n }", "public function stripeSubscribe(Request $request)\n {\n $this->validate($request, [\n 'plan_id' => 'string|required',\n 'payment_method_id' => 'string|required',\n ]);\n\n // Create New Stripe customer\n if (is_null(auth()->user()->stripe_id) || empty(auth()->user()->stripe_id)) {\n $name = auth()->user()->fullname ? auth()->user()->email : null;\n $address = [\n 'line1' => '510 Townsend St',\n 'postal_code' => '98140',\n 'city' => 'San Francisco',\n 'state' => 'CA',\n 'country' => 'US',\n ];\n $email = (auth()->user()->email) ? auth()->user()->email : null;\n $customer = $this->stripeCustomer->createSubscriptionCustomer($name,$email,$address,$request->payment_method_id);\n }\n //stripe customer id\n $customer_id = auth()->user()->stripe_id;\n\n // Subscribe customer to a plan\n $subscription = $this->stripeCustomer->createSubscription($request->plan_id, $customer_id, $request->trial_period);\n\n $sub = Subscriptions::create([\n 'user_id' => auth()->user()->id,\n 'customer_id' => $subscription->customer,\n 'subscription_id' => $subscription->id,\n 'subscription_amount' => $subscription->plan->amount,\n 'plan_name' => $subscription->plan->nickname,\n 'subscription_start_date' => date('Y-m-d h:i:s', $subscription->current_period_start),\n 'subscription_end_date' =>date('Y-m-d h:i:s', $subscription->current_period_end),\n 'subscription_trial_period' => date('Y-m-d h:i:s', $subscription->trial_end),\n ]);\n\n if ($subscription && $sub) {\n $response = \"successful\";\n return json_encode($response);\n } else {\n $response = \"failed\";\n return json_encode($response);\n }\n }", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public function activate($entity)\n\t{\n\t\treturn $this->perform('activate', $entity, ['active' => 1], false);\n\t}", "public function activate($code)\n {\n if (Auth::check())\n {\n return Redirect::to('/');\n }\n\n\n $user = User::where('code', '=', $code)->where('active', '=', 0);\n\n if ($user->count())\n {\n $user = $user->first();\n\n //update user to active state\n $user->active = 1;\n $user->code = '';\n\n if ($user->save())\n {\n\n return Redirect::route('log')\n ->with('success', 'Your account is activated. Now you can sign in.');\n }\n }\n\n return Redirect::route('log')\n ->with('success', 'WE could not activate your account. Try again later.');\n\n }", "public function againActivate(Request $request)\n {\n $template_html = 'mail.activate_user';\n\n $template_data = [\n 'url_activate' => url('http://localhost/sms_mkt/activated.php?key=' . encrypt($request->email) . '&user=' . $request->username),\n\n ];\n\n $user = new Users();\n $user->email = $request->email;\n\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ยืนยันตัวตน === Activate');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n return $this->responseRequestSuccess('Success!');\n }", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "public function activate(Request $request, $id)\n {\n $oCertConfig = SCertConfig::find($id);\n\n session('utils')->validateEdition($this->oCurrentUserPermission->privilege_id, $oCertConfig);\n\n $oCertConfig->is_deleted = \\Config::get('scsys.STATUS.ACTIVE');\n $oCertConfig->updated_by_id = \\Auth::user()->id;\n\n $errors = $oCertConfig->save();\n if (sizeof($errors) > 0)\n {\n return redirect()->back()->withInput($request->input())->withErrors($errors);\n }\n\n Flash::success(trans('messages.REG_ACTIVATED'))->important();\n\n return redirect()->route('qms.certconfigs.index', 0);\n }", "public function setActivateOn(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->activate_on = $var;\n }", "public function activation($token,$newsletter_id)\n {\n // Activate the email on the website\n $user = $this->subscription->activate($token);\n\n if(!$user)\n {\n alert()->danger('Le jeton ne correspond pas ou à expiré');\n\n return redirect('/');\n }\n\n $newsletter = $this->newsletter->find($newsletter_id);\n\n if(!$newsletter)\n {\n alert()->danger('Cette newsletter n\\'existe pas');\n\n return redirect('/');\n }\n\n //Subscribe to mailjet\n $this->worker->setList($newsletter->list_id);\n $result = $this->worker->subscribeEmailToList($user->email);\n\n if(!$result){\n\n alert()->danger('Problème');\n\n return redirect('/');\n }\n\n alert()->success('Vous êtes maintenant abonné à la newsletter');\n\n return redirect('/');\n }", "public function activate($name,$token)\n {\n $user = public_users::where(['token'=> $token,'name'=>$name,'status'=>0])->first();\n $this->notification_lock($user->num_of_sends);\n if (empty($user)) {\n session()->flash('err_msg','Your activation code is either expired or invalid, login here to re-validate.');\n return redirect()->to('/public/login');\n }\n else{\n $user->status=1;\n $user->token=null;\n $user->update();\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }\n }", "public function mailActivateAccount($params)\n {\n $this->mailer->accountActivation($params);\n }", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function reactivate() : self\n {\n $subscription = $this->asStripeSubscription();\n\n if ($subscription->status === 'canceled') {\n $appPlan = $this->getPlans('apps_plans_id > 0')->getFirst()->appPlan;\n $companyGroup = $this->companyGroup;\n $company = $this->company;\n $branch = $this->branch;\n $options = [];\n $customerOptions = [];\n\n //we need to recreate the subscription\n $newSubscription = new SubscriptionBuilder(\n $appPlan,\n $this->getDI()->get('app'),\n $companyGroup,\n $company,\n $branch\n );\n $newSubscriptionModel = $newSubscription\n ->withMetadata(['appPlan' => $appPlan->getId()])\n ->skipTrial()\n ->create($options, $customerOptions);\n\n $this->softDelete();\n\n return $newSubscriptionModel;\n }\n\n $subscription->cancel_at_period_end = false;\n $subscription->save();\n\n return $this;\n }", "public function activation() {\n\t\t\tif ( ! class_exists( 'Easy_Digital_Downloads' ) ) {\n\t\t\t\t// is this plugin active?\n\t\t\t\tif ( is_plugin_active( $this->basename ) ) {\n\t\t\t\t\t// deactivate the plugin\n\t\t\t \t\tdeactivate_plugins( $this->basename );\n\t\t\t \t\t// unset activation notice\n\t\t\t \t\tunset( $_GET[ 'activate' ] );\n\t\t\t \t\t// display notice\n\t\t\t \t\tadd_action( 'admin_notices', array( $this, 'admin_notices' ) );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "public static function activate($id, $activationToken = '')\n\t{\n\t\t$user = User::find($id);\n\n\t\tif (!empty($user) && !$user->activated && (static::is('admin') || $activationToken == $user->activation_token))\n\t\t{\n\t\t\t$user->activated_at = date('Y-m-d H:i:s');\n\t\t\t$user->save();\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function activateAccount($token)\n {\n $logger = $this->getLogger();\n\n try {\n $result = $this->apiClient->httpPost('/v2/users', [\n 'activationToken' => $token,\n ]);\n\n $logger->info('Account activation attempt with token was successful');\n\n return true;\n } catch (ApiException $ex) {\n $logger->err($ex->getMessage());\n }\n\n $logger->info('Account activation attempt with token failed, or was already activated');\n\n return false;\n }", "public static function activate() {\n\t\tself::check_for_premium_settings();\n\t}", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "public function activate()\n {\n $this->isActive = true;\n return $this;\n }", "public function activate($id) {\n $this->authorize('activate', $this->model);\n $this->model->activateUser($id);\n Controller::FlashMessages('The user has been activated', 'success');\n return redirect('/users');\n }" ]
[ "0.6994718", "0.6975532", "0.67382145", "0.6680621", "0.66453964", "0.6433421", "0.6394199", "0.633572", "0.6309074", "0.6309074", "0.62702835", "0.624622", "0.623014", "0.6210319", "0.61651057", "0.61602265", "0.6143279", "0.6077699", "0.6071658", "0.6045309", "0.6038755", "0.60225666", "0.59970087", "0.5993002", "0.59857917", "0.5981512", "0.5981395", "0.5973826", "0.5970335", "0.5970335", "0.5970335", "0.5968579", "0.5965682", "0.59309244", "0.5923506", "0.5916102", "0.5896449", "0.5879351", "0.58740497", "0.58629537", "0.58334273", "0.58264554", "0.5824545", "0.58047956", "0.58000606", "0.5796627", "0.57945126", "0.5773004", "0.5768294", "0.57556915", "0.5751802", "0.5751802", "0.5743093", "0.5739781", "0.57347465", "0.5716714", "0.5713366", "0.56992257", "0.56924444", "0.56911063", "0.5677447", "0.5676497", "0.5661704", "0.5652869", "0.5651072", "0.5646752", "0.5644784", "0.5642237", "0.56389976", "0.5638719", "0.5633834", "0.5632806", "0.5629123", "0.56265765", "0.56250435", "0.56247514", "0.5623373", "0.5618887", "0.56136656", "0.5609639", "0.55991435", "0.5591564", "0.55913925", "0.5590775", "0.55847335", "0.557101", "0.55654573", "0.5564017", "0.5561025", "0.55417436", "0.5539761", "0.5498788", "0.54955626", "0.5490707", "0.5489988", "0.5486396", "0.5484065", "0.5465867", "0.54587144", "0.54566014" ]
0.7650598
0
Operation activateWithHttpInfo Activate Subscription
public function activateWithHttpInfo($id, $activate_subscription_request = null) { $request = $this->activateRequest($id, $activate_subscription_request); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Payment' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Payment' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Payment', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Payment'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Payment', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate($id, $activate_subscription_request = null)\n {\n list($response) = $this->activateWithHttpInfo($id, $activate_subscription_request);\n return $response;\n }", "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function activateAsyncWithHttpInfo($id, $activate_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Payment';\n $request = $this->activateRequest($id, $activate_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 activateAsync($id, $activate_subscription_request = null)\n {\n return $this->activateAsyncWithHttpInfo($id, $activate_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function activated_subscription( $order ) {\n\n\t\t// set properties\n\t\t$properties = apply_filters( 'wc_kissmetrics_activated_subscription_properties',\n\t\t\tarray(\n\t\t\t\t'subscription_name' => WC_Subscriptions_Order::get_item_name( $order ),\n\t\t\t\t'total_initial_payment' => WC_Subscriptions_Order::get_total_initial_payment( $order ),\n\t\t\t\t'initial_sign_up_fee' => WC_Subscriptions_Order::get_sign_up_fee( $order ),\n\t\t\t\t'subscription_period' => WC_Subscriptions_Order::get_subscription_period( $order ),\n\t\t\t\t'subscription_interval' => WC_Subscriptions_Order::get_subscription_interval( $order ),\n\t\t\t\t'subscription_length' => WC_Subscriptions_Order::get_subscription_length( $order ),\n\t\t\t\t'subscription_trial_period' => WC_Subscriptions_Order::get_subscription_trial_period( $order ),\n\t\t\t\t'subscription_trial_length' => WC_Subscriptions_Order::get_subscription_trial_length( $order )\n\t\t\t), $order, $this\n\t\t);\n\n\t\t// record event\n\t\t$this->api_record_event( $this->event_name['activated_subscription'],\n\t\t\tarray(\n\t\t\t\t$this->property_name['subscription_name'] => $properties['subscription_name'],\n\t\t\t\t$this->property_name['total_initial_payment'] => $properties['total_initial_payment'],\n\t\t\t\t$this->property_name['initial_sign_up_fee'] => $properties['initial_sign_up_fee'],\n\t\t\t\t$this->property_name['subscription_period'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_interval'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_length'] => $properties['subscription_interval'],\n\t\t\t\t$this->property_name['subscription_trial_period'] => $properties['subscription_trial_period'],\n\t\t\t\t$this->property_name['subscription_trial_length'] => $properties['subscription_trial_length'],\n\t\t\t),\n\t\t\t$this->get_identity( $order->user_id )\n\t\t);\n\n\t}", "public function activateAccount($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n list($response) = $this->activateAccountWithHttpInfo($id, $x_avalara_client, $body);\n return $response;\n }", "public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function activateAction($key = '')\n {\n if ($key == '') throw new HttpException(400, \"Invalid user credentials. Please try again.\");\n\n $userInfo = $this->get('UserServices')->checkUserEmailMD5($key);\n\n if ( !$userInfo ) throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n\n if ($this->get('UserServices')->activateUsersAccount($userInfo['cu_id'])) {\n $message = $this->translator->trans('Your account is activated.');\n } else {\n throw new HttpException(422, $this->translator->trans('Your activation link has expired.'));\n }\n\n $result = array();\n $result['status'] = \"success\";\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "protected function activateAccountRequest($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activateAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function simplenews_subscription_activate($snids, $status) {\n foreach (simplenews_subscriber_load_multiple($snids) as $subscriber) {\n $subscriber->activated = $status;\n simplenews_subscriber_save($subscriber);\n }\n}", "public function activate(){\r\n\t\t$id = $this->uri->segment(3);\r\n\t\t$code = $this->uri->segment(4);\r\n\r\n\t\t//fetch requests details\r\n\t\t$request = $this->requests_model->getRequestById($id);\r\n \r\n\r\n\t\t//if code matches\r\n\t\tif($request['code'] == $code){\r\n\t\t\t//update user active status\r\n\t\t\t// $data['activate'] = true;\r\n\t\t\t$query = $this->accounts_model->updateActivate($id);\r\n\r\n\t\t\tif($query){\r\n\r\n\t\t\t\t$row = $this->accounts_model->getCheckUser($request['email']);\r\n\r\n\t\t\t\t$this->session->set_userdata('is_user', $row['type']);\r\n\t\t\t\t$this->session->set_userdata('myName', \t$row['firstname'].\" \".$row['lastname']);\r\n\t\t\t\t$this->session->set_userdata('myEmail', $row['email']);\r\n\t\t\t\t$this->session->set_userdata('myId', \t$row['id']);\r\n\t\t\t\t$this->session->set_userdata('myRole', \t$row['role']);\r\n\r\n\t\t\t\t$this->session->set_flashdata('msg', 'User activated successfully');\r\n\t\t\t\tredirect('main');\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\t$this->session->set_flashdata('error_msg', 'Something went wrong in activating account');\r\n\t\t\t\tredirect('login'); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\t\t\t\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Cannot activate account. Code didnt match');\r\n\t\t\tredirect('login'); \r\n\t\t}\r\n \r\n\t}", "public function activateAccountWithHttpInfo($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\AccountModel';\n $request = $this->activateAccountRequest($id, $x_avalara_client, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\AccountModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function activate($id)\n {\n // Get the resource\n $object = $this->find($id);\n\n // Make sure we can activate\n if (! $object->isActivationAllowed()) {\n $this->throwException($this->error('activation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('activating', [$object]);\n\n // Activate the resource\n $object->active = 1;\n $object->activated_at = Carbon::now();\n\n // Validate the resource\n if ($object->isInvalid('activating') || ! $object->save()) {\n $this->throwException($object->getErrors(), $this->error('activate'));\n }\n\n // Fire after listeners\n $this->eventFire('activated', [$object]);\n\n return $object;\n }", "public function activate() {\n\n\t\t// Get License\n\t\t$license = $this->get_license();\n\n\t\ttry {\n\n\t\t\t// Check License key\n\t\t\tif ( '' === $license->get_key() ) {\n\t\t\t\tthrow new Exception( 'Please enter your license key.' );\n\t\t\t}\n\n\t\t\t// Check license email\n\t\t\tif ( '' === $license->get_email() ) {\n\t\t\t\tthrow new Exception( 'Please enter the email address associated with your license.' );\n\t\t\t}\n\n\t\t\t// Do activate request\n\t\t\t$request = wp_remote_get( self::STORE_URL . self::ENDPOINT_ACTIVATION . '&' . http_build_query( array(\n\t\t\t\t\t'email' => $license->get_email(),\n\t\t\t\t\t'licence_key' => $license->get_key(),\n\t\t\t\t\t'api_product_id' => $this->product_id,\n\t\t\t\t\t'request' => 'activate',\n\t\t\t\t\t'instance' => site_url()\n\t\t\t\t), '', '&' ) );\n\n\t\t\t// Check request\n\t\t\tif ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t}\n\n\t\t\t// Get activation result\n\t\t\t$activate_results = json_decode( wp_remote_retrieve_body( $request ), true );\n\n\t\t\t// Check if response is correct\n\t\t\tif ( ! empty( $activate_results['activated'] ) ) {\n\n\t\t\t\t// Set local activation status to true\n\t\t\t\t$license->set_status( 'active' );\n\t\t\t\t$this->set_license( $license );\n\n\t\t\t\t// Return Message\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'message' => __( 'License successfully activated.', 'download-monitor' )\n\t\t\t\t);\n\n\t\t\t} elseif ( $activate_results === false ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t} elseif ( isset( $activate_results['error_code'] ) ) {\n\t\t\t\tthrow new Exception( $activate_results['error'] );\n\t\t\t}\n\n\n\t\t} catch ( Exception $e ) {\n\n\t\t\t// Set local activation status to false\n\t\t\t$license->set_status( 'inactivate' );\n\t\t\t$this->set_license( $license );\n\n\t\t\t// Return error message\n\t\t\treturn array( 'result' => 'failed', 'message' => $e->getMessage() );\n\t\t}\n\t}", "public function activate() {\n\t\t/**\n\t\t * Fires when the plugin is being activated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_activate');\n\t}", "public function activateUser($request)\r\n {\r\n /*\r\n * When registration has done you must activate your account to log in.\r\n * (Application will show you message \"You must confirm account\")\r\n */\r\n\r\n\r\n /*\r\n * In database we want to set field IsActivated to '1'\r\n */\r\n $params = [\r\n 'IsActivated' => '1'\r\n ];\r\n\r\n /*\r\n * Update row in user table where Activativon ==$request['activation']<---\r\n */\r\n $this->primary = 'Activation';\r\n $this->update($request['activation'], $params);\r\n\r\n }", "public function setActivateOn(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->activate_on = $var;\n }", "public function activate($id, $activation_code)\n {\n $user = $this->account()->activate($id, $activation_code);\n \n return redirect($this->redirectTo);\n/*\n return redirect(route('login'))->with('confirmation-success', trans('confirmation::confirmation.success'));\n*/\n }", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "function activate($key)\n {\n // activate account\n $result = $this->user_model->activate_account($key);\n \n switch($result)\n {\n case 0: // If activation key not matched with any account\n $msg = 'No account is related with this activation key, either your account is already activated or key is expired !!!'; \n $type = \"danger\";\n break;\n \n case 1: // Account activated\n $msg = 'Congratulations, your account is activated now. Login here';\n $type = \"success\"; \n break;\n \n case 2: // Activation key expired\n $msg = 'Activation key expired, create new account.';\n $type = \"warning\";\n break; \n \n default:\n break;\n \n }\n\n // set notification message to show on page\n $this->base->set_message($msg, $type); \n \n $this->index();\n\n return true;\n }", "public function activate() {\n add_option( 'wpb_js_composer_do_activation_redirect', true );\n }", "public function testActivateBySuperAdmin(): void\n {\n // Login via super-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/3?token=' . $token);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data' =>\n [\n \"tenant_id\",\n \"outro_card\",\n \"active\",\n \"updated_at\",\n \"created_at\",\n \"id\",\n ],\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $success);\n $this->assertEquals(200, $code);\n $this->assertCount(6, $data);\n $this->assertEquals(3, $data['id']);\n $this->assertEquals(3, $data['tenant_id']);\n $this->assertEquals('outroCards/test3.mp4', $data['outro_card']);\n $this->assertEquals(false, $data['active']);\n $this->assertEquals('Status \"active\" was changed.', $message);\n }", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "public function activateAction()\r\n {\r\n\t\tUser::activate($this->route_params['token']);\r\n\t\t\r\n\t\t$this->user = Auth::getUser();\r\n\r\n $this->redirect('/signup/activated');\r\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order);", "public function mailActivateAccount($params)\n {\n $this->mailer->accountActivation($params);\n }", "public function activate($id)\n {\n User::withTrashed()->find($id)->restore();\n $user = User::find($id);\n\n /* revoke user from oauth */\n $client = Client::where('user_id', $id);\n $client_update = array('revoked' => false);\n $client->update($client_update);\n \n Mail::to($user->email)\n ->send(new UserActivated($user));\n\n return response()->json(['success' => 'OK']);\n }", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "public function activateAccount()\n {\n // Récupération des variables nécessaires à l'activation\n $email = $_GET['email'];\n $activation_key = $_GET['key'];\n // On active le compte\n $activation = $this->Members->activateAccount($email, $activation_key);\n\n // Préparation de la page\n $page = new Page(array(\n 'title' => 'Inscription réussie',\n 'class_body' => 'signin'\n ));\n // Rendu du contenu\n $variables = compact('activation');\n $content = $this->render('members/signin/validation.php', $variables);\n // Rendu de la page\n echo $page->render($content);\n }", "static function jitm_jetpack_woo_services_activate( $CTA ) {\n\t\treturn wp_nonce_url(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'wc-services-action' => 'activate',\n\t\t\t\t),\n\t\t\t\tadmin_url( 'admin.php?page=wc-settings' )\n\t\t\t),\n\t\t\t'wc-services-install'\n\t\t);\n\t}", "function activate() {\n }", "public function actionActivate($email, $activationKey)\r\n {\r\n if($this->module->activeAfterRegister) // If accounts do not need to be activated.\r\n {\r\n throw new \\yii\\web\\NotFoundHttpException(); // Hide this action.\r\n }\r\n \r\n if(!Yii::$app->user->isGuest) // Only guest can activate accounts.\r\n {\r\n // Redirect instead of throwing a 403, because logged user end up on this page quite often.\r\n $this->redirect($this->module->returnLogoutUrl, 302); // Temporary redirect.\r\n }\r\n \r\n $model= User::find()->where(['email' => $email])->one();\r\n \r\n if($model && (int)$model->status === User::STATUS_ACTIVE) // If the account is already active.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is already active.'));\r\n }\r\n else if($model->activation_key && $model->activation_key == $activationKey) // The activation data checked out.\r\n {\r\n $model->scenario = 'activation';\r\n $model->status = User::STATUS_ACTIVE;\r\n $model->save();\r\n \r\n // Notify the user that activation was sucessful.\r\n return $this->render('message', [\r\n 'model' => $model,\r\n 'message' => Yii::t(__CLASS__, 'Your account is now active. Please log in to start using the service.'),\r\n 'type' => 'success'\r\n ]);\r\n }\r\n else if($model && (int)$model->status !== User::STATUS_ACTIVE && ($model->activation_key == $activationKey)) // The account has been disabled.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is not active.'));\r\n }\r\n \r\n // The activation url was wrong.\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'Incorrect activation URL.'));\r\n }", "public function crceTariffChangeActivateTariffSubscriptionWithHttpInfo($subscription_id, $tariff_id, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceTariffChangeActivateTariffSubscription');\n }\n // verify the required parameter 'tariff_id' is set\n if ($tariff_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $tariff_id when calling crceTariffChangeActivateTariffSubscription');\n }\n // parse inputs\n $resourcePath = \"/subscriptions/{subscriptionId}/availableTariffs/{tariffId}/activate\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // path params\n if ($tariff_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"tariffId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($tariff_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\TariffChangeResponse',\n '/subscriptions/{subscriptionId}/availableTariffs/{tariffId}/activate'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\TariffChangeResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\TariffChangeResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public function activate() {\n\t\t\n\t}", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "public static function activate()\n {\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function requestActivateAccount($tk)\n {\n $data = [\n 'path' => 'email-activate',\n 'token' => $tk\n ];\n \n $res = $this->postExternalRequest($data);\n \n return redirect('/login');\n \n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function activateAccount($email){\n try{\n\n Mage::log(\"Trying to create new User Account with params: \" . print_r($email, 1));\n\n $response = $this->setUnauthorizedRequest()\n ->postMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT_ACTIVATE_ACCOUNT),\n Mage::helper('core')->jsonEncode(['email' => $email])\n )\n ->execute([parent::CREATED_HTTP_CODE, parent::SUCCESS_HTTP_CODE]);\n\n if($this->hasFailed()) {\n Mage::log(\"User account activation has failed\" . print_r($this->getInfo(),1));\n } else {\n Mage::log(\"Successfully user account activation.\");\n }\n return $response;\n\n }catch (Exception $e){\n Mage::log(\"User account activation has failed reason: \" . $e->getMessage());\n Mage::logException($e);\n return false;\n }\n }", "public function activate()\n {\n $license = Licenses::find($this->key);\n $license->school_id = $this->auth_school_id;\n $license->activated_at = Carbon::now();\n $license->used=LICENCE_KEY_USED;\n if($license->save()){\n return $this->duration($license->duration);\n }\n return FALSE;\n }", "public function testCanActivateUser()\n {\n $user = factory(User::class)->create();\n $activation = $user->create_activation();\n $this->get('/api/v1/activate/'.$activation->token, ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $user->email,\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $user->email,\n 'activated' => true\n ]);\n $this->assertDatabaseMissing('user_activations', [\n 'email' => $user->email,\n ]);\n $this->assertTrue(Auth::user()->id == $user->id);\n }", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "public static function activate() {\n\n }", "public function activateAccountAsyncWithHttpInfo($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\AccountModel';\n $request = $this->activateAccountRequest($id, $x_avalara_client, $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 activate(Request $request, $id)\n {\n $oCertConfig = SCertConfig::find($id);\n\n session('utils')->validateEdition($this->oCurrentUserPermission->privilege_id, $oCertConfig);\n\n $oCertConfig->is_deleted = \\Config::get('scsys.STATUS.ACTIVE');\n $oCertConfig->updated_by_id = \\Auth::user()->id;\n\n $errors = $oCertConfig->save();\n if (sizeof($errors) > 0)\n {\n return redirect()->back()->withInput($request->input())->withErrors($errors);\n }\n\n Flash::success(trans('messages.REG_ACTIVATED'))->important();\n\n return redirect()->route('qms.certconfigs.index', 0);\n }", "public function againActivate(Request $request)\n {\n $template_html = 'mail.activate_user';\n\n $template_data = [\n 'url_activate' => url('http://localhost/sms_mkt/activated.php?key=' . encrypt($request->email) . '&user=' . $request->username),\n\n ];\n\n $user = new Users();\n $user->email = $request->email;\n\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ยืนยันตัวตน === Activate');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n return $this->responseRequestSuccess('Success!');\n }", "public function activate( Activator $activator_object ) {\n\t\t$activator_object->activate(\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\tnew Booking_Custom_Post( $this->initial_values->get_booking_custom_post_type_values() )\n\t\t\t]\n\t\t);\n\t}", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "public function activateAccount($token)\n {\n\n $user = Activation::where('code', $token)->get();\n\n if (count($user) == 0) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation = User::find($user[0]->user_id);\n\n if (empty($activation)) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation_update = Activation::findOrFail($user[0]->id);\n\n $activation_update->completed = 1;\n\n if ($activation_update->save()) {\n return Redirect::route('activate.app')->with(\n 'success',\n 'Cuenta activada correctamente'\n );\n //return response()->json(['status' => true, 'message' => \"Cuenta activada\", 'code' => 200]);\n } else {\n return redirect('register')->with(\n 'error',\n 'Error en activar cuenta'\n );\n //return response()->json(['status' => false, 'message' => \"Cuenta no activada\", 'code' => 200]);\n }\n }", "public function activate();", "public function activate();", "public function activate(Request $request){\n $token = $request->get(\"token\", '');\n\n if ($token==\"default\") {\n $content['error'] = \"Please activate your account\";\n }\n elseif (!$this->activationTokenModel->activate($token)) {\n if ($this->activationTokenModel->hasError()) {\n $content['error'] = $this->activationTokenModel->errorToString();\n } else {\n $content['error'] = \"An unknown error prevented us from continue\";\n }\n } else {\n $acc = new AccountModel();\n $acc->redirectToLobby();\n }\n return $this->render($request, $content);\n }", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n $msg = __('auth.token_invalid');\n return ApiResponse::errorResponse('UNAUTHORIZED_ERROR', $msg, []);\n //return $this->errorResponse($msg,[]);\n //return response()->json([\n // 'message' => __('auth.token_invalid')\n //], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n $user->notify(new SignupActivated($user));\n $msg = __('auth.active_success');\n return ApiResponse::successResponse('SUCCESS', $msg, []);\n //return $this->successResponse($msg,$user);\n //return $user;\n }", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "public function actionActivate()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', [\n 'required' => true\n ]);\n $model = $this->findModel($username);\n $model->status = User::STATUS_ACTIVE;\n $model->removeEmailConfirmToken();\n $this->log($model->save());\n }", "public function activate($locator){\n\t\t$activationkey = $this->request->get('id');\n\t\t\n\t\t$model = $this->_load('app')->model('users');\n\t\t$model->activate($activationkey);\n\t\t\n\t\t$this->response->setPartial('maincontent', 'user/activate', array('errmsg' => $model->getErrorMsg(' ')));\n\t\t\n\t}", "public function activateByKey(\n $activationKey\n ) {\n if (!$this->modifyByKey($activationKey, 0)) {\n return false;\n }\n\n $this->getLogManager()->createActivatedBySubscriber($this->getSubscriber());\n\n return true;\n }", "function activate() {\r\r\n }", "public function executeActivateAccount(sfWebRequest $request)\n {\n $tkn = trim($request->getParameter('tk', ''));\n $usr = AppUserTable::getInstance()->findOneByRecoverToken($tkn);\n\n if ($usr) {\n \tif (!$usr->getEnabled()) {\n\t \t$usr->setRecoverToken(NULL);\n\t \t$usr->setEnabled(1);\n\t \t$usr->save();\n\n\t \tServiceAuthentication::startSessionProcess($usr);\n\t\n\t \t$this->getUser()->setFlash('activate', true);\t\n \t}\n }\n $this->redirect('home/index');\n }", "public function testActivateFailUserActive()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $this->Users->save($user);\n\n $this->assertEquals(1, $user->active);\n\n $this->get('/users/activate/' . $user->email . '/' . $user->activation_key . '');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n\n $this->assertNotEmpty($_SESSION['Flash']['flash']['message']);\n $this->assertContains('error', $_SESSION['Flash']['flash']['element']);\n }", "public static function activate($activate_token)\n\t{\n\t\t$token = new static(compact('activate_token'));\n\n\t\t$token->raise(new MemberWasActivated($token));\n\n\t\treturn $token;\n\t}", "public function activate($id) {\n $this->authorize('activate', $this->model);\n $this->model->activateUser($id);\n Controller::FlashMessages('The user has been activated', 'success');\n return redirect('/users');\n }", "public function activate($username);", "function activate()\n {\n if( $this->attribute( 'is_temporary' ) )\n {\n $this->setAttribute( 'is_temporary', 0 );\n\n $nextID = $this->getNewID();\n $this->setAttribute( 'order_nr', $nextID );\n $this->store();\n\n // Create an order status history element that matches the current status\n $this->createStatusHistory();\n }\n }", "public static function activate(){\n }", "public function activate() {\n global $wp_roles;\n\n if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) {\n // @codingStandardsIgnoreLine\n $wp_roles = new \\WP_Roles();\n }\n\n $all_cap = array(\n 'dokan_view_booking_menu',\n 'dokan_add_booking_product',\n 'dokan_edit_booking_product',\n 'dokan_delete_booking_product',\n 'dokan_manage_booking_products',\n 'dokan_manage_booking_calendar',\n 'dokan_manage_bookings',\n 'dokan_manage_booking_resource',\n );\n\n foreach ( $all_cap as $key => $cap ) {\n $wp_roles->add_cap( 'seller', $cap );\n $wp_roles->add_cap( 'administrator', $cap );\n $wp_roles->add_cap( 'shop_manager', $cap );\n }\n\n // flush rewrite rules after plugin is activate\n $this->flush_rewrite_rules();\n }", "public function activateUser($activateCode, UserRepositoryInterface $userRepository)\n {\n try{\n if($userRepository->UserCountWithActivateCode($activateCode) > 0){\n $user = $userRepository->getUserFromActivateCode($activateCode);\n $userRepository->activateUser($user);\n }\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }", "public function activate()\n {\n return view('licenses.activate');\n }", "public function activate($entity)\n\t{\n\t\treturn $this->perform('activate', $entity, ['active' => 1], false);\n\t}", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "public function mailActivatedAccount($params)\n {\n $this->mailer->accountActivated($params);\n }", "public function activate() {\n $installer = new WeDevs\\Notification\\Installer();\n $installer->run();\n }", "public function bookingActive()\n\t{\n\t\t$ch = new Curl();\n\t\t\n\t\t$this->headers['Authorization'] = 'Bearer ' . $this->authToken;\n\t\t\n\t\t$data = [];\n\t\t\n\t\treturn $ch->get(GojekID::BASE_ENDPOINT . Action::bookingActive, $data, $this->headers)->getResponse();\n\t}", "public function activate($user_id, $email_key) {\n $activated = $this->authm->activate_user_account($user_id, $email_key);\n if($activated === TRUE) {\n $this->login($user_id, 2);\n redirect('/relationship');\n } else {\n if($activated === 1) {\n show_error($this->lang->line('auth_activate_error_1'));\n } else {\n show_error($this->lang->line('auth_activate_error_2'));\n }\n }\n }", "public function activate($value)\n {\n if (is_string($value)) {\n $value = new JavaScriptFunction($value);\n }\n\n return $this->setProperty('activate', $value);\n }", "public function activateDelivery($id, Request $request)\n\t{\n\n\t\t$delivery_info = DB::table(\"deliveries\")\n\t\t\t->where(\"delivery_id\", $id)\n\t\t\t->select(\"status\", \"phone\", \"lang\")\n\t\t\t->first();\n\t\tif ($delivery_info->status == 0 || $delivery_info->status == \"0\") {\n\t\t\t$update = 3;\n\t\t} else {\n\t\t\t$update = 1;\n\t\t}\n\t\tdate_default_timezone_set('Asia/Riyadh');\n\t\t$timestamp = date(\"Y/m/d H:i:s\", time());\n\t\tDB::table(\"deliveries\")\n\t\t\t->where(\"delivery_id\", $id)\n\t\t\t->update([\n\t\t\t\t\"status\" => $update,\n\t\t\t\t\"admin_activation_time\" => $timestamp,\n\t\t\t\t\"publish\" => 1,\n\t\t\t]);\n\n\t\t####### Start send phone activation message ########\n\n\t\tif ($delivery_info->lang == 'ar') {\n\t\t\t$message = 'تم تفعيل الحساب الخاص بكم بنجاح.';\n\t\t} else {\n\t\t\t$message = 'Your account has been activated successfully.';\n\t\t}\n\n\t\t$res = (new SmsController())->send($message, $delivery_info->phone);\n\n\t\t####### End send phone activation message ########\n\n\t\t$request->session()->flash('success', 'Delivery has been activated successfully');\n\t\treturn redirect()->back()->withInput();\n\t}", "public function activate($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('activate', $value);\n }", "public function reActivationAction() {\n //get the container object\n $container = $this->container;\n //get the translator object\n $translator = $this->get('translator');\n //get the session object\n $session = $this->getRequest()->getSession();\n //check if we have a logged in user or company\n if (FALSE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n $session->getFlashBag()->set('note', $translator->trans('You need to Login first.'));\n return $this->redirect($this->generateUrl('login'));\n }\n\n //check if the user is already active\n if (TRUE === $this->get('security.context')->isGranted('ROLE_USER')) {\n //set a notice flag\n $session->getFlashBag()->set('notice', $translator->trans('Your acount is active.'));\n return $this->redirect($this->generateUrl('user_edit'));\n }\n\n //get the logedin user\n $user = $this->getUser();\n\n //prepare the body of the email\n $body = $this->renderView('ObjectsUserBundle:User:Emails\\activate_email.txt.twig', array('user' => $user));\n //prepare the message object\n $message = \\Swift_Message::newInstance()\n ->setSubject($translator->trans('activate your account'))\n ->setFrom($container->getParameter('mailer_user'))\n ->setTo($user->getEmail())\n ->setBody($body)\n ;\n //send the activation mail to the user\n $this->get('mailer')->send($message);\n //set the success flag in the session\n $session->getFlashBag()->set('success', $this->get('translator')->trans('check your email for your activation link'));\n //redirect the user to portal\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "public function activate()\n {\n $this->fireModelEvent('activating');\n\n $this->active = true;\n $result = $this->save();\n\n $this->fireModelEvent('activated');\n\n return $result;\n }", "public function accountActivation($userID, $activationKey)\n {\n $processReaction = $this->userEngine\n ->processAccountActivation(\n $userID,\n $activationKey\n );\n\n // Check if account activation process succeed\n if ($processReaction['reaction_code'] === 1) {\n return redirect()->route('user.login')\n ->with([\n 'success' => 'true',\n 'message' => __('Your account has been activated successfully. Login with your email ID and password.'),\n ]);\n }\n\n // if activation process failed then\n return redirect()->route('user.login')\n ->with([\n 'error' => 'true',\n 'message' => __('Account Activation link invalid.'),\n ]);\n }", "function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}", "public function activate()\n {\n $this->isActive = true;\n return $this;\n }", "public function activateAccountAsync($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n return $this->activateAccountAsyncWithHttpInfo($id, $x_avalara_client, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function testActivateUser()\n {\n\n $activation_key = $this->Users->generateActivationKey();\n\n $email = '[email protected]';\n\n $_user = [\n 'email' => $email,\n 'password' => 'cakemanager',\n ];\n\n $entity = $this->Users->newEntity($_user);\n\n $entity->set('activation_key', $activation_key);\n\n $save = $this->Users->save($entity);\n\n // assert if saved\n $this->assertNotFalse($save);\n\n // test if key is null\n $this->assertFalse($this->Users->activateUser($email, null));\n\n // test if key is wrong\n $this->assertFalse($this->Users->activateUser($email, 'wrongActivationKey'));\n\n // test if email is wrong\n $this->assertFalse($this->Users->activateUser('wrong_email', $activation_key));\n\n // test if its true\n $this->assertTrue($this->Users->activateUser($email, $activation_key));\n\n $save->set('activation_key', null);\n $this->Users->save($save);\n\n // test if key is null\n $this->assertFalse($this->Users->activateUser($email, null));\n }", "function ActivateSubscriber($IId=array())\n\t\t{\n\t\t\t//$sSQL = \"UPDATE tbl_member set isActive='y' WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t//$response = $this->Execute($sSQL);\n\t\t\t$sSQL\t=\t\"UPDATE tbl_member set isActive='y' WHERE member_id in('\".implode(\"','\", $IId).\"')\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\treturn $response;\n\t\t\t\n\t\t}" ]
[ "0.734406", "0.7328793", "0.6831005", "0.6231273", "0.59754366", "0.5896487", "0.5885638", "0.5812674", "0.57867754", "0.5752892", "0.57142", "0.5699355", "0.55921364", "0.5588363", "0.554243", "0.5541987", "0.553413", "0.553413", "0.5506023", "0.55049783", "0.54795253", "0.5458526", "0.544044", "0.54375637", "0.5433653", "0.5415672", "0.5412353", "0.5411376", "0.5410947", "0.5407289", "0.53740305", "0.5364602", "0.53637266", "0.53501076", "0.5349998", "0.5283576", "0.5281925", "0.5209018", "0.520682", "0.5204107", "0.5198594", "0.51730406", "0.5172408", "0.5168286", "0.51596093", "0.51530087", "0.51530087", "0.51530087", "0.51393", "0.5123917", "0.512282", "0.51155233", "0.5108026", "0.51027584", "0.5097096", "0.5096564", "0.50956607", "0.50900966", "0.5076131", "0.506665", "0.5061784", "0.50453305", "0.50453305", "0.50447583", "0.5038705", "0.5037977", "0.5023216", "0.50151515", "0.5010102", "0.4987113", "0.49611437", "0.49608746", "0.49513903", "0.4941205", "0.49396062", "0.49325714", "0.4930727", "0.4928177", "0.49192747", "0.49148136", "0.49135375", "0.4912638", "0.490906", "0.4905914", "0.49046022", "0.48910543", "0.4873504", "0.48688555", "0.4867044", "0.48647714", "0.48401392", "0.48307648", "0.48260882", "0.48124808", "0.480965", "0.4806851", "0.48017088", "0.47817993", "0.47795665", "0.47791165" ]
0.6841277
2
Operation activateAsync Activate Subscription
public function activateAsync($id, $activate_subscription_request = null) { return $this->activateAsyncWithHttpInfo($id, $activate_subscription_request) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate($id, $activate_subscription_request = null)\n {\n list($response) = $this->activateWithHttpInfo($id, $activate_subscription_request);\n return $response;\n }", "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "function simplenews_subscription_activate($snids, $status) {\n foreach (simplenews_subscriber_load_multiple($snids) as $subscriber) {\n $subscriber->activated = $status;\n simplenews_subscriber_save($subscriber);\n }\n}", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }", "public static function activate()\n {\n }", "public function activate() {\n\t\t/**\n\t\t * Fires when the plugin is being activated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_activate');\n\t}", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "public function activate() {\n\t\t\n\t}", "public static function activate() {\n\n }", "public function activateAction()\r\n {\r\n\t\tUser::activate($this->route_params['token']);\r\n\t\t\r\n\t\t$this->user = Auth::getUser();\r\n\r\n $this->redirect('/signup/activated');\r\n }", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "public function activated_subscription( $order ) {\n\n\t\t// set properties\n\t\t$properties = apply_filters( 'wc_kissmetrics_activated_subscription_properties',\n\t\t\tarray(\n\t\t\t\t'subscription_name' => WC_Subscriptions_Order::get_item_name( $order ),\n\t\t\t\t'total_initial_payment' => WC_Subscriptions_Order::get_total_initial_payment( $order ),\n\t\t\t\t'initial_sign_up_fee' => WC_Subscriptions_Order::get_sign_up_fee( $order ),\n\t\t\t\t'subscription_period' => WC_Subscriptions_Order::get_subscription_period( $order ),\n\t\t\t\t'subscription_interval' => WC_Subscriptions_Order::get_subscription_interval( $order ),\n\t\t\t\t'subscription_length' => WC_Subscriptions_Order::get_subscription_length( $order ),\n\t\t\t\t'subscription_trial_period' => WC_Subscriptions_Order::get_subscription_trial_period( $order ),\n\t\t\t\t'subscription_trial_length' => WC_Subscriptions_Order::get_subscription_trial_length( $order )\n\t\t\t), $order, $this\n\t\t);\n\n\t\t// record event\n\t\t$this->api_record_event( $this->event_name['activated_subscription'],\n\t\t\tarray(\n\t\t\t\t$this->property_name['subscription_name'] => $properties['subscription_name'],\n\t\t\t\t$this->property_name['total_initial_payment'] => $properties['total_initial_payment'],\n\t\t\t\t$this->property_name['initial_sign_up_fee'] => $properties['initial_sign_up_fee'],\n\t\t\t\t$this->property_name['subscription_period'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_interval'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_length'] => $properties['subscription_interval'],\n\t\t\t\t$this->property_name['subscription_trial_period'] => $properties['subscription_trial_period'],\n\t\t\t\t$this->property_name['subscription_trial_length'] => $properties['subscription_trial_length'],\n\t\t\t),\n\t\t\t$this->get_identity( $order->user_id )\n\t\t);\n\n\t}", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order);", "public function activate() {\n\n\t\t// Get License\n\t\t$license = $this->get_license();\n\n\t\ttry {\n\n\t\t\t// Check License key\n\t\t\tif ( '' === $license->get_key() ) {\n\t\t\t\tthrow new Exception( 'Please enter your license key.' );\n\t\t\t}\n\n\t\t\t// Check license email\n\t\t\tif ( '' === $license->get_email() ) {\n\t\t\t\tthrow new Exception( 'Please enter the email address associated with your license.' );\n\t\t\t}\n\n\t\t\t// Do activate request\n\t\t\t$request = wp_remote_get( self::STORE_URL . self::ENDPOINT_ACTIVATION . '&' . http_build_query( array(\n\t\t\t\t\t'email' => $license->get_email(),\n\t\t\t\t\t'licence_key' => $license->get_key(),\n\t\t\t\t\t'api_product_id' => $this->product_id,\n\t\t\t\t\t'request' => 'activate',\n\t\t\t\t\t'instance' => site_url()\n\t\t\t\t), '', '&' ) );\n\n\t\t\t// Check request\n\t\t\tif ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t}\n\n\t\t\t// Get activation result\n\t\t\t$activate_results = json_decode( wp_remote_retrieve_body( $request ), true );\n\n\t\t\t// Check if response is correct\n\t\t\tif ( ! empty( $activate_results['activated'] ) ) {\n\n\t\t\t\t// Set local activation status to true\n\t\t\t\t$license->set_status( 'active' );\n\t\t\t\t$this->set_license( $license );\n\n\t\t\t\t// Return Message\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'message' => __( 'License successfully activated.', 'download-monitor' )\n\t\t\t\t);\n\n\t\t\t} elseif ( $activate_results === false ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t} elseif ( isset( $activate_results['error_code'] ) ) {\n\t\t\t\tthrow new Exception( $activate_results['error'] );\n\t\t\t}\n\n\n\t\t} catch ( Exception $e ) {\n\n\t\t\t// Set local activation status to false\n\t\t\t$license->set_status( 'inactivate' );\n\t\t\t$this->set_license( $license );\n\n\t\t\t// Return error message\n\t\t\treturn array( 'result' => 'failed', 'message' => $e->getMessage() );\n\t\t}\n\t}", "public function activate($id)\n {\n // Get the resource\n $object = $this->find($id);\n\n // Make sure we can activate\n if (! $object->isActivationAllowed()) {\n $this->throwException($this->error('activation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('activating', [$object]);\n\n // Activate the resource\n $object->active = 1;\n $object->activated_at = Carbon::now();\n\n // Validate the resource\n if ($object->isInvalid('activating') || ! $object->save()) {\n $this->throwException($object->getErrors(), $this->error('activate'));\n }\n\n // Fire after listeners\n $this->eventFire('activated', [$object]);\n\n return $object;\n }", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n $msg = __('auth.token_invalid');\n return ApiResponse::errorResponse('UNAUTHORIZED_ERROR', $msg, []);\n //return $this->errorResponse($msg,[]);\n //return response()->json([\n // 'message' => __('auth.token_invalid')\n //], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n $user->notify(new SignupActivated($user));\n $msg = __('auth.active_success');\n return ApiResponse::successResponse('SUCCESS', $msg, []);\n //return $this->successResponse($msg,$user);\n //return $user;\n }", "public function activate();", "public function activate();", "public static function activate(){\n }", "public function activate() {\n add_option( 'wpb_js_composer_do_activation_redirect', true );\n }", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "public function activateAsyncWithHttpInfo($id, $activate_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Payment';\n $request = $this->activateRequest($id, $activate_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 activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "function activate() {\n }", "public function activate()\n {\n $this->fireModelEvent('activating');\n\n $this->active = true;\n $result = $this->save();\n\n $this->fireModelEvent('activated');\n\n return $result;\n }", "public function activateUser($request)\r\n {\r\n /*\r\n * When registration has done you must activate your account to log in.\r\n * (Application will show you message \"You must confirm account\")\r\n */\r\n\r\n\r\n /*\r\n * In database we want to set field IsActivated to '1'\r\n */\r\n $params = [\r\n 'IsActivated' => '1'\r\n ];\r\n\r\n /*\r\n * Update row in user table where Activativon ==$request['activation']<---\r\n */\r\n $this->primary = 'Activation';\r\n $this->update($request['activation'], $params);\r\n\r\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function actionActivate()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', [\n 'required' => true\n ]);\n $model = $this->findModel($username);\n $model->status = User::STATUS_ACTIVE;\n $model->removeEmailConfirmToken();\n $this->log($model->save());\n }", "public function requestActivateAccount($tk)\n {\n $data = [\n 'path' => 'email-activate',\n 'token' => $tk\n ];\n \n $res = $this->postExternalRequest($data);\n \n return redirect('/login');\n \n }", "public function activate()\n {\n $license = Licenses::find($this->key);\n $license->school_id = $this->auth_school_id;\n $license->activated_at = Carbon::now();\n $license->used=LICENCE_KEY_USED;\n if($license->save()){\n return $this->duration($license->duration);\n }\n return FALSE;\n }", "public function activate() {\n $installer = new WeDevs\\Notification\\Installer();\n $installer->run();\n }", "public function activate($entity)\n\t{\n\t\treturn $this->perform('activate', $entity, ['active' => 1], false);\n\t}", "public function activate($name,$token)\n {\n $user = public_users::where(['token'=> $token,'name'=>$name,'status'=>0])->first();\n $this->notification_lock($user->num_of_sends);\n if (empty($user)) {\n session()->flash('err_msg','Your activation code is either expired or invalid, login here to re-validate.');\n return redirect()->to('/public/login');\n }\n else{\n $user->status=1;\n $user->token=null;\n $user->update();\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }\n }", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "public function activateAccount($token)\n {\n\n $user = Activation::where('code', $token)->get();\n\n if (count($user) == 0) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation = User::find($user[0]->user_id);\n\n if (empty($activation)) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation_update = Activation::findOrFail($user[0]->id);\n\n $activation_update->completed = 1;\n\n if ($activation_update->save()) {\n return Redirect::route('activate.app')->with(\n 'success',\n 'Cuenta activada correctamente'\n );\n //return response()->json(['status' => true, 'message' => \"Cuenta activada\", 'code' => 200]);\n } else {\n return redirect('register')->with(\n 'error',\n 'Error en activar cuenta'\n );\n //return response()->json(['status' => false, 'message' => \"Cuenta no activada\", 'code' => 200]);\n }\n }", "public static function activate() {\n\t\t\t// Do nothing\n\t\t}", "public function activate()\n {\n $this->isActive = true;\n return $this;\n }", "public function activate() : bool\n {\n if ($this->isActive()) {\n return true;\n }\n return $this->start();\n }", "public function activate() {\n global $wp_roles;\n\n if ( class_exists( 'WP_Roles' ) && ! isset( $wp_roles ) ) {\n // @codingStandardsIgnoreLine\n $wp_roles = new \\WP_Roles();\n }\n\n $all_cap = array(\n 'dokan_view_booking_menu',\n 'dokan_add_booking_product',\n 'dokan_edit_booking_product',\n 'dokan_delete_booking_product',\n 'dokan_manage_booking_products',\n 'dokan_manage_booking_calendar',\n 'dokan_manage_bookings',\n 'dokan_manage_booking_resource',\n );\n\n foreach ( $all_cap as $key => $cap ) {\n $wp_roles->add_cap( 'seller', $cap );\n $wp_roles->add_cap( 'administrator', $cap );\n $wp_roles->add_cap( 'shop_manager', $cap );\n }\n\n // flush rewrite rules after plugin is activate\n $this->flush_rewrite_rules();\n }", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "public function signupActivate($token)\n {\n $user = Usuario::where('activation_token', $token)->first();\n if (!$user) {\n return $this->sendError('Este token de activación no es válido.'); \n }\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n return $this->sendResponse($user->toArray(), 'Cuenta activada con éxito');\n }", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public function activate($username);", "function activate() {\r\r\n }", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "public function activate()\n {\n $uri = \"/api/v1/groups/rules/{$this->getId()}/lifecycle/activate\";\n $uri = $this->getDataStore()->buildUri(\n $this->getDataStore()->getOrganizationUrl() . $uri\n );\n return $this\n ->getDataStore()\n ->executeRequest('POST', $uri);\n }", "function activate()\n {\n if( $this->attribute( 'is_temporary' ) )\n {\n $this->setAttribute( 'is_temporary', 0 );\n\n $nextID = $this->getNewID();\n $this->setAttribute( 'order_nr', $nextID );\n $this->store();\n\n // Create an order status history element that matches the current status\n $this->createStatusHistory();\n }\n }", "public function activate() {\r\n \r\n $statement = ConnectionModel::getConnection()->query('Select * From user where id = :id and confirmToken = :confirmToken',\r\n ['id' => $this->_id,\r\n 'confirmToken' => $this->_confirmToken]);\r\n \r\n if($statement) {\r\n \r\n $activate = ConnectionModel::getConnection()->query('Update user set isConfirmed = 1 where id = :id', \r\n ['id' => $this->_id]);\r\n \r\n if($activate) {\r\n \r\n $user = ConnectionModel::getConnection()->query('Select * From user where id = :id', \r\n ['id' => $this->_id]);\r\n \r\n $result = new UserModel('','');\r\n $result->hydrate($user[0]);\r\n \r\n return $result;\r\n \r\n }\r\n \r\n }\r\n \r\n return false;\r\n \r\n}", "public static function activate($activate_token)\n\t{\n\t\t$token = new static(compact('activate_token'));\n\n\t\t$token->raise(new MemberWasActivated($token));\n\n\t\treturn $token;\n\t}", "public function executeActivateAccount(sfWebRequest $request)\n {\n $tkn = trim($request->getParameter('tk', ''));\n $usr = AppUserTable::getInstance()->findOneByRecoverToken($tkn);\n\n if ($usr) {\n \tif (!$usr->getEnabled()) {\n\t \t$usr->setRecoverToken(NULL);\n\t \t$usr->setEnabled(1);\n\t \t$usr->save();\n\n\t \tServiceAuthentication::startSessionProcess($usr);\n\t\n\t \t$this->getUser()->setFlash('activate', true);\t\n \t}\n }\n $this->redirect('home/index');\n }", "public function activate($id, $activation_code)\n {\n $user = $this->account()->activate($id, $activation_code);\n \n return redirect($this->redirectTo);\n/*\n return redirect(route('login'))->with('confirmation-success', trans('confirmation::confirmation.success'));\n*/\n }", "public function activate(){\r\n\t\t$id = $this->uri->segment(3);\r\n\t\t$code = $this->uri->segment(4);\r\n\r\n\t\t//fetch requests details\r\n\t\t$request = $this->requests_model->getRequestById($id);\r\n \r\n\r\n\t\t//if code matches\r\n\t\tif($request['code'] == $code){\r\n\t\t\t//update user active status\r\n\t\t\t// $data['activate'] = true;\r\n\t\t\t$query = $this->accounts_model->updateActivate($id);\r\n\r\n\t\t\tif($query){\r\n\r\n\t\t\t\t$row = $this->accounts_model->getCheckUser($request['email']);\r\n\r\n\t\t\t\t$this->session->set_userdata('is_user', $row['type']);\r\n\t\t\t\t$this->session->set_userdata('myName', \t$row['firstname'].\" \".$row['lastname']);\r\n\t\t\t\t$this->session->set_userdata('myEmail', $row['email']);\r\n\t\t\t\t$this->session->set_userdata('myId', \t$row['id']);\r\n\t\t\t\t$this->session->set_userdata('myRole', \t$row['role']);\r\n\r\n\t\t\t\t$this->session->set_flashdata('msg', 'User activated successfully');\r\n\t\t\t\tredirect('main');\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\t$this->session->set_flashdata('error_msg', 'Something went wrong in activating account');\r\n\t\t\t\tredirect('login'); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\t\t\t\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Cannot activate account. Code didnt match');\r\n\t\t\tredirect('login'); \r\n\t\t}\r\n \r\n\t}", "static function activate() {\n\t}", "public function activate(Request $request){\n $token = $request->get(\"token\", '');\n\n if ($token==\"default\") {\n $content['error'] = \"Please activate your account\";\n }\n elseif (!$this->activationTokenModel->activate($token)) {\n if ($this->activationTokenModel->hasError()) {\n $content['error'] = $this->activationTokenModel->errorToString();\n } else {\n $content['error'] = \"An unknown error prevented us from continue\";\n }\n } else {\n $acc = new AccountModel();\n $acc->redirectToLobby();\n }\n return $this->render($request, $content);\n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function againActivate(Request $request)\n {\n $template_html = 'mail.activate_user';\n\n $template_data = [\n 'url_activate' => url('http://localhost/sms_mkt/activated.php?key=' . encrypt($request->email) . '&user=' . $request->username),\n\n ];\n\n $user = new Users();\n $user->email = $request->email;\n\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ยืนยันตัวตน === Activate');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n return $this->responseRequestSuccess('Success!');\n }", "function activate($key)\n {\n // activate account\n $result = $this->user_model->activate_account($key);\n \n switch($result)\n {\n case 0: // If activation key not matched with any account\n $msg = 'No account is related with this activation key, either your account is already activated or key is expired !!!'; \n $type = \"danger\";\n break;\n \n case 1: // Account activated\n $msg = 'Congratulations, your account is activated now. Login here';\n $type = \"success\"; \n break;\n \n case 2: // Activation key expired\n $msg = 'Activation key expired, create new account.';\n $type = \"warning\";\n break; \n \n default:\n break;\n \n }\n\n // set notification message to show on page\n $this->base->set_message($msg, $type); \n \n $this->index();\n\n return true;\n }", "public function activateAccount($token) {\n $status = [\n 'approval_status' => 1,\n 'privilege' => 1\n ];\n\n $db = \\Config\\Database::connect();\n $builder = $db->table('users');\n\n return $builder->where('approval_token', $token)\n ->update($status);\n }", "public function testActivateBySuperAdmin(): void\n {\n // Login via super-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/3?token=' . $token);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data' =>\n [\n \"tenant_id\",\n \"outro_card\",\n \"active\",\n \"updated_at\",\n \"created_at\",\n \"id\",\n ],\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $success);\n $this->assertEquals(200, $code);\n $this->assertCount(6, $data);\n $this->assertEquals(3, $data['id']);\n $this->assertEquals(3, $data['tenant_id']);\n $this->assertEquals('outroCards/test3.mp4', $data['outro_card']);\n $this->assertEquals(false, $data['active']);\n $this->assertEquals('Status \"active\" was changed.', $message);\n }", "public function registerActivate($token)\n\t{\n\n\t $user = User::where('activation_token', $token)->first();\n\t if (!$user) {\n\t return response()->json([\n\t 'message' => 'This activation token is invalid.'\n\t ], 404);\n\t }\n\t $user->active = true;\n\t $user->activation_token = '';\n\t $user->save();\n\n\t return redirect('https://superwallet.herokuapp.com/verification');\n\n\t}", "public function activate($id)\n {\n User::withTrashed()->find($id)->restore();\n $user = User::find($id);\n\n /* revoke user from oauth */\n $client = Client::where('user_id', $id);\n $client_update = array('revoked' => false);\n $client->update($client_update);\n \n Mail::to($user->email)\n ->send(new UserActivated($user));\n\n return response()->json(['success' => 'OK']);\n }", "public function reActivationAction() {\n //get the container object\n $container = $this->container;\n //get the translator object\n $translator = $this->get('translator');\n //get the session object\n $session = $this->getRequest()->getSession();\n //check if we have a logged in user or company\n if (FALSE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n $session->getFlashBag()->set('note', $translator->trans('You need to Login first.'));\n return $this->redirect($this->generateUrl('login'));\n }\n\n //check if the user is already active\n if (TRUE === $this->get('security.context')->isGranted('ROLE_USER')) {\n //set a notice flag\n $session->getFlashBag()->set('notice', $translator->trans('Your acount is active.'));\n return $this->redirect($this->generateUrl('user_edit'));\n }\n\n //get the logedin user\n $user = $this->getUser();\n\n //prepare the body of the email\n $body = $this->renderView('ObjectsUserBundle:User:Emails\\activate_email.txt.twig', array('user' => $user));\n //prepare the message object\n $message = \\Swift_Message::newInstance()\n ->setSubject($translator->trans('activate your account'))\n ->setFrom($container->getParameter('mailer_user'))\n ->setTo($user->getEmail())\n ->setBody($body)\n ;\n //send the activation mail to the user\n $this->get('mailer')->send($message);\n //set the success flag in the session\n $session->getFlashBag()->set('success', $this->get('translator')->trans('check your email for your activation link'));\n //redirect the user to portal\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public static function activate()\n {\n // Do nothing\n }", "public function actionActivate($email, $activationKey)\r\n {\r\n if($this->module->activeAfterRegister) // If accounts do not need to be activated.\r\n {\r\n throw new \\yii\\web\\NotFoundHttpException(); // Hide this action.\r\n }\r\n \r\n if(!Yii::$app->user->isGuest) // Only guest can activate accounts.\r\n {\r\n // Redirect instead of throwing a 403, because logged user end up on this page quite often.\r\n $this->redirect($this->module->returnLogoutUrl, 302); // Temporary redirect.\r\n }\r\n \r\n $model= User::find()->where(['email' => $email])->one();\r\n \r\n if($model && (int)$model->status === User::STATUS_ACTIVE) // If the account is already active.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is already active.'));\r\n }\r\n else if($model->activation_key && $model->activation_key == $activationKey) // The activation data checked out.\r\n {\r\n $model->scenario = 'activation';\r\n $model->status = User::STATUS_ACTIVE;\r\n $model->save();\r\n \r\n // Notify the user that activation was sucessful.\r\n return $this->render('message', [\r\n 'model' => $model,\r\n 'message' => Yii::t(__CLASS__, 'Your account is now active. Please log in to start using the service.'),\r\n 'type' => 'success'\r\n ]);\r\n }\r\n else if($model && (int)$model->status !== User::STATUS_ACTIVE && ($model->activation_key == $activationKey)) // The account has been disabled.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is not active.'));\r\n }\r\n \r\n // The activation url was wrong.\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'Incorrect activation URL.'));\r\n }", "public function setActivateOn(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->activate_on = $var;\n }", "public function activateAccount($email){\n try{\n\n Mage::log(\"Trying to create new User Account with params: \" . print_r($email, 1));\n\n $response = $this->setUnauthorizedRequest()\n ->postMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT_ACTIVATE_ACCOUNT),\n Mage::helper('core')->jsonEncode(['email' => $email])\n )\n ->execute([parent::CREATED_HTTP_CODE, parent::SUCCESS_HTTP_CODE]);\n\n if($this->hasFailed()) {\n Mage::log(\"User account activation has failed\" . print_r($this->getInfo(),1));\n } else {\n Mage::log(\"Successfully user account activation.\");\n }\n return $response;\n\n }catch (Exception $e){\n Mage::log(\"User account activation has failed reason: \" . $e->getMessage());\n Mage::logException($e);\n return false;\n }\n }", "public function register_activation();", "public function activate()\n {\n return view('licenses.activate');\n }", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n return response()->json([\n 'message' => __('auth.token_invalid')\n ], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n //$user->notify(new SignupActivated($user));\n\n return $user;\n }", "public function activate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 1]);\n }\n\n $this->resetSelected();\n }", "function wporphanageex_activate() {\n\tglobal $wpdb;\n\n\t// set default role if not exist\n\tif ( ! get_option( 'wporphanageex_role' ) && get_option( 'default_role' ) ) {\n\t\tupdate_option( 'wporphanageex_role', get_option( 'default_role' ) );\n\t} else {\n\t\tupdate_option( 'wporphanageex_role', 'subscriber' );\n\t}\n\n\t// set default prefix if not exist\n\t$prefixes = array();\n\t$prefixes[] = $wpdb->prefix;\n\tif ( ! get_option( 'wporphanageex_prefixes' ) ) {\n\t\tupdate_option( 'wporphanageex_prefixes', $prefixes );\n\t}\n\n}", "public function activateAccount()\n {\n // Récupération des variables nécessaires à l'activation\n $email = $_GET['email'];\n $activation_key = $_GET['key'];\n // On active le compte\n $activation = $this->Members->activateAccount($email, $activation_key);\n\n // Préparation de la page\n $page = new Page(array(\n 'title' => 'Inscription réussie',\n 'class_body' => 'signin'\n ));\n // Rendu du contenu\n $variables = compact('activation');\n $content = $this->render('members/signin/validation.php', $variables);\n // Rendu de la page\n echo $page->render($content);\n }", "public static function activate() {\n\t\tadd_option( 'wpr_future_events' );\n\t}", "function activate()\n {\n if (empty($this->userID)) $this->error('No user is loaded', __LINE__);\n if ( $this->is_active()) $this->error('Allready active account', __LINE__);\n $res = $this->db->query(\"UPDATE \".$this->usertable.\" SET \".$this->user_active.\" = 1 \n\tWHERE \".$this->user_id.\" = '\".$this->escape($this->userID).\"' LIMIT 1\");\n if (@count($res) == 1)\n\t{\n\t\t$this->userData[$this->user_active] = true;\n\t\treturn true;\n\t}\n\treturn false;\n }", "public function markAsActivate() : bool\n {\n $this->is_active = 1;\n $this->paid = 1;\n //$this->grace_period_ends = new RawValue('NULL');\n $this->ends_at = null; //new rawValue('NULL');\n $this->next_due_payment = $this->ends_at;\n $this->is_cancelled = 0;\n return $this->update();\n }", "public function activateVersionPress()\n {\n $activateCommand = 'wp plugin activate versionpress';\n $this->exec($activateCommand);\n }", "public function activate($code)\n {\n if (Auth::check())\n {\n return Redirect::to('/');\n }\n\n\n $user = User::where('code', '=', $code)->where('active', '=', 0);\n\n if ($user->count())\n {\n $user = $user->first();\n\n //update user to active state\n $user->active = 1;\n $user->code = '';\n\n if ($user->save())\n {\n\n return Redirect::route('log')\n ->with('success', 'Your account is activated. Now you can sign in.');\n }\n }\n\n return Redirect::route('log')\n ->with('success', 'WE could not activate your account. Try again later.');\n\n }", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }", "public function subscribe(SubscribeRequest $request)\n {\n $subscribe = $this->subscription->findByEmail($request->input('email'));\n\n if($subscribe)\n {\n if(!$subscribe->activated_at)\n {\n alert()->warning('Cet email existe déjà');\n\n return redirect('/')->withInput()->with('resend', true);\n }\n\n $subscriptions = $subscribe->subscriptions->pluck('id')->all();\n\n if(in_array($request->input('newsletter_id'),$subscriptions))\n {\n alert()->warning('Vous êtes déjà inscrit à la newsletter');\n\n return redirect($request->input('return_path', '/'));\n }\n }\n else\n {\n // Subscribe user with activation token to website list and sync newsletter abos\n $subscribe = $this->subscription->create(['email' => $request->input('email'), 'activation_token' => md5($request->email.\\Carbon\\Carbon::now()) ]);\n }\n\n $subscribe->subscriptions()->attach($request->input('newsletter_id'));\n\n \\Mail::send('newsletter::Email.confirmation', array('token' => $subscribe->activation_token, 'newsletter_id' => $request->input('newsletter_id')), function($message) use ($subscribe)\n {\n $message->to($subscribe->email, $subscribe->email)->subject('Inscription!');\n });\n\n alert()->success('<strong>Merci pour votre inscription!</strong><br/>Veuillez confirmer votre adresse email en cliquant le lien qui vous a été envoyé par email');\n\n return redirect($request->input('return_path', '/'));\n }", "public function activateAction($key = '')\n {\n if ($key == '') throw new HttpException(400, \"Invalid user credentials. Please try again.\");\n\n $userInfo = $this->get('UserServices')->checkUserEmailMD5($key);\n\n if ( !$userInfo ) throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n\n if ($this->get('UserServices')->activateUsersAccount($userInfo['cu_id'])) {\n $message = $this->translator->trans('Your account is activated.');\n } else {\n throw new HttpException(422, $this->translator->trans('Your activation link has expired.'));\n }\n\n $result = array();\n $result['status'] = \"success\";\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public function activate($user_id, $email_key) {\n $activated = $this->authm->activate_user_account($user_id, $email_key);\n if($activated === TRUE) {\n $this->login($user_id, 2);\n redirect('/relationship');\n } else {\n if($activated === 1) {\n show_error($this->lang->line('auth_activate_error_1'));\n } else {\n show_error($this->lang->line('auth_activate_error_2'));\n }\n }\n }", "public function activate_backupset() {\n\n $backupset_id = $this->get_id();\n $query = \"UPDATE backupset set active=1 where id=:id\";\n $params = array(\"id\"=>$backupset_id);\n $result = $this->db->get_query_result($query, $params);\n $return_result = array(\"RESULT\"=>TRUE,\n \"MESSAGE\"=>\"Backupset \".$this->get_name() . \" successfully activated.\");\n\n return $return_result;\n }", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "public function activate_account($token) {\n $con['returnType'] = 'single';\n $con['conditions'] = array(\n 'token' => $token\n );\n $result = $this->Common_Model->getRows($con, 'wh_user_activations');\n if ($result) {\n\n $this->Common_Model->delete($con['conditions'], 'wh_user_activations');\n $this->session->set_flashdata('success', array('message' => 'Activated successfully. Please login.'));\n redirect('Site_Login/login_form');\n } else {\n $redirect = 'Site_Login/login_form';\n $this->error($redirect);\n }\n }", "public function activateAccount($token)\n {\n $logger = $this->getLogger();\n\n try {\n $result = $this->apiClient->httpPost('/v2/users', [\n 'activationToken' => $token,\n ]);\n\n $logger->info('Account activation attempt with token was successful');\n\n return true;\n } catch (ApiException $ex) {\n $logger->err($ex->getMessage());\n }\n\n $logger->info('Account activation attempt with token failed, or was already activated');\n\n return false;\n }", "protected function activateSelf() {}" ]
[ "0.6807843", "0.6767106", "0.65205956", "0.6504305", "0.63776153", "0.6334471", "0.631403", "0.631403", "0.631403", "0.6261604", "0.6229974", "0.6229974", "0.62122464", "0.619876", "0.6197827", "0.619014", "0.6184184", "0.6180788", "0.6162245", "0.61520815", "0.61448085", "0.61191565", "0.60990167", "0.60941356", "0.60640156", "0.6012938", "0.59872806", "0.59629416", "0.59629416", "0.5958832", "0.5928214", "0.5911282", "0.5871231", "0.5869707", "0.585906", "0.5850219", "0.5841413", "0.58204406", "0.5814369", "0.5786241", "0.57651645", "0.57543427", "0.5752598", "0.5740901", "0.5715779", "0.5715133", "0.5646162", "0.5637074", "0.56301975", "0.56249905", "0.56190264", "0.56147856", "0.56047374", "0.56047374", "0.5602845", "0.5599431", "0.5597464", "0.55924183", "0.55800927", "0.55762047", "0.55744195", "0.5573242", "0.55725694", "0.556359", "0.55614465", "0.55593", "0.55424565", "0.5537556", "0.55327123", "0.55301124", "0.5527014", "0.5517636", "0.5515743", "0.55070317", "0.549976", "0.5466201", "0.5466093", "0.5463663", "0.5442483", "0.54419684", "0.54255223", "0.5422876", "0.54148996", "0.5404593", "0.53872603", "0.5383396", "0.5364666", "0.5353237", "0.53398556", "0.53358364", "0.53231436", "0.5312919", "0.5305753", "0.5300763", "0.5282534", "0.52823216", "0.5281713", "0.52760303", "0.52729696", "0.526989" ]
0.64151543
4
Operation activateAsyncWithHttpInfo Activate Subscription
public function activateAsyncWithHttpInfo($id, $activate_subscription_request = null) { $returnType = '\OpenAPI\Client\Model\Payment'; $request = $this->activateRequest($id, $activate_subscription_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function activate($id, $activate_subscription_request = null)\n {\n list($response) = $this->activateWithHttpInfo($id, $activate_subscription_request);\n return $response;\n }", "public function activateAsync($id, $activate_subscription_request = null)\n {\n return $this->activateAsyncWithHttpInfo($id, $activate_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function activateWithHttpInfo($id, $activate_subscription_request = null)\n {\n $request = $this->activateRequest($id, $activate_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Payment' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Payment' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Payment', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Payment';\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 '\\OpenAPI\\Client\\Model\\Payment',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "public function activateAccountAsyncWithHttpInfo($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\AccountModel';\n $request = $this->activateAccountRequest($id, $x_avalara_client, $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 }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function activateAction($key = '')\n {\n if ($key == '') throw new HttpException(400, \"Invalid user credentials. Please try again.\");\n\n $userInfo = $this->get('UserServices')->checkUserEmailMD5($key);\n\n if ( !$userInfo ) throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n\n if ($this->get('UserServices')->activateUsersAccount($userInfo['cu_id'])) {\n $message = $this->translator->trans('Your account is activated.');\n } else {\n throw new HttpException(422, $this->translator->trans('Your activation link has expired.'));\n }\n\n $result = array();\n $result['status'] = \"success\";\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public function activated_subscription( $order ) {\n\n\t\t// set properties\n\t\t$properties = apply_filters( 'wc_kissmetrics_activated_subscription_properties',\n\t\t\tarray(\n\t\t\t\t'subscription_name' => WC_Subscriptions_Order::get_item_name( $order ),\n\t\t\t\t'total_initial_payment' => WC_Subscriptions_Order::get_total_initial_payment( $order ),\n\t\t\t\t'initial_sign_up_fee' => WC_Subscriptions_Order::get_sign_up_fee( $order ),\n\t\t\t\t'subscription_period' => WC_Subscriptions_Order::get_subscription_period( $order ),\n\t\t\t\t'subscription_interval' => WC_Subscriptions_Order::get_subscription_interval( $order ),\n\t\t\t\t'subscription_length' => WC_Subscriptions_Order::get_subscription_length( $order ),\n\t\t\t\t'subscription_trial_period' => WC_Subscriptions_Order::get_subscription_trial_period( $order ),\n\t\t\t\t'subscription_trial_length' => WC_Subscriptions_Order::get_subscription_trial_length( $order )\n\t\t\t), $order, $this\n\t\t);\n\n\t\t// record event\n\t\t$this->api_record_event( $this->event_name['activated_subscription'],\n\t\t\tarray(\n\t\t\t\t$this->property_name['subscription_name'] => $properties['subscription_name'],\n\t\t\t\t$this->property_name['total_initial_payment'] => $properties['total_initial_payment'],\n\t\t\t\t$this->property_name['initial_sign_up_fee'] => $properties['initial_sign_up_fee'],\n\t\t\t\t$this->property_name['subscription_period'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_interval'] => $properties['subscription_period'],\n\t\t\t\t$this->property_name['subscription_length'] => $properties['subscription_interval'],\n\t\t\t\t$this->property_name['subscription_trial_period'] => $properties['subscription_trial_period'],\n\t\t\t\t$this->property_name['subscription_trial_length'] => $properties['subscription_trial_length'],\n\t\t\t),\n\t\t\t$this->get_identity( $order->user_id )\n\t\t);\n\n\t}", "public function requestActivateAccount($tk)\n {\n $data = [\n 'path' => 'email-activate',\n 'token' => $tk\n ];\n \n $res = $this->postExternalRequest($data);\n \n return redirect('/login');\n \n }", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function activate($id)\n {\n // Get the resource\n $object = $this->find($id);\n\n // Make sure we can activate\n if (! $object->isActivationAllowed()) {\n $this->throwException($this->error('activation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('activating', [$object]);\n\n // Activate the resource\n $object->active = 1;\n $object->activated_at = Carbon::now();\n\n // Validate the resource\n if ($object->isInvalid('activating') || ! $object->save()) {\n $this->throwException($object->getErrors(), $this->error('activate'));\n }\n\n // Fire after listeners\n $this->eventFire('activated', [$object]);\n\n return $object;\n }", "public function activateAccountAsync($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n return $this->activateAccountAsyncWithHttpInfo($id, $x_avalara_client, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function activateAccount($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n list($response) = $this->activateAccountWithHttpInfo($id, $x_avalara_client, $body);\n return $response;\n }", "protected function activateAccountRequest($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activateAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function activate(){\r\n\t\t$id = $this->uri->segment(3);\r\n\t\t$code = $this->uri->segment(4);\r\n\r\n\t\t//fetch requests details\r\n\t\t$request = $this->requests_model->getRequestById($id);\r\n \r\n\r\n\t\t//if code matches\r\n\t\tif($request['code'] == $code){\r\n\t\t\t//update user active status\r\n\t\t\t// $data['activate'] = true;\r\n\t\t\t$query = $this->accounts_model->updateActivate($id);\r\n\r\n\t\t\tif($query){\r\n\r\n\t\t\t\t$row = $this->accounts_model->getCheckUser($request['email']);\r\n\r\n\t\t\t\t$this->session->set_userdata('is_user', $row['type']);\r\n\t\t\t\t$this->session->set_userdata('myName', \t$row['firstname'].\" \".$row['lastname']);\r\n\t\t\t\t$this->session->set_userdata('myEmail', $row['email']);\r\n\t\t\t\t$this->session->set_userdata('myId', \t$row['id']);\r\n\t\t\t\t$this->session->set_userdata('myRole', \t$row['role']);\r\n\r\n\t\t\t\t$this->session->set_flashdata('msg', 'User activated successfully');\r\n\t\t\t\tredirect('main');\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\t$this->session->set_flashdata('error_msg', 'Something went wrong in activating account');\r\n\t\t\t\tredirect('login'); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\t\t\t\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Cannot activate account. Code didnt match');\r\n\t\t\tredirect('login'); \r\n\t\t}\r\n \r\n\t}", "public function activate() {\n\n\t\t// Get License\n\t\t$license = $this->get_license();\n\n\t\ttry {\n\n\t\t\t// Check License key\n\t\t\tif ( '' === $license->get_key() ) {\n\t\t\t\tthrow new Exception( 'Please enter your license key.' );\n\t\t\t}\n\n\t\t\t// Check license email\n\t\t\tif ( '' === $license->get_email() ) {\n\t\t\t\tthrow new Exception( 'Please enter the email address associated with your license.' );\n\t\t\t}\n\n\t\t\t// Do activate request\n\t\t\t$request = wp_remote_get( self::STORE_URL . self::ENDPOINT_ACTIVATION . '&' . http_build_query( array(\n\t\t\t\t\t'email' => $license->get_email(),\n\t\t\t\t\t'licence_key' => $license->get_key(),\n\t\t\t\t\t'api_product_id' => $this->product_id,\n\t\t\t\t\t'request' => 'activate',\n\t\t\t\t\t'instance' => site_url()\n\t\t\t\t), '', '&' ) );\n\n\t\t\t// Check request\n\t\t\tif ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t}\n\n\t\t\t// Get activation result\n\t\t\t$activate_results = json_decode( wp_remote_retrieve_body( $request ), true );\n\n\t\t\t// Check if response is correct\n\t\t\tif ( ! empty( $activate_results['activated'] ) ) {\n\n\t\t\t\t// Set local activation status to true\n\t\t\t\t$license->set_status( 'active' );\n\t\t\t\t$this->set_license( $license );\n\n\t\t\t\t// Return Message\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'message' => __( 'License successfully activated.', 'download-monitor' )\n\t\t\t\t);\n\n\t\t\t} elseif ( $activate_results === false ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t} elseif ( isset( $activate_results['error_code'] ) ) {\n\t\t\t\tthrow new Exception( $activate_results['error'] );\n\t\t\t}\n\n\n\t\t} catch ( Exception $e ) {\n\n\t\t\t// Set local activation status to false\n\t\t\t$license->set_status( 'inactivate' );\n\t\t\t$this->set_license( $license );\n\n\t\t\t// Return error message\n\t\t\treturn array( 'result' => 'failed', 'message' => $e->getMessage() );\n\t\t}\n\t}", "public function activate() {\n add_option( 'wpb_js_composer_do_activation_redirect', true );\n }", "public function activateAction()\r\n {\r\n\t\tUser::activate($this->route_params['token']);\r\n\t\t\r\n\t\t$this->user = Auth::getUser();\r\n\r\n $this->redirect('/signup/activated');\r\n }", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "function simplenews_subscription_activate($snids, $status) {\n foreach (simplenews_subscriber_load_multiple($snids) as $subscriber) {\n $subscriber->activated = $status;\n simplenews_subscriber_save($subscriber);\n }\n}", "public function activate($id, $activation_code)\n {\n $user = $this->account()->activate($id, $activation_code);\n \n return redirect($this->redirectTo);\n/*\n return redirect(route('login'))->with('confirmation-success', trans('confirmation::confirmation.success'));\n*/\n }", "public function setActivateOn(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->activate_on = $var;\n }", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "public function activate() {\n\t\t/**\n\t\t * Fires when the plugin is being activated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_activate');\n\t}", "public function activateUser($request)\r\n {\r\n /*\r\n * When registration has done you must activate your account to log in.\r\n * (Application will show you message \"You must confirm account\")\r\n */\r\n\r\n\r\n /*\r\n * In database we want to set field IsActivated to '1'\r\n */\r\n $params = [\r\n 'IsActivated' => '1'\r\n ];\r\n\r\n /*\r\n * Update row in user table where Activativon ==$request['activation']<---\r\n */\r\n $this->primary = 'Activation';\r\n $this->update($request['activation'], $params);\r\n\r\n }", "public function activate($id)\n {\n User::withTrashed()->find($id)->restore();\n $user = User::find($id);\n\n /* revoke user from oauth */\n $client = Client::where('user_id', $id);\n $client_update = array('revoked' => false);\n $client->update($client_update);\n \n Mail::to($user->email)\n ->send(new UserActivated($user));\n\n return response()->json(['success' => 'OK']);\n }", "public function activateAccount($token)\n {\n\n $user = Activation::where('code', $token)->get();\n\n if (count($user) == 0) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation = User::find($user[0]->user_id);\n\n if (empty($activation)) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation_update = Activation::findOrFail($user[0]->id);\n\n $activation_update->completed = 1;\n\n if ($activation_update->save()) {\n return Redirect::route('activate.app')->with(\n 'success',\n 'Cuenta activada correctamente'\n );\n //return response()->json(['status' => true, 'message' => \"Cuenta activada\", 'code' => 200]);\n } else {\n return redirect('register')->with(\n 'error',\n 'Error en activar cuenta'\n );\n //return response()->json(['status' => false, 'message' => \"Cuenta no activada\", 'code' => 200]);\n }\n }", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "public function testActivateBySuperAdmin(): void\n {\n // Login via super-admin\n $token = $this->loginByEmail(self::SUPER_ADMIN[0], self::SUPER_ADMIN[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/3?token=' . $token);\n\n // Check response status\n $response->assertStatus(200);\n\n // Check response structure\n $response->assertJsonStructure(\n [\n 'success',\n 'code',\n 'data' =>\n [\n \"tenant_id\",\n \"outro_card\",\n \"active\",\n \"updated_at\",\n \"created_at\",\n \"id\",\n ],\n 'message'\n ]\n );\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n $data = $responseJSON['data']; // array\n\n $this->assertEquals(true, $success);\n $this->assertEquals(200, $code);\n $this->assertCount(6, $data);\n $this->assertEquals(3, $data['id']);\n $this->assertEquals(3, $data['tenant_id']);\n $this->assertEquals('outroCards/test3.mp4', $data['outro_card']);\n $this->assertEquals(false, $data['active']);\n $this->assertEquals('Status \"active\" was changed.', $message);\n }", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n $msg = __('auth.token_invalid');\n return ApiResponse::errorResponse('UNAUTHORIZED_ERROR', $msg, []);\n //return $this->errorResponse($msg,[]);\n //return response()->json([\n // 'message' => __('auth.token_invalid')\n //], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n $user->notify(new SignupActivated($user));\n $msg = __('auth.active_success');\n return ApiResponse::successResponse('SUCCESS', $msg, []);\n //return $this->successResponse($msg,$user);\n //return $user;\n }", "public function activate(Request $request){\n $token = $request->get(\"token\", '');\n\n if ($token==\"default\") {\n $content['error'] = \"Please activate your account\";\n }\n elseif (!$this->activationTokenModel->activate($token)) {\n if ($this->activationTokenModel->hasError()) {\n $content['error'] = $this->activationTokenModel->errorToString();\n } else {\n $content['error'] = \"An unknown error prevented us from continue\";\n }\n } else {\n $acc = new AccountModel();\n $acc->redirectToLobby();\n }\n return $this->render($request, $content);\n }", "public static function activate()\n {\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "function activate($key)\n {\n // activate account\n $result = $this->user_model->activate_account($key);\n \n switch($result)\n {\n case 0: // If activation key not matched with any account\n $msg = 'No account is related with this activation key, either your account is already activated or key is expired !!!'; \n $type = \"danger\";\n break;\n \n case 1: // Account activated\n $msg = 'Congratulations, your account is activated now. Login here';\n $type = \"success\"; \n break;\n \n case 2: // Activation key expired\n $msg = 'Activation key expired, create new account.';\n $type = \"warning\";\n break; \n \n default:\n break;\n \n }\n\n // set notification message to show on page\n $this->base->set_message($msg, $type); \n \n $this->index();\n\n return true;\n }", "public static function activate() {\n\n }", "public function activateAccountWithHttpInfo($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\AccountModel';\n $request = $this->activateAccountRequest($id, $x_avalara_client, $body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\AccountModel',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function activate()\n {\n $license = Licenses::find($this->key);\n $license->school_id = $this->auth_school_id;\n $license->activated_at = Carbon::now();\n $license->used=LICENCE_KEY_USED;\n if($license->save()){\n return $this->duration($license->duration);\n }\n return FALSE;\n }", "public function activateAccount()\n {\n // Récupération des variables nécessaires à l'activation\n $email = $_GET['email'];\n $activation_key = $_GET['key'];\n // On active le compte\n $activation = $this->Members->activateAccount($email, $activation_key);\n\n // Préparation de la page\n $page = new Page(array(\n 'title' => 'Inscription réussie',\n 'class_body' => 'signin'\n ));\n // Rendu du contenu\n $variables = compact('activation');\n $content = $this->render('members/signin/validation.php', $variables);\n // Rendu de la page\n echo $page->render($content);\n }", "public function actionActivate($email, $activationKey)\r\n {\r\n if($this->module->activeAfterRegister) // If accounts do not need to be activated.\r\n {\r\n throw new \\yii\\web\\NotFoundHttpException(); // Hide this action.\r\n }\r\n \r\n if(!Yii::$app->user->isGuest) // Only guest can activate accounts.\r\n {\r\n // Redirect instead of throwing a 403, because logged user end up on this page quite often.\r\n $this->redirect($this->module->returnLogoutUrl, 302); // Temporary redirect.\r\n }\r\n \r\n $model= User::find()->where(['email' => $email])->one();\r\n \r\n if($model && (int)$model->status === User::STATUS_ACTIVE) // If the account is already active.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is already active.'));\r\n }\r\n else if($model->activation_key && $model->activation_key == $activationKey) // The activation data checked out.\r\n {\r\n $model->scenario = 'activation';\r\n $model->status = User::STATUS_ACTIVE;\r\n $model->save();\r\n \r\n // Notify the user that activation was sucessful.\r\n return $this->render('message', [\r\n 'model' => $model,\r\n 'message' => Yii::t(__CLASS__, 'Your account is now active. Please log in to start using the service.'),\r\n 'type' => 'success'\r\n ]);\r\n }\r\n else if($model && (int)$model->status !== User::STATUS_ACTIVE && ($model->activation_key == $activationKey)) // The account has been disabled.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is not active.'));\r\n }\r\n \r\n // The activation url was wrong.\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'Incorrect activation URL.'));\r\n }", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "public function activate() {\n\t\t\n\t}", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "public function activateAccount($email){\n try{\n\n Mage::log(\"Trying to create new User Account with params: \" . print_r($email, 1));\n\n $response = $this->setUnauthorizedRequest()\n ->postMethod(\n $this->getRouteApiUrl(self::API_ENDPOINT_ACTIVATE_ACCOUNT),\n Mage::helper('core')->jsonEncode(['email' => $email])\n )\n ->execute([parent::CREATED_HTTP_CODE, parent::SUCCESS_HTTP_CODE]);\n\n if($this->hasFailed()) {\n Mage::log(\"User account activation has failed\" . print_r($this->getInfo(),1));\n } else {\n Mage::log(\"Successfully user account activation.\");\n }\n return $response;\n\n }catch (Exception $e){\n Mage::log(\"User account activation has failed reason: \" . $e->getMessage());\n Mage::logException($e);\n return false;\n }\n }", "public function activate($value)\n {\n if (is_string($value)) {\n $value = new JavaScriptFunction($value);\n }\n\n return $this->setProperty('activate', $value);\n }", "public function mailActivateAccount($params)\n {\n $this->mailer->accountActivation($params);\n }", "static function jitm_jetpack_woo_services_activate( $CTA ) {\n\t\treturn wp_nonce_url(\n\t\t\tadd_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'wc-services-action' => 'activate',\n\t\t\t\t),\n\t\t\t\tadmin_url( 'admin.php?page=wc-settings' )\n\t\t\t),\n\t\t\t'wc-services-install'\n\t\t);\n\t}", "public function activate()\n {\n $this->fireModelEvent('activating');\n\n $this->active = true;\n $result = $this->save();\n\n $this->fireModelEvent('activated');\n\n return $result;\n }", "public function againActivate(Request $request)\n {\n $template_html = 'mail.activate_user';\n\n $template_data = [\n 'url_activate' => url('http://localhost/sms_mkt/activated.php?key=' . encrypt($request->email) . '&user=' . $request->username),\n\n ];\n\n $user = new Users();\n $user->email = $request->email;\n\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ยืนยันตัวตน === Activate');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n return $this->responseRequestSuccess('Success!');\n }", "public function activate($entity)\n\t{\n\t\treturn $this->perform('activate', $entity, ['active' => 1], false);\n\t}", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function testCanActivateUser()\n {\n $user = factory(User::class)->create();\n $activation = $user->create_activation();\n $this->get('/api/v1/activate/'.$activation->token, ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $user->email,\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $user->email,\n 'activated' => true\n ]);\n $this->assertDatabaseMissing('user_activations', [\n 'email' => $user->email,\n ]);\n $this->assertTrue(Auth::user()->id == $user->id);\n }", "function activate() {\n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function activate();", "public function activate();", "public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order);", "public function actionActivate()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', [\n 'required' => true\n ]);\n $model = $this->findModel($username);\n $model->status = User::STATUS_ACTIVE;\n $model->removeEmailConfirmToken();\n $this->log($model->save());\n }", "public static function activate(){\n }", "public function executeActivateAccount(sfWebRequest $request)\n {\n $tkn = trim($request->getParameter('tk', ''));\n $usr = AppUserTable::getInstance()->findOneByRecoverToken($tkn);\n\n if ($usr) {\n \tif (!$usr->getEnabled()) {\n\t \t$usr->setRecoverToken(NULL);\n\t \t$usr->setEnabled(1);\n\t \t$usr->save();\n\n\t \tServiceAuthentication::startSessionProcess($usr);\n\t\n\t \t$this->getUser()->setFlash('activate', true);\t\n \t}\n }\n $this->redirect('home/index');\n }", "public function activateEndpoint($endpointId)\n {\n return $this->_ActivateEndpoint_operation->call(['endpointId' => $endpointId]);\n }", "public function activate(Request $request, $id)\n {\n $oCertConfig = SCertConfig::find($id);\n\n session('utils')->validateEdition($this->oCurrentUserPermission->privilege_id, $oCertConfig);\n\n $oCertConfig->is_deleted = \\Config::get('scsys.STATUS.ACTIVE');\n $oCertConfig->updated_by_id = \\Auth::user()->id;\n\n $errors = $oCertConfig->save();\n if (sizeof($errors) > 0)\n {\n return redirect()->back()->withInput($request->input())->withErrors($errors);\n }\n\n Flash::success(trans('messages.REG_ACTIVATED'))->important();\n\n return redirect()->route('qms.certconfigs.index', 0);\n }", "public function activate($value) {\n if (is_string($value)) {\n $value = new \\Kendo\\JavaScriptFunction($value);\n }\n\n return $this->setProperty('activate', $value);\n }", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "public function activate($locator){\n\t\t$activationkey = $this->request->get('id');\n\t\t\n\t\t$model = $this->_load('app')->model('users');\n\t\t$model->activate($activationkey);\n\t\t\n\t\t$this->response->setPartial('maincontent', 'user/activate', array('errmsg' => $model->getErrorMsg(' ')));\n\t\t\n\t}", "public static function activate($activate_token)\n\t{\n\t\t$token = new static(compact('activate_token'));\n\n\t\t$token->raise(new MemberWasActivated($token));\n\n\t\treturn $token;\n\t}", "public function activate(Request $request)\n {\n $token = $request->get('q');\n $userId = $request->get('u');\n\n $user = User::findOrFail($userId);\n\n if (! $user->activation()->first()->token === $token) {\n throw new NotFoundHttpException(\"Activation code not found\");\n }\n\n $user->activate();\n $request->session()->flash('activated', '');\n\n return view('auth.login');\n }", "function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}", "public function bookingActive()\n\t{\n\t\t$ch = new Curl();\n\t\t\n\t\t$this->headers['Authorization'] = 'Bearer ' . $this->authToken;\n\t\t\n\t\t$data = [];\n\t\t\n\t\treturn $ch->get(GojekID::BASE_ENDPOINT . Action::bookingActive, $data, $this->headers)->getResponse();\n\t}", "public function testActivateFailUserActive()\n {\n $user = $this->Users->get(1);\n\n $user->set('activation_key', $this->Users->generateActivationKey());\n\n $this->Users->save($user);\n\n $this->assertEquals(1, $user->active);\n\n $this->get('/users/activate/' . $user->email . '/' . $user->activation_key . '');\n\n $this->assertResponseSuccess();\n\n $this->assertRedirect('/login');\n\n $this->assertNotEmpty($_SESSION['Flash']['flash']['message']);\n $this->assertContains('error', $_SESSION['Flash']['flash']['element']);\n }", "public function signupActivate($token)\n {\n $user = Usuario::where('activation_token', $token)->first();\n if (!$user) {\n return $this->sendError('Este token de activación no es válido.'); \n }\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n return $this->sendResponse($user->toArray(), 'Cuenta activada con éxito');\n }", "public function activate($name,$token)\n {\n $user = public_users::where(['token'=> $token,'name'=>$name,'status'=>0])->first();\n $this->notification_lock($user->num_of_sends);\n if (empty($user)) {\n session()->flash('err_msg','Your activation code is either expired or invalid, login here to re-validate.');\n return redirect()->to('/public/login');\n }\n else{\n $user->status=1;\n $user->token=null;\n $user->update();\n session()->flash('success_msg','Congratulations! your account is now activated.');\n return redirect()->to('/public/login');\n }\n }", "static public function tryToActivateAccount() {\r\n\t\tDB::getInstance()->stopAddingAccountID();\r\n\t\t$Account = DB::getInstance()->query('SELECT id FROM `'.PREFIX.'account` WHERE `activation_hash`='.DB::getInstance()->escape($_GET['activate']).' LIMIT 1')->fetch();\r\n\t\tDB::getInstance()->startAddingAccountID();\r\n\r\n\t\tif ($Account) {\r\n\t\t\tDB::getInstance()->update('account', $Account['id'], 'activation_hash', '');\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public function activate($username);", "static public function activateScript($script, $deactivate = false,\n $additional = array())\n {\n $transport = self::getTransport();\n\n try {\n $transport->setScriptActive($script, $additional);\n } catch (Ingo_Exception $e) {\n $msg = ($deactivate)\n ? _(\"There was an error deactivating the script.\")\n : _(\"There was an error activating the script.\");\n $GLOBALS['notification']->push($msg . ' ' . _(\"The driver said: \") . $e->getMessage(), 'horde.error');\n return false;\n }\n\n $msg = ($deactivate)\n ? _(\"Script successfully deactivated.\")\n : _(\"Script successfully activated.\");\n $GLOBALS['notification']->push($msg, 'horde.success');\n\n return true;\n }", "public function activateByKey(\n $activationKey\n ) {\n if (!$this->modifyByKey($activationKey, 0)) {\n return false;\n }\n\n $this->getLogManager()->createActivatedBySubscriber($this->getSubscriber());\n\n return true;\n }", "public function crceTariffChangeActivateTariffSubscriptionWithHttpInfo($subscription_id, $tariff_id, $correlation_id = null, $transaction_id = null, $user = null)\n {\n // verify the required parameter 'subscription_id' is set\n if ($subscription_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $subscription_id when calling crceTariffChangeActivateTariffSubscription');\n }\n // verify the required parameter 'tariff_id' is set\n if ($tariff_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $tariff_id when calling crceTariffChangeActivateTariffSubscription');\n }\n // parse inputs\n $resourcePath = \"/subscriptions/{subscriptionId}/availableTariffs/{tariffId}/activate\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n // header params\n if ($correlation_id !== null) {\n $headerParams['correlationId'] = $this->apiClient->getSerializer()->toHeaderValue($correlation_id);\n }\n // header params\n if ($transaction_id !== null) {\n $headerParams['transactionId'] = $this->apiClient->getSerializer()->toHeaderValue($transaction_id);\n }\n // header params\n if ($user !== null) {\n $headerParams['user'] = $this->apiClient->getSerializer()->toHeaderValue($user);\n }\n // path params\n if ($subscription_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"subscriptionId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($subscription_id),\n $resourcePath\n );\n }\n // path params\n if ($tariff_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"tariffId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($tariff_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('accessKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['accessKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'POST',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\iNew\\Rest6_1\\Model\\TariffChangeResponse',\n '/subscriptions/{subscriptionId}/availableTariffs/{tariffId}/activate'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\iNew\\Rest6_1\\Model\\TariffChangeResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\TariffChangeResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 500:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\iNew\\Rest6_1\\Model\\RestError', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function reActivationAction() {\n //get the container object\n $container = $this->container;\n //get the translator object\n $translator = $this->get('translator');\n //get the session object\n $session = $this->getRequest()->getSession();\n //check if we have a logged in user or company\n if (FALSE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n $session->getFlashBag()->set('note', $translator->trans('You need to Login first.'));\n return $this->redirect($this->generateUrl('login'));\n }\n\n //check if the user is already active\n if (TRUE === $this->get('security.context')->isGranted('ROLE_USER')) {\n //set a notice flag\n $session->getFlashBag()->set('notice', $translator->trans('Your acount is active.'));\n return $this->redirect($this->generateUrl('user_edit'));\n }\n\n //get the logedin user\n $user = $this->getUser();\n\n //prepare the body of the email\n $body = $this->renderView('ObjectsUserBundle:User:Emails\\activate_email.txt.twig', array('user' => $user));\n //prepare the message object\n $message = \\Swift_Message::newInstance()\n ->setSubject($translator->trans('activate your account'))\n ->setFrom($container->getParameter('mailer_user'))\n ->setTo($user->getEmail())\n ->setBody($body)\n ;\n //send the activation mail to the user\n $this->get('mailer')->send($message);\n //set the success flag in the session\n $session->getFlashBag()->set('success', $this->get('translator')->trans('check your email for your activation link'));\n //redirect the user to portal\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public function activate(){\r\n\t\t$uid = $_GET[\"uid\"];\r\n\t\t$hash = $_GET[\"hash\"];\r\n\r\n\t\tif(User::activateUser($uid, $hash)){\r\n\t\t\techo \"active\";\r\n\t\t\tUser::loginSystem(User::fromUid($uid));\r\n\t\t}\r\n\t\tPage::redirect(\"/index\");\r\n\t}", "function activate() {\r\r\n }", "public function activate()\n {\n $this->isActive = true;\n return $this;\n }", "public function activateUser($activateCode, UserRepositoryInterface $userRepository)\n {\n try{\n if($userRepository->UserCountWithActivateCode($activateCode) > 0){\n $user = $userRepository->getUserFromActivateCode($activateCode);\n $userRepository->activateUser($user);\n }\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private function activateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n else \n $uid = userid();\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n $videoid = $request['videoid'];\n\n $vdetails = $cbvid->get_video_details($videoid);\n\n if(!isset($vdetails['videoid']))\n throw_error_msg(\"video does not exist\");\n\n if($vdetails['userid']!=$uid && !has_access('admin_access',true) )\n throw_error_msg(\"you have not rights to activate this video\");\n\n $cbvid->action('activate',$videoid);\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"video has been activated successfully\");\n $this->response($this->json($data));\n }\n else\n {\n throw_error_msg(\"There was some thing wrong to activate video\"); \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function activate()\n {\n return view('licenses.activate');\n }", "public function activate_user() {\n global $database;\n $sql = \"UPDATE user SET is_active = 1 WHERE id = \";\n $sql .= $database->escape_value($this->id);\n $database->query($sql);\n }", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function activate($id) {\n $this->authorize('activate', $this->model);\n $this->model->activateUser($id);\n Controller::FlashMessages('The user has been activated', 'success');\n return redirect('/users');\n }", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n return response()->json([\n 'message' => __('auth.token_invalid')\n ], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n //$user->notify(new SignupActivated($user));\n\n return $user;\n }", "public function activate( Activator $activator_object ) {\n\t\t$activator_object->activate(\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\tnew Booking_Custom_Post( $this->initial_values->get_booking_custom_post_type_values() )\n\t\t\t]\n\t\t);\n\t}", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }" ]
[ "0.7151073", "0.6834833", "0.6807276", "0.6145896", "0.60893285", "0.59633756", "0.5814374", "0.56491", "0.564101", "0.5630786", "0.56085515", "0.5566156", "0.55550313", "0.55365723", "0.5529781", "0.5529781", "0.5517866", "0.5516164", "0.55137", "0.5501009", "0.5495675", "0.5491804", "0.5463513", "0.5446139", "0.5398455", "0.539132", "0.53732616", "0.5372828", "0.5354493", "0.5353984", "0.53538626", "0.5342739", "0.53372097", "0.5308335", "0.53054386", "0.5292902", "0.5267328", "0.5260327", "0.5252344", "0.5234171", "0.5234171", "0.5234171", "0.5231221", "0.5223444", "0.5215058", "0.5183839", "0.5164663", "0.51595324", "0.5158536", "0.5154883", "0.51391685", "0.51355976", "0.5129745", "0.5122384", "0.51022005", "0.50933677", "0.5092685", "0.5085607", "0.5071046", "0.50699097", "0.5058691", "0.50551873", "0.5050835", "0.50272423", "0.5024061", "0.5024061", "0.5014991", "0.5012423", "0.50075656", "0.500266", "0.5001477", "0.500111", "0.4998766", "0.49875993", "0.49756265", "0.49734625", "0.49563164", "0.4947688", "0.493137", "0.492469", "0.49150994", "0.4914192", "0.48876527", "0.4871344", "0.48630038", "0.48616678", "0.48603716", "0.48574144", "0.4849317", "0.48431385", "0.48410332", "0.48406562", "0.48382044", "0.48351628", "0.48215663", "0.48159972", "0.4810449", "0.4809496", "0.4808311", "0.48053125" ]
0.7096003
1
Create request for operation 'activate'
public function activateRequest($id, $activate_subscription_request = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling activate' ); } $resourcePath = '/subscriptions/{id}/activate'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($activate_subscription_request)) { if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request)); } else { $httpBody = $activate_subscription_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registerAndActivateUserRequest()\n {\n $this->registerUserRequest();\n\n return $this->get('/api/v2/user/activate/' . User::first()->activation_key);\n }", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public function activateAction()\r\n {\r\n\t\tUser::activate($this->route_params['token']);\r\n\t\t\r\n\t\t$this->user = Auth::getUser();\r\n\r\n $this->redirect('/signup/activated');\r\n }", "public function activate() {\n\t\t\n\t}", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate();", "public function activate();", "public function activateUser($request)\r\n {\r\n /*\r\n * When registration has done you must activate your account to log in.\r\n * (Application will show you message \"You must confirm account\")\r\n */\r\n\r\n\r\n /*\r\n * In database we want to set field IsActivated to '1'\r\n */\r\n $params = [\r\n 'IsActivated' => '1'\r\n ];\r\n\r\n /*\r\n * Update row in user table where Activativon ==$request['activation']<---\r\n */\r\n $this->primary = 'Activation';\r\n $this->update($request['activation'], $params);\r\n\r\n }", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "public function requestActivateAccount($tk)\n {\n $data = [\n 'path' => 'email-activate',\n 'token' => $tk\n ];\n \n $res = $this->postExternalRequest($data);\n \n return redirect('/login');\n \n }", "public static function activate() {\n\n }", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public static function activate()\n {\n }", "public function activate() {\n\n\t\t// Get License\n\t\t$license = $this->get_license();\n\n\t\ttry {\n\n\t\t\t// Check License key\n\t\t\tif ( '' === $license->get_key() ) {\n\t\t\t\tthrow new Exception( 'Please enter your license key.' );\n\t\t\t}\n\n\t\t\t// Check license email\n\t\t\tif ( '' === $license->get_email() ) {\n\t\t\t\tthrow new Exception( 'Please enter the email address associated with your license.' );\n\t\t\t}\n\n\t\t\t// Do activate request\n\t\t\t$request = wp_remote_get( self::STORE_URL . self::ENDPOINT_ACTIVATION . '&' . http_build_query( array(\n\t\t\t\t\t'email' => $license->get_email(),\n\t\t\t\t\t'licence_key' => $license->get_key(),\n\t\t\t\t\t'api_product_id' => $this->product_id,\n\t\t\t\t\t'request' => 'activate',\n\t\t\t\t\t'instance' => site_url()\n\t\t\t\t), '', '&' ) );\n\n\t\t\t// Check request\n\t\t\tif ( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t}\n\n\t\t\t// Get activation result\n\t\t\t$activate_results = json_decode( wp_remote_retrieve_body( $request ), true );\n\n\t\t\t// Check if response is correct\n\t\t\tif ( ! empty( $activate_results['activated'] ) ) {\n\n\t\t\t\t// Set local activation status to true\n\t\t\t\t$license->set_status( 'active' );\n\t\t\t\t$this->set_license( $license );\n\n\t\t\t\t// Return Message\n\t\t\t\treturn array(\n\t\t\t\t\t'result' => 'success',\n\t\t\t\t\t'message' => __( 'License successfully activated.', 'download-monitor' )\n\t\t\t\t);\n\n\t\t\t} elseif ( $activate_results === false ) {\n\t\t\t\tthrow new Exception( 'Connection failed to the License Key API server. Try again later.' );\n\t\t\t} elseif ( isset( $activate_results['error_code'] ) ) {\n\t\t\t\tthrow new Exception( $activate_results['error'] );\n\t\t\t}\n\n\n\t\t} catch ( Exception $e ) {\n\n\t\t\t// Set local activation status to false\n\t\t\t$license->set_status( 'inactivate' );\n\t\t\t$this->set_license( $license );\n\n\t\t\t// Return error message\n\t\t\treturn array( 'result' => 'failed', 'message' => $e->getMessage() );\n\t\t}\n\t}", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function actionActivate()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', [\n 'required' => true\n ]);\n $model = $this->findModel($username);\n $model->status = User::STATUS_ACTIVE;\n $model->removeEmailConfirmToken();\n $this->log($model->save());\n }", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "public static function activate(){\n }", "public function activate(Request $request){\n $token = $request->get(\"token\", '');\n\n if ($token==\"default\") {\n $content['error'] = \"Please activate your account\";\n }\n elseif (!$this->activationTokenModel->activate($token)) {\n if ($this->activationTokenModel->hasError()) {\n $content['error'] = $this->activationTokenModel->errorToString();\n } else {\n $content['error'] = \"An unknown error prevented us from continue\";\n }\n } else {\n $acc = new AccountModel();\n $acc->redirectToLobby();\n }\n return $this->render($request, $content);\n }", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "function activate() {\n }", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "public function activateRequest($token)\n {\n $this->load->model('Useraccount_model');\n $dataValues = array(\n 'token' => $token,\n );\n\n $result = $this->Request_model->activateRequest($dataValues);\n if (!empty($result))\n {\n //$this->session->set_flashdata('request_operation_message', lang('activation_success_message'));\n // TODO : transpose this in admin (or cron) $this->commonlibrary->sendrequestmail($result);\n $this->commonlibrary->sendrequestmail($result);\n redirect(base_url() . 'request-activated/' . $token);\n }\n else\n {\n $this->session->set_flashdata('user_operation_message_error', lang('request_activation_error_message'));\n redirect(base_url() . 'my-requests');\n }\n }", "public function activate(){\r\n\t\t$id = $this->uri->segment(3);\r\n\t\t$code = $this->uri->segment(4);\r\n\r\n\t\t//fetch requests details\r\n\t\t$request = $this->requests_model->getRequestById($id);\r\n \r\n\r\n\t\t//if code matches\r\n\t\tif($request['code'] == $code){\r\n\t\t\t//update user active status\r\n\t\t\t// $data['activate'] = true;\r\n\t\t\t$query = $this->accounts_model->updateActivate($id);\r\n\r\n\t\t\tif($query){\r\n\r\n\t\t\t\t$row = $this->accounts_model->getCheckUser($request['email']);\r\n\r\n\t\t\t\t$this->session->set_userdata('is_user', $row['type']);\r\n\t\t\t\t$this->session->set_userdata('myName', \t$row['firstname'].\" \".$row['lastname']);\r\n\t\t\t\t$this->session->set_userdata('myEmail', $row['email']);\r\n\t\t\t\t$this->session->set_userdata('myId', \t$row['id']);\r\n\t\t\t\t$this->session->set_userdata('myRole', \t$row['role']);\r\n\r\n\t\t\t\t$this->session->set_flashdata('msg', 'User activated successfully');\r\n\t\t\t\tredirect('main');\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\t$this->session->set_flashdata('error_msg', 'Something went wrong in activating account');\r\n\t\t\t\tredirect('login'); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\t\t\t\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Cannot activate account. Code didnt match');\r\n\t\t\tredirect('login'); \r\n\t\t}\r\n \r\n\t}", "public function activate($entity)\n\t{\n\t\treturn $this->perform('activate', $entity, ['active' => 1], false);\n\t}", "public function executeActivateAccount(sfWebRequest $request)\n {\n $tkn = trim($request->getParameter('tk', ''));\n $usr = AppUserTable::getInstance()->findOneByRecoverToken($tkn);\n\n if ($usr) {\n \tif (!$usr->getEnabled()) {\n\t \t$usr->setRecoverToken(NULL);\n\t \t$usr->setEnabled(1);\n\t \t$usr->save();\n\n\t \tServiceAuthentication::startSessionProcess($usr);\n\t\n\t \t$this->getUser()->setFlash('activate', true);\t\n \t}\n }\n $this->redirect('home/index');\n }", "function activate() {\r\r\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "static function activate() {\n\t}", "public function againActivate(Request $request)\n {\n $template_html = 'mail.activate_user';\n\n $template_data = [\n 'url_activate' => url('http://localhost/sms_mkt/activated.php?key=' . encrypt($request->email) . '&user=' . $request->username),\n\n ];\n\n $user = new Users();\n $user->email = $request->email;\n\n Mail::send($template_html, $template_data, function ($msg) use ($user) {\n $msg->subject('ยืนยันตัวตน === Activate');\n $msg->to([$user->email]);\n $msg->from('[email protected]', 'ClickNext');\n });\n return $this->responseRequestSuccess('Success!');\n }", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "function activate ()\n\t{\n\t\tswitch ($this->getAction ())\n\t\t{\n\t\t\tcase 'modifyUser':\n\t\t\t\tif ($this->getUserName () == 'test')\n\t\t\t\t{\n\t\t\t\t\tdie ('not allowed for test user');\n\t\t\t\t}\n\t\t\t\t$checkPasswd = true;\n\t\t\t\t$user = $this->itemFactory->requestToUser ($checkPasswd);\n\t\t\t\t$this->operations->modifyUser ($this->getUserName(), $user);\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "#[Route('post', 'api/repo/{username}/{repo_name}/activate')]\n public function activate(...$args): void\n {\n list($username, $repo) = $args;\n }", "public function activate($locator){\n\t\t$activationkey = $this->request->get('id');\n\t\t\n\t\t$model = $this->_load('app')->model('users');\n\t\t$model->activate($activationkey);\n\t\t\n\t\t$this->response->setPartial('maincontent', 'user/activate', array('errmsg' => $model->getErrorMsg(' ')));\n\t\t\n\t}", "public function activar(Request $request){\n \t$exito = 0;\n \t$msg = Lang::get ( 'general.error' );\n \ttry{\n \t\t$id = $request->get('idPrueba');\n \t\tif((int) $id > 0){\n \t\t\t$this->pruebaRepository->activaPrueba($id);\n \t\t\t$exito = 1;\n \t\t\t$msg = Lang::get ( 'general.success' );\n \t\t}\n \t}\n \tcatch (\\Exception $e) {\n $this->log->error($e);\n \t}\n \tfinally {\n \t\treturn json_encode(array('exito' => $exito,'msg' => $msg));\n \t} \n }", "public function testActivateForGuest(): void\n {\n // Request\n $response = $this->put('api/v1/outroCards/activate/1');\n\n // Check response status\n $response->assertStatus(401);\n }", "public function testCanActivateUser()\n {\n $user = factory(User::class)->create();\n $activation = $user->create_activation();\n $this->get('/api/v1/activate/'.$activation->token, ['HTTP_X-Requested-With' => 'XMLHttpRequest'])\n ->assertJson([\n 'user' => [\n 'name' => $user->name,\n 'email' => $user->email,\n ]\n ]);\n $this->assertDatabaseHas('users', [\n 'name' => $user->name,\n 'email' => $user->email,\n 'activated' => true\n ]);\n $this->assertDatabaseMissing('user_activations', [\n 'email' => $user->email,\n ]);\n $this->assertTrue(Auth::user()->id == $user->id);\n }", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "public function activateAction($key = '')\n {\n if ($key == '') throw new HttpException(400, \"Invalid user credentials. Please try again.\");\n\n $userInfo = $this->get('UserServices')->checkUserEmailMD5($key);\n\n if ( !$userInfo ) throw new HttpException(400, $this->translator->trans('Invalid user credentials. Please try again.'));\n\n if ($this->get('UserServices')->activateUsersAccount($userInfo['cu_id'])) {\n $message = $this->translator->trans('Your account is activated.');\n } else {\n throw new HttpException(422, $this->translator->trans('Your activation link has expired.'));\n }\n\n $result = array();\n $result['status'] = \"success\";\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }", "public static function activation() {\n /*Activation functions here*/\n\n }", "function activate()\n {\n if( $this->attribute( 'is_temporary' ) )\n {\n $this->setAttribute( 'is_temporary', 0 );\n\n $nextID = $this->getNewID();\n $this->setAttribute( 'order_nr', $nextID );\n $this->store();\n\n // Create an order status history element that matches the current status\n $this->createStatusHistory();\n }\n }", "public function sendActivation()\n\t{\n\t}", "public static function activate($activate_token)\n\t{\n\t\t$token = new static(compact('activate_token'));\n\n\t\t$token->raise(new MemberWasActivated($token));\n\n\t\treturn $token;\n\t}", "function activate($key)\n {\n // activate account\n $result = $this->user_model->activate_account($key);\n \n switch($result)\n {\n case 0: // If activation key not matched with any account\n $msg = 'No account is related with this activation key, either your account is already activated or key is expired !!!'; \n $type = \"danger\";\n break;\n \n case 1: // Account activated\n $msg = 'Congratulations, your account is activated now. Login here';\n $type = \"success\"; \n break;\n \n case 2: // Activation key expired\n $msg = 'Activation key expired, create new account.';\n $type = \"warning\";\n break; \n \n default:\n break;\n \n }\n\n // set notification message to show on page\n $this->base->set_message($msg, $type); \n \n $this->index();\n\n return true;\n }", "public function activate($username);", "public function reActivationAction() {\n //get the container object\n $container = $this->container;\n //get the translator object\n $translator = $this->get('translator');\n //get the session object\n $session = $this->getRequest()->getSession();\n //check if we have a logged in user or company\n if (FALSE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n $session->getFlashBag()->set('note', $translator->trans('You need to Login first.'));\n return $this->redirect($this->generateUrl('login'));\n }\n\n //check if the user is already active\n if (TRUE === $this->get('security.context')->isGranted('ROLE_USER')) {\n //set a notice flag\n $session->getFlashBag()->set('notice', $translator->trans('Your acount is active.'));\n return $this->redirect($this->generateUrl('user_edit'));\n }\n\n //get the logedin user\n $user = $this->getUser();\n\n //prepare the body of the email\n $body = $this->renderView('ObjectsUserBundle:User:Emails\\activate_email.txt.twig', array('user' => $user));\n //prepare the message object\n $message = \\Swift_Message::newInstance()\n ->setSubject($translator->trans('activate your account'))\n ->setFrom($container->getParameter('mailer_user'))\n ->setTo($user->getEmail())\n ->setBody($body)\n ;\n //send the activation mail to the user\n $this->get('mailer')->send($message);\n //set the success flag in the session\n $session->getFlashBag()->set('success', $this->get('translator')->trans('check your email for your activation link'));\n //redirect the user to portal\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public function register_activation();", "protected function activateAccountRequest($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activateAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json-patch+json', 'application/json', 'text/json', 'application/_*+json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function activate($id, $activate_subscription_request = null)\n {\n list($response) = $this->activateWithHttpInfo($id, $activate_subscription_request);\n return $response;\n }", "private function activateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n else \n $uid = userid();\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n $videoid = $request['videoid'];\n\n $vdetails = $cbvid->get_video_details($videoid);\n\n if(!isset($vdetails['videoid']))\n throw_error_msg(\"video does not exist\");\n\n if($vdetails['userid']!=$uid && !has_access('admin_access',true) )\n throw_error_msg(\"you have not rights to activate this video\");\n\n $cbvid->action('activate',$videoid);\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"video has been activated successfully\");\n $this->response($this->json($data));\n }\n else\n {\n throw_error_msg(\"There was some thing wrong to activate video\"); \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function reactivateAction()\n {\n $this->reactivateParameters = $this->reactivateParameters + $this->_reactivateExtraParameters;\n\n parent::reactivateAction();\n }", "public function toggleActivate(Request $request)\n {\n// $element = new $className();\n// $element = $element->withoutGlobalScopes()->whereId($request->id)->first();\n $element = Currency::whereId($request->id)->first();\n $element->update([\n 'active' => !$element->active\n ]);\n return redirect()->back()->with('success', 'Process Success');\n }", "public function createRequest();", "public function createRequest();", "public function activate() {\n add_option( 'wpb_js_composer_do_activation_redirect', true );\n }", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public function activate() {\r\n \r\n $statement = ConnectionModel::getConnection()->query('Select * From user where id = :id and confirmToken = :confirmToken',\r\n ['id' => $this->_id,\r\n 'confirmToken' => $this->_confirmToken]);\r\n \r\n if($statement) {\r\n \r\n $activate = ConnectionModel::getConnection()->query('Update user set isConfirmed = 1 where id = :id', \r\n ['id' => $this->_id]);\r\n \r\n if($activate) {\r\n \r\n $user = ConnectionModel::getConnection()->query('Select * From user where id = :id', \r\n ['id' => $this->_id]);\r\n \r\n $result = new UserModel('','');\r\n $result->hydrate($user[0]);\r\n \r\n return $result;\r\n \r\n }\r\n \r\n }\r\n \r\n return false;\r\n \r\n}", "public static function activate() {\n\t\t\t// Do nothing\n\t\t}", "public function activate()\n {\n $this->fireModelEvent('activating');\n\n $this->active = true;\n $result = $this->save();\n\n $this->fireModelEvent('activated');\n\n return $result;\n }", "public function reActivate()\n {\n $response = $this->response();\n $config = [\n ['field' => 'userid', 'label' => '', 'rules' => 'trim|required|integer'],\n ['field' => 'activationemail', 'label' => '', 'rules' => 'trim|required|min_length[4]|max_length[100]|valid_email']\n ];\n $this->form_validation->set_rules($config);\n if ($this->form_validation->run() === false) {\n $response[\"errors\"] = $this->form_validation->error_array();\n $this->output->set_output(json_encode($response));\n return false;\n }\n $userID = $this->input->post('userid');\n $email = $this->input->post('activationemail');\n if ($this->oauth_web->reActivate($userID, $email) === true) {\n $response[\"status\"] = true;\n $response[\"msg\"] = $this->lang->line(\"reActivate_ok\");\n }\n $this->output->set_output(json_encode($response));\n }", "function generate_activate_button()\n\t{\n\t\tlog_message('debug', 'Account/generate_activate_button');\n\t\t$data = filter_forwarded_data($this);\n\n \t\t$data['bank_links'] = array();\n\n \t\tlog_message('debug', 'Account/generate_activate_button:: [1] post='.json_encode($_POST));\n \t\tif(!empty($_POST['bankname__banks'])){\n\n \t\t\tforeach($_POST['bankname__banks'] As $enteredBank){\n \t\t\t\tif($enteredBank!= ''){\n \t\t\t\t\t$result = $this->_api->get('money/banks', array('offset'=>0, 'limit'=>'1', 'phrase'=>$enteredBank));\n \t\t\t\t\tif($result){\n \t\t\t\t\t\tforeach($result As $bank){\n \t\t\t\t\t\t\t$link = base_url().\"account/show_bank_login/i/\".encrypt_value($bank['bank_id']).\"/n/\".encrypt_value($bank['bank_name']).\"/c/\".encrypt_value($bank['bank_code']);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tarray_push($data['bank_links'], $link);\n \t\t\t\t\t} else {\n \t\t\t\t\t\tarray_push($data['bank_links'], \"\");\n \t\t\t\t\t}\n\n \t\t\t\t}\n \t\t\t}\n\t\t\techo json_encode($data['bank_links']);\n\n \t\t}else echo format_notice($this, \"ERROR: The bank you have provided do not match. Please try again.\");\n\n\t}", "public function activateAccount()\n {\n // Récupération des variables nécessaires à l'activation\n $email = $_GET['email'];\n $activation_key = $_GET['key'];\n // On active le compte\n $activation = $this->Members->activateAccount($email, $activation_key);\n\n // Préparation de la page\n $page = new Page(array(\n 'title' => 'Inscription réussie',\n 'class_body' => 'signin'\n ));\n // Rendu du contenu\n $variables = compact('activation');\n $content = $this->render('members/signin/validation.php', $variables);\n // Rendu de la page\n echo $page->render($content);\n }", "public function testActivateByTenantAdmin(): void\n {\n // Login via tenant-admin\n $token = $this->loginByEmail(self::TENANT_ADMIN_2[0], self::TENANT_ADMIN_2[1]);\n\n // Request\n $response = $this->put('api/v1/outroCards/activate/3?token=' . $token);\n\n // Check response status\n $response->assertStatus(403);\n\n $responseJSON = json_decode($response->getContent(), true);\n $success = $responseJSON['success']; // array\n $code = $responseJSON['code']; // array\n $message = $responseJSON['message']; // array\n\n $this->assertEquals(false, $success);\n $this->assertEquals(403, $code);\n $this->assertEquals('Permission is absent', $message);\n }", "public function activate(Request $request)\n {\n $token = $request->get('q');\n $userId = $request->get('u');\n\n $user = User::findOrFail($userId);\n\n if (! $user->activation()->first()->token === $token) {\n throw new NotFoundHttpException(\"Activation code not found\");\n }\n\n $user->activate();\n $request->session()->flash('activated', '');\n\n return view('auth.login');\n }", "public function activate()\n {\n $this->isActive = true;\n return $this;\n }", "public function actionActivate($email, $activationKey)\r\n {\r\n if($this->module->activeAfterRegister) // If accounts do not need to be activated.\r\n {\r\n throw new \\yii\\web\\NotFoundHttpException(); // Hide this action.\r\n }\r\n \r\n if(!Yii::$app->user->isGuest) // Only guest can activate accounts.\r\n {\r\n // Redirect instead of throwing a 403, because logged user end up on this page quite often.\r\n $this->redirect($this->module->returnLogoutUrl, 302); // Temporary redirect.\r\n }\r\n \r\n $model= User::find()->where(['email' => $email])->one();\r\n \r\n if($model && (int)$model->status === User::STATUS_ACTIVE) // If the account is already active.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is already active.'));\r\n }\r\n else if($model->activation_key && $model->activation_key == $activationKey) // The activation data checked out.\r\n {\r\n $model->scenario = 'activation';\r\n $model->status = User::STATUS_ACTIVE;\r\n $model->save();\r\n \r\n // Notify the user that activation was sucessful.\r\n return $this->render('message', [\r\n 'model' => $model,\r\n 'message' => Yii::t(__CLASS__, 'Your account is now active. Please log in to start using the service.'),\r\n 'type' => 'success'\r\n ]);\r\n }\r\n else if($model && (int)$model->status !== User::STATUS_ACTIVE && ($model->activation_key == $activationKey)) // The account has been disabled.\r\n {\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'This account is not active.'));\r\n }\r\n \r\n // The activation url was wrong.\r\n throw new \\yii\\web\\ForbiddenHttpException(Yii::t(__CLASS__, 'Incorrect activation URL.'));\r\n }", "function activate() {\n \n // actualizar las reglas de escritura para que observen la nueva taxonomia\n flush_rewrite_rules();\n }", "public function activate() {\n\n\t\t$this->registration_handler->register();\n\t\t\n\t}", "public function activate_account(){\n $db = \\Config\\Database::connect();\n $m = $db->table('ff_users');\n\n $uri = service('uri');\n $id = $uri->getsegment('2');\n\n $q = ask_db('user_id','ff_users',['random_key'=>\"'$id'\"]);\n\n if(!empty($q)){\n $data = ['is_active' =>'1'];\n\n $m->where('random_key', $id);\n $m->update($data);\n\n $_SESSION['success'] = 'Account is successfully activated';\n } else {\n $_SESSION['error'] = 'There was an error in activating your account, kindly respond to the activation email';\n }\n\n\n\n return redirect('login');\n\n\n }", "public function activate($id)\n {\n // Get the resource\n $object = $this->find($id);\n\n // Make sure we can activate\n if (! $object->isActivationAllowed()) {\n $this->throwException($this->error('activation_not_allowed'));\n }\n\n // Fire before listeners\n $this->eventUntil('activating', [$object]);\n\n // Activate the resource\n $object->active = 1;\n $object->activated_at = Carbon::now();\n\n // Validate the resource\n if ($object->isInvalid('activating') || ! $object->save()) {\n $this->throwException($object->getErrors(), $this->error('activate'));\n }\n\n // Fire after listeners\n $this->eventFire('activated', [$object]);\n\n return $object;\n }", "public function activate()\n {\n return view('licenses.activate');\n }", "public function signupActivate($token)\n {\n $user = User::where('activation_token', $token)->first();\n\n if (!$user) {\n $msg = __('auth.token_invalid');\n return ApiResponse::errorResponse('UNAUTHORIZED_ERROR', $msg, []);\n //return $this->errorResponse($msg,[]);\n //return response()->json([\n // 'message' => __('auth.token_invalid')\n //], 404);\n }\n\n $user->active = true;\n $user->activation_token = '';\n $user->save();\n\n $user->notify(new SignupActivated($user));\n $msg = __('auth.active_success');\n return ApiResponse::successResponse('SUCCESS', $msg, []);\n //return $this->successResponse($msg,$user);\n //return $user;\n }", "function activate($correo){\n $campos = array('activa' => 1);\n \n return $this->db->updateParameters(self::TABLA, $campos, array('email' => $correo));\n }", "protected function createRequest()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n $this->call('wizard:request', $params);\n }", "public function testActivateUser()\n {\n\n $activation_key = $this->Users->generateActivationKey();\n\n $email = '[email protected]';\n\n $_user = [\n 'email' => $email,\n 'password' => 'cakemanager',\n ];\n\n $entity = $this->Users->newEntity($_user);\n\n $entity->set('activation_key', $activation_key);\n\n $save = $this->Users->save($entity);\n\n // assert if saved\n $this->assertNotFalse($save);\n\n // test if key is null\n $this->assertFalse($this->Users->activateUser($email, null));\n\n // test if key is wrong\n $this->assertFalse($this->Users->activateUser($email, 'wrongActivationKey'));\n\n // test if email is wrong\n $this->assertFalse($this->Users->activateUser('wrong_email', $activation_key));\n\n // test if its true\n $this->assertTrue($this->Users->activateUser($email, $activation_key));\n\n $save->set('activation_key', null);\n $this->Users->save($save);\n\n // test if key is null\n $this->assertFalse($this->Users->activateUser($email, null));\n }", "public function create()\n {\n $sm = $this->getServiceLocator();\n $this->userTable = $sm->get('ShipsUnburned\\Model\\Table\\UserTable'); \n\n $request = $this->getRequest();\n \n if ($request->isPost())\n {\n $request = json_decode(file_get_contents('php://input'), true); \n $result = $this->userTable->setUsersActive($request[\"activate\"]);\n }\n return new JsonModel($result);\n }", "public function setActivation(): void;", "public function activate(Request $request, $id)\n {\n $oCertConfig = SCertConfig::find($id);\n\n session('utils')->validateEdition($this->oCurrentUserPermission->privilege_id, $oCertConfig);\n\n $oCertConfig->is_deleted = \\Config::get('scsys.STATUS.ACTIVE');\n $oCertConfig->updated_by_id = \\Auth::user()->id;\n\n $errors = $oCertConfig->save();\n if (sizeof($errors) > 0)\n {\n return redirect()->back()->withInput($request->input())->withErrors($errors);\n }\n\n Flash::success(trans('messages.REG_ACTIVATED'))->important();\n\n return redirect()->route('qms.certconfigs.index', 0);\n }", "public function activar(Request $request)\n {\n if (!$request->ajax()) {\n return redirect('/');\n }\n\n $almacen = Almacen::findOrFail($request->id);\n $almacen->estado = true; \n $almacen->save();\n }", "public function activateAccount($token)\n {\n\n $user = Activation::where('code', $token)->get();\n\n if (count($user) == 0) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation = User::find($user[0]->user_id);\n\n if (empty($activation)) {\n return response()->json([\n 'message' => 'Usuario no encontrado',\n 'code' => 404,\n 'status' => false,\n ]);\n }\n\n $activation_update = Activation::findOrFail($user[0]->id);\n\n $activation_update->completed = 1;\n\n if ($activation_update->save()) {\n return Redirect::route('activate.app')->with(\n 'success',\n 'Cuenta activada correctamente'\n );\n //return response()->json(['status' => true, 'message' => \"Cuenta activada\", 'code' => 200]);\n } else {\n return redirect('register')->with(\n 'error',\n 'Error en activar cuenta'\n );\n //return response()->json(['status' => false, 'message' => \"Cuenta no activada\", 'code' => 200]);\n }\n }", "public static function activate() {\n\t\tupdate_option( 'host_name', 'https://login.xecurify.com' );\n\t}", "public function create(Request $request) {\n return view('auth.user_activate');\n }", "public function activate( $network_wide ){\n\n\t}", "public function registerActivate($token)\n\t{\n\n\t $user = User::where('activation_token', $token)->first();\n\t if (!$user) {\n\t return response()->json([\n\t 'message' => 'This activation token is invalid.'\n\t ], 404);\n\t }\n\t $user->active = true;\n\t $user->activation_token = '';\n\t $user->save();\n\n\t return redirect('https://superwallet.herokuapp.com/verification');\n\n\t}", "public function activate(){\r\n\t\t$uid = $_GET[\"uid\"];\r\n\t\t$hash = $_GET[\"hash\"];\r\n\r\n\t\tif(User::activateUser($uid, $hash)){\r\n\t\t\techo \"active\";\r\n\t\t\tUser::loginSystem(User::fromUid($uid));\r\n\t\t}\r\n\t\tPage::redirect(\"/index\");\r\n\t}", "public function activate( $network_wide )\r\n\t{\r\n\t\t// TODO:\tDefine activation functionality here\r\n\t}", "public function activate()\n {\n $license = Licenses::find($this->key);\n $license->school_id = $this->auth_school_id;\n $license->activated_at = Carbon::now();\n $license->used=LICENCE_KEY_USED;\n if($license->save()){\n return $this->duration($license->duration);\n }\n return FALSE;\n }", "public function activate_license() {\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_current_status = $this->get_license_option('license_status');\r\n\t\r\n\tif( !empty($license_key) && $license_current_status != 'valid' ){\r\n\r\n\t\t$license_data = $this->edd_api_request('activate_license');\r\n\t\t\r\n\t\t$license_status = $license_data->license;\r\n\t\t\t\r\n\t\tif( (isset($license_status)) && (!empty($license_status)) ) {\r\n\t\t\t\r\n\t\t\tif( $license_status == 'valid' ) {\r\n\r\n\t\t\t\t$this->remove_license_option('activation_error_code');\r\n\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t$this->set_license_option('lps', 1);\r\n\t\t\t\t\r\n\t\t\t}elseif( $license_status == 'invalid' ) {\r\n\t\t\t\t\r\n\t\t\t\t// If expired, just leave it\r\n\t\t\t\tif( $license_current_status != 'expired' ) :\r\n\t\t\t\t\r\n\t\t\t\t\tif( isset($license_data->error) && !empty($license_data->error) ) :\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$this->set_license_option('license_status', $license_status);\r\n\t\t\t\t\t\t$this->set_license_option('activation_error_code', $license_data->error);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t\tendif;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\treturn $license_data;\r\n\t\r\n\t}\r\n\r\n}", "public function activate($id)\n {\n User::withTrashed()->find($id)->restore();\n $user = User::find($id);\n\n /* revoke user from oauth */\n $client = Client::where('user_id', $id);\n $client_update = array('revoked' => false);\n $client->update($client_update);\n \n Mail::to($user->email)\n ->send(new UserActivated($user));\n\n return response()->json(['success' => 'OK']);\n }", "public function activar()\n {\n $id = $this->input->post('activar');\n $this->load->model('Usuario_model');\n $this->Usuario_model->activar_cuenta($id);\n $this->listar_usuarios();\n }", "abstract public function activate( $network_wide );" ]
[ "0.7356226", "0.6713743", "0.66470397", "0.6592784", "0.6502758", "0.6493109", "0.63789636", "0.6340323", "0.63301605", "0.63301605", "0.63301605", "0.6326878", "0.6326878", "0.63202167", "0.6299813", "0.6299813", "0.6299715", "0.62956226", "0.62638783", "0.6226313", "0.61941975", "0.6174611", "0.61717033", "0.6158106", "0.6144807", "0.6124289", "0.6123916", "0.61087817", "0.6097066", "0.6078419", "0.606902", "0.59912235", "0.5985663", "0.5954211", "0.59247106", "0.5858827", "0.58577704", "0.5856964", "0.5842739", "0.5834336", "0.5829019", "0.5808074", "0.57903033", "0.57827264", "0.5754536", "0.57094926", "0.5698058", "0.5694756", "0.5694032", "0.56931984", "0.569157", "0.5690798", "0.5675975", "0.563392", "0.56159645", "0.56111324", "0.55983806", "0.5594906", "0.55920005", "0.5589207", "0.55834275", "0.55834275", "0.5554895", "0.5554051", "0.5554051", "0.555272", "0.5549095", "0.5546069", "0.55398285", "0.5539506", "0.553875", "0.5531572", "0.5529643", "0.5525886", "0.5525549", "0.5514635", "0.5509602", "0.55046886", "0.5491041", "0.5488428", "0.54838985", "0.54827553", "0.5479342", "0.54767126", "0.547422", "0.5472004", "0.5471197", "0.5466566", "0.54597014", "0.545242", "0.5446268", "0.5445479", "0.54384446", "0.54290146", "0.5418683", "0.5415006", "0.54069644", "0.53987736", "0.53949386", "0.5392801" ]
0.65075934
4
Operation cancel Cancel Subscription
public function cancel($id, $cancel_subscription_request = null) { list($response) = $this->cancelWithHttpInfo($id, $cancel_subscription_request); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _cancelOperation() {}", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function cancel(): void;", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function cancel();", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "protected function cancel(): void\n {\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function cancel(): int;", "public function cancel($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\cancel)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('cancel', $this->make_soap_params($mixed));\n\t}", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function actionCancel()\n {\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function cancel(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('cancel', $subscription)) {\n $subscription->cancel();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "function cancel() {\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t//only need to cancel on the gateway if there is a subscription id\n\t\t\tif(empty($this->subscription_transaction_id)) {\n\t\t\t\t//just mark as cancelled\n\t\t\t\t$this->updateStatus(\"cancelled\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//get some data\n\t\t\t\t$order_user = get_userdata($this->user_id);\n\n\t\t\t\t//cancel orders for the same subscription\n\t\t\t\t//Note: We do this early to avoid race conditions if and when the\n\t\t\t\t//gateway send the cancel webhook after cancelling the subscription.\t\t\t\t\n\t\t\t\t$sqlQuery = $wpdb->prepare(\n\t\t\t\t\t\"UPDATE $wpdb->pmpro_membership_orders \n\t\t\t\t\t\tSET `status` = 'cancelled' \n\t\t\t\t\t\tWHERE user_id = %d \n\t\t\t\t\t\t\tAND membership_id = %d \n\t\t\t\t\t\t\tAND gateway = %s \n\t\t\t\t\t\t\tAND gateway_environment = %s \n\t\t\t\t\t\t\tAND subscription_transaction_id = %s \n\t\t\t\t\t\t\tAND `status` IN('success', '') \",\t\t\t\t\t\n\t\t\t\t\t$this->user_id,\n\t\t\t\t\t$this->membership_id,\n\t\t\t\t\t$this->gateway,\n\t\t\t\t\t$this->gateway_environment,\n\t\t\t\t\t$this->subscription_transaction_id\n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t\n\t\t\t\t//cancel the gateway subscription first\n\t\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\t\t$result = $this->Gateway->cancel( $this );\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\tif($result == false) {\n\t\t\t\t\t//there was an error, but cancel the order no matter what\n\t\t\t\t\t$this->updateStatus(\"cancelled\");\n\n\t\t\t\t\t//we should probably notify the admin\n\t\t\t\t\t$pmproemail = new PMProEmail();\n\t\t\t\t\t$pmproemail->template = \"subscription_cancel_error\";\n\t\t\t\t\t$pmproemail->data = array(\"body\"=>\"<p>\" . sprintf(__(\"There was an error canceling the subscription for user with ID=%s. You will want to check your payment gateway to see if their subscription is still active.\", 'paid-memberships-pro' ), strval($this->user_id)) . \"</p><p>Error: \" . $this->error . \"</p>\");\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Email', 'paid-memberships-pro') . ': ' . $order_user->user_email . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Display Name', 'paid-memberships-pro') . ': ' . $order_user->display_name . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Order', 'paid-memberships-pro') . ': ' . $this->code . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';\n\t\t\t\t\t$pmproemail->sendEmail(get_bloginfo(\"admin_email\"));\n\t\t\t\t} else {\n\t\t\t\t\t//Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.\n\n\t\t\t\t\t//remove billing numbers in pmpro_memberships_users if the membership is still active\t\t\t\t\t\n\t\t\t\t\t$sqlQuery = \"UPDATE $wpdb->pmpro_memberships_users SET initial_payment = 0, billing_amount = 0, cycle_number = 0 WHERE user_id = '\" . $this->user_id . \"' AND membership_id = '\" . $this->membership_id . \"' AND status = 'active'\";\n\t\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "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 cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "public function handleCancellation($request, $context) { }", "public function cancelNow(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n \n if ($request->user()->customer->can('cancelNow', $subscription)) {\n $subscription->cancelNow();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled_now'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }", "public function cancel()\n {\n $this->_statement =null;\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "public function cancel(\\Exception $e = null)\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_CANCELLED, $e);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'cancelled'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n \n Stats::incr('cancelled', 1);\n Stats::incr('cancelled', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_CANCELLED, $this);\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function MerchantCancelSubscription($Identifier){\n $result_dto = new dtoResultObject();\n $result_dto->Status = false;\n $result_dto->ErrorMessage = \"SOAP call not executed.\";\n try {\n $client = $this->GetSoapClient();\n $params = array(\n 'Identifier' => $Identifier,\n );\n $result = $client->MerchantCancelSubscription($params);\n $result_dto->Xml = $client->__getLastResponse();\n $result_dto->ErrorMessage = $result->MerchantCancelSubscriptionResult->ErrorMessage;\n $result_dto->Status = $result->MerchantCancelSubscriptionResult->Status;\n $result_dto->Token = $result->MerchantCancelSubscriptionResult->scalar;\n } catch (Exception $e) {\n $result_dto->ErrorMessage = \"Exception occured: \" . $e;\n return $result_dto;\n }\n return $result_dto;\n }", "public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }", "function create_new_listing_actions_cancel_subscription($uid) {\r\n \r\n if (!is_numeric($uid)) {\r\n drupal_set_message(t('Invalid user id specified'), 'error');\r\n return;\r\n }\r\n\r\n // Find all recurring open orders\r\n $query = new EntityFieldQuery();\r\n\r\n $query\r\n ->entityCondition('entity_type', 'commerce_order')\r\n ->propertyCondition('type', 'recurring')\r\n ->propertyCondition('status', 'recurring_open')\r\n ->propertyCondition('uid', $uid);\r\n\r\n $result = $query->execute()['commerce_order'];\r\n\r\n if (count($result) != 1) {\r\n drupal_set_message(t('Unable to find open billing cycle.'), 'error');\r\n return;\r\n }\r\n\r\n $order = commerce_order_load(array_shift($result)->order_id);\r\n $order->status = 'canceled';\r\n commerce_order_save($order);\r\n\r\n drupal_set_message(t('Your subscription has been cancelled.'));\r\n}", "private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }", "public function cancelOrderReference($requestParameters = array());", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function cancelSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest', $parameters);\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function cancelMyReserved($id);", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "public function cancel()\n {\n dd('Your payment is canceled. You can create cancel page here.');\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function actionCancelconvert() {\n if (!empty($_POST['id']))\n {\n\t CConvertQueue::model()->deleteUserQueue($this->user_id, $_POST['id']);\n }\n }", "public function cancel($params)\n { \n return $this->request(Resource::RESOURCE_ORDER_CANCEL, $params);\n }", "public function cancelSubscription($subscription_id){\n\t\t$result = Braintree_Subscription::cancel($subscription_id);\n\t\tif ($result->success) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach($result->errors->deepAll() AS $error) {\n\t\t\t\tthrow new Exception($error->code . \": \" . $error->message . \"\\n\");\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }", "function cancel(&$order) {\n\t\t\t$order->updateStatus(\"cancelled\");\n\n\t\t\t// If we're processing an IPN request for this subscription, it's already cancelled at PayPal\n\t\t\tif( !empty( $_POST['subscr_id'] ) && $_POST['subscr_id'] == $order->subscription_transaction_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Build the nvp string for PayPal API\n\t\t\t$nvpStr = \"\";\n\t\t\t$nvpStr .= \"&PROFILEID=\" . urlencode($order->subscription_transaction_id) . \"&ACTION=Cancel&NOTE=\" . urlencode(\"User requested cancel.\");\n\n\t\t\t$nvpStr = apply_filters(\"pmpro_manage_recurring_payments_profile_status_nvpstr\", $nvpStr, $order);\n\n\t\t\t$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\n\t\t\tif(\"SUCCESS\" == strtoupper($this->httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($this->httpParsedResponseAr[\"ACK\"])) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$order->status = \"error\";\n\t\t\t\t$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];\n\t\t\t\t$order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . \". \" . __(\"Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.\", 'paid-memberships-pro' );\n\t\t\t\t$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function cancelar() {\n $this->reabrir();\n\n //Lo unico que cambia es que seteo el estado a cancelado\n $this->estado = self::CANCELADO;\n if (!$this->save())\n throw new Exception('Pedido: '.$this->getNumero().'. Error al procesar pedido: '.Commons::renderError($pedido->getErrors()));\n }", "public function cancel()\n\t{\n\t\t$this->pdoStatement = null;\n\t}", "public static function cancella()\n {\n $delete_id = $_SESSION['current_user']->getId();\n UtenteFactory::cancellaAzienda($delete_id);\n }", "public function unSubscribe()\n {\n }", "public function cancelAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Prepare product collection for cancel\n */\n $products = Mage::getModel ( 'marketplace/commission' )->getCollection ();\n $products->addFieldToSelect ( '*' );\n $products->addFieldToFilter ( 'seller_id', $sellerId );\n $products->addFieldToFilter ( 'order_id', $orderId );\n $products->addFieldToFilter ( 'product_id', $produtId );\n $collectionId = $products->getFirstItem ()->getId ();\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n if (! empty ( $collectionId ) && $orderStatusFlag == 1) {\n try {\n $data = array (\n 'order_status' => 'canceled',\n 'customer_id' => 0,\n 'credited' => 1,\n 'item_order_status' => 'canceled'\n );\n $commissionModel = Mage::getModel ( 'marketplace/commission' )->load ( $collectionId )->addData ( $data );\n $commissionModel->setId ( $collectionId )->save ();\n\n /**\n * Load order details based on the order id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Update order items to cancel status\n */\n foreach ( $_order->getAllItems () as $item ) {\n if ($this->getRequest ()->getParam ( 'item' ) == $item->getId ()) {\n $item->cancel ();\n }\n }\n /**\n * Send cancel notification for admin\n */\n Mage::helper('marketplace/general')->sendCancelOrderAdminNotification($orderId,$produtId,$sellerId);\n\n Mage::helper('marketplace/general')->sendCancelOrderBuyerNotification($_order);\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( $this->__ ( 'The item has been cancelled.' ) ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Return to order manage page\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function cancelService()\n\t{\n\t\t$client = $this->getClient();\n\n\t\treturn $client->devices->cancelService($this);\n\t}", "abstract public function cancel_payment( Payment $payment );", "public function cancelOrder(Mage_Sales_Model_Order $order)\n {\n try {\n // works for 1.8 and 1.9\n $order->registerCancellation();\n } catch (Mage_Core_Exception $e) {\n // exist for backward compatibility with Magento 1.7\n $cancelState = Mage_Sales_Model_Order::STATE_CANCELED;\n /** @var Mage_Sales_Model_Order_Item $item */\n foreach ($order->getAllItems() as $item) {\n if ($cancelState != Mage_Sales_Model_Order::STATE_PROCESSING && $item->getQtyToRefund()) {\n if ($item->getQtyToShip() > $item->getQtyToCancel()) {\n $cancelState = Mage_Sales_Model_Order::STATE_PROCESSING;\n } else {\n $cancelState = Mage_Sales_Model_Order::STATE_COMPLETE;\n }\n }\n $item->cancel();\n }\n\n $order->setSubtotalCanceled($order->getSubtotal() - $order->getSubtotalInvoiced());\n $order->setBaseSubtotalCanceled($order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced());\n\n $order->setTaxCanceled($order->getTaxAmount() - $order->getTaxInvoiced());\n $order->setBaseTaxCanceled($order->getBaseTaxAmount() - $order->getBaseTaxInvoiced());\n\n $order->setShippingCanceled($order->getShippingAmount() - $order->getShippingInvoiced());\n $order->setBaseShippingCanceled($order->getBaseShippingAmount() - $order->getBaseShippingInvoiced());\n\n $order->setDiscountCanceled(abs($order->getDiscountAmount()) - $order->getDiscountInvoiced());\n $order->setBaseDiscountCanceled(\n abs($order->getBaseDiscountAmount()) - $order->getBaseDiscountInvoiced()\n );\n\n $order->setTotalCanceled($order->getGrandTotal() - $order->getTotalPaid());\n $order->setBaseTotalCanceled($order->getBaseGrandTotal() - $order->getBaseTotalPaid());\n\n $order->setState($cancelState, true);\n }\n\t $order->save();\n }", "function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}", "protected function _processTransactionSubscriptionCanceled($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'canceled',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'Subscription #' . $subscriptionData[0]['id'] . ' canceled',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_canceled',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function cancel($module, Request $request)\n {\n $input = $request->all();\n\n //Recebe as informações do(s) documento(s) || Normal = 1 , Onda = Vários\n $documents = $input['documents'];\n\n //Valida se usuário possui permissão para retornar documento (ex: documents_prod_ret)\n if(App\\Models\\User::getPermission('documents_'.$module.'_ret',Auth::user()->user_type_code)){\n $retDoc = App\\Models\\Document::cancel($documents, $module); \n if($retDoc['erro'] <> 0){\n //Erro no cancelamento\n Flash::error($retDoc['msg']);\n return array('danger',$retDoc['msg']);\n }else{\n //Sucesso no Cancelamento\n Flash::success($retDoc['msg']);\n return array('success',$retDoc['msg']);\n }\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return array('danger',Lang::get('validation.permission'));\n }\n\n\n }", "public function cancel(Timer $timer);", "public static function cancelar($aD) {\n\n $sJsonCancel = self::makeJsonCancelamento($aD);\n \n \n $sJsonRetorno = self::curlConnect($sJsonCancel, \"Cancel\");\n \n if ($sJsonRetorno==false) {\n\n return self::error('sysbella: retorno json false');\n\n }\n\n $aCancelResponse = json_decode($sJsonRetorno, true);\n\n if (is_array( $aCancelResponse['ErrorReport'] )) {\n\n return self::error( $aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorCode'].\". \".$aCancelResponse['ErrorReport']['ErrorItemCollection']['Description'].\" [\".$aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorField'].\"]\");\n\n } else {\n return $sJsonRetorno;\n }\n\n ##\n return false;\n }", "public function cancelar_reserva(){\n $usuari = session::get('idusuari');\n \n $sql = \"CALL sp_cancelar_reserva(\".$usuari.\");\";\n \n $query=$this->db->prepare($sql);\n $query->execute();\n \n return true;\n }", "function cancel($watcherId);", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "public function cancel($subscription_id, $cancelImmediately = false)\n {\n // TODO: Check if subscription is active or in trial\n return ChargeBee_Subscription::cancel($subscription_id, [\n 'end_of_term' => ! $cancelImmediately\n ])->subscription();\n }", "public function cancelAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/failure');\n\t}", "public function autorenewal_cancel(Request $request) {\n\n $user_payment = UserSubscription::where('user_id', $request->id)->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n if($user_payment) {\n\n // Check the subscription is already cancelled\n\n if($user_payment->is_cancelled == AUTORENEWAL_CANCELLED) {\n\n $response_array = ['success' => 'false' , 'error_messages' => Helper::error_message(164) , 'error_code' => 164];\n\n return response()->json($response_array , 200);\n\n }\n\n $user_payment->is_cancelled = AUTORENEWAL_CANCELLED;\n\n $user_payment->cancel_reason = $request->cancel_reason;\n\n $user_payment->save();\n\n $subscription = $user_payment->subscription;\n\n $data = ['id'=>$request->id, \n 'subscription_id'=>$user_payment->subscription_id,\n 'user_subscription_id'=>$user_payment->id,\n 'title'=>$subscription ? $subscription->title : '',\n 'description'=>$subscription ? $subscription->description : '',\n 'popular_status'=>$subscription ? $subscription->popular_status : '',\n 'plan'=>$subscription ? $subscription->plan : '',\n 'amount'=>$user_payment->amount,\n 'status'=>$user_payment->status,\n 'expiry_date'=>date('d M Y', strtotime($user_payment->expiry_date)),\n 'created_at'=>$user_payment->created_at,\n 'currency'=>Setting::get('currency'),\n 'payment_mode'=>$user_payment->payment_mode,\n 'is_coupon_applied'=>$user_payment->is_coupon_applied,\n 'coupon_code'=>$user_payment->coupon_code,\n 'coupon_amount'=>$user_payment->coupon_amount,\n 'subscription_amount'=>$user_payment->subscription_amount,\n 'coupon_reason'=>$user_payment->coupon_reason,\n 'is_cancelled'=>$user_payment->is_cancelled,\n 'cancel_reason'=>$user_payment->cancel_reason,\n 'show_autorenewal_options'=> DEFAULT_TRUE,\n 'show_pause_autorenewal'=> DEFAULT_FALSE,\n 'show_enable_autorenewal'=> DEFAULT_TRUE,\n ];\n\n $response_array = ['success'=> true, 'message'=>tr('cancel_subscription_success'), 'data'=>$data];\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(163), 'error_code'=>163];\n\n }\n\n return response()->json($response_array);\n\n }", "public function actionCancel()\n {\n $this->render('cancel');\n }", "public function cancel() : self\n {\n $subscription = $this->asStripeSubscription();\n $subscription->cancel_at_period_end = true;\n $subscription->save();\n\n $this->stripe_status = $subscription->status;\n\n // If the user was on trial, we will set the grace period to end when the trial\n // would have ended. Otherwise, we'll retrieve the end of the billing period\n // period and make that the end of the grace period for this current user.\n if ($this->onTrial()) {\n $this->ends_at = $this->trial_ends_at;\n } else {\n $this->ends_at = Carbon::createFromTimestamp(\n $subscription->current_period_end\n )->toDayDateTimeString();\n }\n\n $this->save();\n\n return $this;\n }", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "public function cancel() {\n $this->__lastActions__[] = array();\n $this->__dbo__->rollback($this->__instanceId__);\n return $this;\n }", "function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}", "function ciniki_tenants_subscriptionCancel($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.subscriptionCancel'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n //\n // Get the billing information from the subscription table\n //\n $strsql = \"SELECT id, status, currency, paypal_subscr_id, paypal_payer_email, paypal_payer_id, paypal_amount, \"\n . \"stripe_customer_id, stripe_subscription_id \"\n . \"FROM ciniki_tenant_subscriptions \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.tenants', 'subscription');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['subscription']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.64', 'msg'=>'No active subscriptions'));\n } \n $subscription = $rc['subscription'];\n\n //\n // Cancel a stripe subscription\n //\n if( $subscription['stripe_customer_id'] != '' && $subscription['stripe_subscription_id'] != '' ) {\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/Stripe/init.php');\n \\Stripe\\Stripe::setApiKey($ciniki['config']['ciniki.tenants']['stripe.secret']);\n\n //\n // Issue the stripe customer create\n //\n try {\n $sub = \\Stripe\\Subscription::retrieve($subscription['stripe_subscription_id']);\n $sub->cancel();\n } catch( Exception $e) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.65', 'msg'=>'Unable to cancel subscription. Please contact us for help.'));\n }\n\n //\n // If active subscription, then update at paypal will be required\n //\n if( $subscription['status'] < 60 ) {\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 60 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $subscription['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.66', 'msg'=>'Unable to cancel subscription', 'err'=>$rc['err']));\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $args['tnid'], \n 2, 'ciniki_tenant_subscriptions', $subscription['id'], 'status', '61');\n return $rc;\n }\n }\n\n //\n // Cancel a paypal subscription\n //\n elseif( $subscription['paypal_subscr_id'] != '' ) {\n // \n // Send cancel to paypal\n //\n $paypal_args = 'PROFILEID=' . $subscription['paypal_subscr_id'] . '&ACTION=Cancel&Note=' . urlencode('Cancel requested by ' . $ciniki['session']['user']['email']);\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'paypalPost');\n $rc = ciniki_core_paypalPost($ciniki, 'ManageRecurringPaymentsProfileStatus', $paypal_args);\n if( $rc['stat'] !='ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.67', 'msg'=>'Unable to process cancellation, please try again or contact support', 'err'=>$rc['err']));\n }\n\n //\n // If active subscription, then update at paypal will be required\n //\n if( $subscription['status'] < 60 ) {\n $strsql = \"UPDATE ciniki_tenant_subscriptions \"\n . \"SET status = 61 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $subscription['id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.tenants');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.68', 'msg'=>'Unable to cancel subscription', 'err'=>$rc['err']));\n }\n ciniki_core_dbAddModuleHistory($ciniki, 'ciniki.tenants', 'ciniki_tenant_history', $args['tnid'], \n 2, 'ciniki_tenant_subscriptions', $subscription['id'], 'status', '61');\n return $rc;\n }\n } \n\n\n return array('stat'=>'ok');\n}", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "function cancelSubscription($userid) {\n\tif(!$userid) {\n\t\treturn false;\n\t}\n\t// Check if we have a subscription ID entered in WHMCS:\n\t$q = \"SELECT id AS relid, subscriptionid FROM tblhosting WHERE userid = {$userid} AND subscriptionid != '' AND paymentmethod = 'paypal'\";\n\t$r = mysql_query($q) or die(\"Error in query \" . mysql_error());\n\t// If we do, cancel it in PayPal:\n\tif (mysql_num_rows($r) > 0) {\n\n\t\twhile($row = mysql_fetch_assoc($r)) {\n\t\t\t$subscriptionid = $row['subscriptionid']; \n\t\t\t$relid = $row['relid'];\n\t\t\t// Do PayPal Cancellation\n\t\t\tcancelSubscriptionAPI($subscriptionid, $userid, $relid);\n\t\t}\n\t}\n\telse {\n\t\tlogactivity(\"MYWORKS DEBUG: No PayPal Subscription ID detected for this service - not attempting to cancel.\");\n\t}\n}", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function cancel()\n {\n session()->flash('warning', trans('saassubscription::app.super-user.plans.payment-cancel'));\n\n return redirect()->route($this->_config['redirect']);\n }", "public function cancelNow() : self\n {\n $subscription = $this->asStripeSubscription();\n $subscription->cancel();\n\n $this->markAsCancelled();\n\n return $this;\n }" ]
[ "0.7753012", "0.72211236", "0.70904034", "0.70843655", "0.7048468", "0.70379084", "0.70379084", "0.6955153", "0.6921301", "0.68214417", "0.6737033", "0.6682137", "0.65387", "0.65023714", "0.6463595", "0.64536744", "0.64475876", "0.64368963", "0.6425385", "0.6416105", "0.6405754", "0.6385907", "0.6329747", "0.6312784", "0.628062", "0.6212021", "0.6188534", "0.6159141", "0.61527336", "0.6149327", "0.6112721", "0.6066231", "0.60601676", "0.60552496", "0.6028726", "0.59993166", "0.59886825", "0.5986524", "0.59704775", "0.59704775", "0.59704775", "0.5952779", "0.5952779", "0.59481347", "0.5938821", "0.5931911", "0.59279066", "0.59242594", "0.5911867", "0.5875125", "0.5874505", "0.5858546", "0.58584446", "0.58524513", "0.5822763", "0.5819568", "0.5819568", "0.5819568", "0.5810095", "0.5804776", "0.58036447", "0.5795496", "0.57885927", "0.57881576", "0.57788813", "0.5770755", "0.5756369", "0.5753918", "0.574224", "0.5739938", "0.5735084", "0.57335734", "0.57335734", "0.57334375", "0.5726213", "0.5717797", "0.571364", "0.5691554", "0.56808347", "0.5671936", "0.5671088", "0.5668334", "0.5667816", "0.56555325", "0.564774", "0.5646444", "0.56347513", "0.5633871", "0.5632514", "0.5627899", "0.56273735", "0.561997", "0.56177855", "0.5609288", "0.5592968", "0.5585166", "0.5581765", "0.5577246", "0.55752283", "0.5574232", "0.55702156" ]
0.0
-1
Operation cancelWithHttpInfo Cancel Subscription
public function cancelWithHttpInfo($id, $cancel_subscription_request = null) { $request = $this->cancelRequest($id, $cancel_subscription_request); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Subscription' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Subscription' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Subscription', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Subscription'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function cancel($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\cancel)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('cancel', $this->make_soap_params($mixed));\n\t}", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function cancelAsyncWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->cancelRequest($id, $cancel_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 }", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function cancel($params)\n { \n return $this->request(Resource::RESOURCE_ORDER_CANCEL, $params);\n }", "public function cancelSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest', $parameters);\n }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "public function cancelOrderReference($requestParameters = array());", "protected function _cancelOperation() {}", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function cancel(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('cancel', $subscription)) {\n $subscription->cancel();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel(): void;", "public function cancel();", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function handleCancellation($request, $context) { }", "public function cancelWithHttpInfo($upload_uuid)\n {\n $returnType = '';\n $request = $this->cancelRequest($upload_uuid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function cancelled($request, $response, $context) {\n $this->finalize($request, $response, $context);\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function cancel ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('cancel');\n\n return $this->send($req->build());\n }", "public function cancelAction($actionId, $request)\n {\n return $this->start()->uri(\"/api/user/action\")\n ->urlSegment($actionId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->delete()\n ->go();\n }", "protected function cancel(): void\n {\n }", "public function cancelNow(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n \n if ($request->user()->customer->can('cancelNow', $subscription)) {\n $subscription->cancelNow();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled_now'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function cancelPaymentLinkRequest($x_client_id, $x_client_secret, $link_id, $x_api_version = '2022-01-01')\n {\n // verify the required parameter 'x_client_id' is set\n if ($x_client_id === null || (is_array($x_client_id) && count($x_client_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $x_client_id when calling cancelPaymentLink'\n );\n }\n // verify the required parameter 'x_client_secret' is set\n if ($x_client_secret === null || (is_array($x_client_secret) && count($x_client_secret) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $x_client_secret when calling cancelPaymentLink'\n );\n }\n // verify the required parameter 'link_id' is set\n if ($link_id === null || (is_array($link_id) && count($link_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $link_id when calling cancelPaymentLink'\n );\n }\n\n $resourcePath = '/links/{link_id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_client_id !== null) {\n $headerParams['x-client-id'] = ObjectSerializer::toHeaderValue($x_client_id);\n }\n // header params\n if ($x_client_secret !== null) {\n $headerParams['x-client-secret'] = ObjectSerializer::toHeaderValue($x_client_secret);\n }\n // header params\n if ($x_api_version !== null) {\n $headerParams['x-api-version'] = ObjectSerializer::toHeaderValue($x_api_version);\n }\n $platform = 'phpsdk_2.1.0';\n $headerParams['x-sdk-platform'] = ObjectSerializer::toHeaderValue($platform);\n\n // path params\n if ($link_id !== null) {\n $resourcePath = str_replace(\n '{' . 'link_id' . '}',\n ObjectSerializer::toPathValue($link_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function cancel( Request $request ) {\n\t\ttry {\n\n\t\t\t( new TripController )->cancel( $request );\n\n\t\t\treturn back()->with( [ 'flash_success' => trans( 'admin.provider_msgs.trip_cancelled' ) ] );\n\t\t} catch ( ModelNotFoundException $e ) {\n\t\t\treturn back()->with( [ 'flash_error' => trans( 'admin.something_wrong' ) ] );\n\t\t}\n\t}", "public function MerchantCancelSubscription($Identifier){\n $result_dto = new dtoResultObject();\n $result_dto->Status = false;\n $result_dto->ErrorMessage = \"SOAP call not executed.\";\n try {\n $client = $this->GetSoapClient();\n $params = array(\n 'Identifier' => $Identifier,\n );\n $result = $client->MerchantCancelSubscription($params);\n $result_dto->Xml = $client->__getLastResponse();\n $result_dto->ErrorMessage = $result->MerchantCancelSubscriptionResult->ErrorMessage;\n $result_dto->Status = $result->MerchantCancelSubscriptionResult->Status;\n $result_dto->Token = $result->MerchantCancelSubscriptionResult->scalar;\n } catch (Exception $e) {\n $result_dto->ErrorMessage = \"Exception occured: \" . $e;\n return $result_dto;\n }\n return $result_dto;\n }", "public function cancel(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->cancel();\n event(new SubscriptionCancelled($team));\n\n return response()->json($subscription);\n }", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function cancelarVenta(Request $request)\n {\n $cancelar_venta = new CancelarVenta();\n\n $cancelar_venta->cancelar($request);\n\n return response()->json([\n 'success' => true\n ]);\n }", "public function actionCancel()\n {\n }", "function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function cancel(): int;", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function autorenewal_cancel(Request $request) {\n\n $user_payment = UserSubscription::where('user_id', $request->id)->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n if($user_payment) {\n\n // Check the subscription is already cancelled\n\n if($user_payment->is_cancelled == AUTORENEWAL_CANCELLED) {\n\n $response_array = ['success' => 'false' , 'error_messages' => Helper::error_message(164) , 'error_code' => 164];\n\n return response()->json($response_array , 200);\n\n }\n\n $user_payment->is_cancelled = AUTORENEWAL_CANCELLED;\n\n $user_payment->cancel_reason = $request->cancel_reason;\n\n $user_payment->save();\n\n $subscription = $user_payment->subscription;\n\n $data = ['id'=>$request->id, \n 'subscription_id'=>$user_payment->subscription_id,\n 'user_subscription_id'=>$user_payment->id,\n 'title'=>$subscription ? $subscription->title : '',\n 'description'=>$subscription ? $subscription->description : '',\n 'popular_status'=>$subscription ? $subscription->popular_status : '',\n 'plan'=>$subscription ? $subscription->plan : '',\n 'amount'=>$user_payment->amount,\n 'status'=>$user_payment->status,\n 'expiry_date'=>date('d M Y', strtotime($user_payment->expiry_date)),\n 'created_at'=>$user_payment->created_at,\n 'currency'=>Setting::get('currency'),\n 'payment_mode'=>$user_payment->payment_mode,\n 'is_coupon_applied'=>$user_payment->is_coupon_applied,\n 'coupon_code'=>$user_payment->coupon_code,\n 'coupon_amount'=>$user_payment->coupon_amount,\n 'subscription_amount'=>$user_payment->subscription_amount,\n 'coupon_reason'=>$user_payment->coupon_reason,\n 'is_cancelled'=>$user_payment->is_cancelled,\n 'cancel_reason'=>$user_payment->cancel_reason,\n 'show_autorenewal_options'=> DEFAULT_TRUE,\n 'show_pause_autorenewal'=> DEFAULT_FALSE,\n 'show_enable_autorenewal'=> DEFAULT_TRUE,\n ];\n\n $response_array = ['success'=> true, 'message'=>tr('cancel_subscription_success'), 'data'=>$data];\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(163), 'error_code'=>163];\n\n }\n\n return response()->json($response_array);\n\n }", "public function getApiClientCancel()\n {\n $apiClient = new \\Bliskapaczka\\ApiClient\\Bliskapaczka\\Order\\Cancel(\n \\Configuration::get(self::API_KEY),\n $this->getApiMode(\\Configuration::get(self::TEST_MODE))\n );\n\n return $apiClient;\n }", "public function cancelPaymentLinkAsyncWithHttpInfo($x_client_id, $x_client_secret, $link_id, $x_api_version = '2022-01-01')\n {\n $returnType = '\\Cashfree\\Model\\CFLinkCancelledResponse';\n $request = $this->cancelPaymentLinkRequest($x_client_id, $x_client_secret, $link_id, $x_api_version);\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 }\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 cancelOrderByChannelPartnerOrderIdWithHttpInfoRetry($retry , $order_id)\n {\n $returnType = '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse';\n $request = $this->cancelOrderByChannelPartnerOrderIdRequest($order_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n\n if($e->getResponse()) {\n $response = $e->getResponse();\n $statusCode = $response->getStatusCode();\n $retryAfter = 0;\n $headers = $response->getHeaders();\n if (array_key_exists('Retry-After', $headers)) {\n $retryAfter = intval($headers['Retry-After'][0]);\n }\n\n if ($statusCode == 429 && $retry && $retryAfter > 0 && $retryAfter <= $this->config->getMaxRetrySeconds()) {\n sleep($retryAfter);\n return $this->cancelOrderByChannelPartnerOrderIdWithHttpInfoRetry(false , $order_id);\n }\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 410:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "protected function _processTransactionSubscriptionCanceled($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'canceled',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'Subscription #' . $subscriptionData[0]['id'] . ' canceled',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_canceled',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function cancelOrderByUltraCartOrderIdWithHttpInfoRetry($retry , $order_id)\n {\n $returnType = '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse';\n $request = $this->cancelOrderByUltraCartOrderIdRequest($order_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n\n if($e->getResponse()) {\n $response = $e->getResponse();\n $statusCode = $response->getStatusCode();\n $retryAfter = 0;\n $headers = $response->getHeaders();\n if (array_key_exists('Retry-After', $headers)) {\n $retryAfter = intval($headers['Retry-After'][0]);\n }\n\n if ($statusCode == 429 && $retry && $retryAfter > 0 && $retryAfter <= $this->config->getMaxRetrySeconds()) {\n sleep($retryAfter);\n return $this->cancelOrderByUltraCartOrderIdWithHttpInfoRetry(false , $order_id);\n }\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 410:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function cancelBooking(string $bookingId, \\Square\\Models\\CancelBookingRequest $body): ApiResponse\n {\n //prepare query string for API call\n $_queryBuilder = '/v2/bookings/{booking_id}/cancel';\n\n //process optional query parameters\n $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [\n 'booking_id' => $bookingId,\n ]);\n\n //validate and preprocess url\n $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = [\n 'user-agent' => BaseApi::USER_AGENT,\n 'Accept' => 'application/json',\n 'Square-Version' => $this->config->getSquareVersion(),\n 'Content-Type' => 'application/json'\n ];\n $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders());\n\n //json encode body\n $_bodyJson = Request\\Body::Json($body);\n\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);\n\n // Apply authorization to request\n $this->getAuthManager('global')->apply($_httpRequest);\n\n //call on-before Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n // and invoke the API call request to fetch the response\n try {\n $response = Request::post($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders(), $_bodyJson);\n } catch (\\Unirest\\Exception $ex) {\n throw new ApiException($ex->getMessage(), $_httpRequest);\n }\n\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n if (!$this->isValidResponse($_httpResponse)) {\n return ApiResponse::createFromContext($response->body, null, $_httpContext);\n }\n\n $mapper = $this->getJsonMapper();\n $deserializedResponse = $mapper->mapClass($response->body, 'Square\\\\Models\\\\CancelBookingResponse');\n return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext);\n }", "public function cancelOrder(string $order_id): \\GDAX\\Types\\Response\\RawData;", "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 cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "public function profileTransactionCancellationAction(Request $request)\r\n {\r\n $response = array(\r\n 'isSuccessful' => false,\r\n 'message' => '',\r\n 'data' => array(),\r\n );\r\n\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n $authenticatedUser = $this->getUser(); \r\n $orderProductIds = $request->get('orderProducts');\r\n $em = $this->getDoctrine()->getEntityManager();\r\n $orderProducts = $em->getRepository(\"YilinkerCoreBundle:OrderProduct\")\r\n ->getBuyerOrderProductsByIds(\r\n $authenticatedUser, $orderProductIds\r\n );\r\n \r\n $form = $this->createForm('order_product_cancellation', null, array(\r\n 'orderProducts' => $orderProducts,\r\n 'userCancellationType' => OrderProductCancellationReason::USER_TYPE_BUYER\r\n ));\r\n $form->submit(array(\r\n '_token' => $request->get('_token'),\r\n 'orderProducts' => $orderProductIds,\r\n 'reason' => $request->get('reason'),\r\n 'remark' => $request->get('remark'),\r\n ));\r\n \r\n if ($form->isValid()) {\r\n \r\n $formData = $form->getData();\r\n $invoices = array();\r\n foreach($formData['orderProducts'] as $orderProduct){\r\n $order = $orderProduct->getOrder();\r\n $invoices[$order->getOrderId()] = $order;\r\n }\r\n\r\n if(count($invoices) === 1){\r\n if(reset($invoices)->getBuyer()->getUserId() === $authenticatedUser->getUserId()){\r\n $transactionService = $this->container->get('yilinker_core.service.transaction');\r\n $response['isSuccessful'] = $transactionService->cancellationRequestTransactionByUser(\r\n $formData['orderProducts'],\r\n $formData['reason'],\r\n $formData['remark'],\r\n $authenticatedUser\r\n );\r\n if($response['isSuccessful']){\r\n $response['message'] = \"Cancellation request successfuly sent.\";\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Order does not belong to the authenticated user';\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Items do not belong to the same order';\r\n }\r\n }\r\n else{\r\n $response['message'] = $form->getErrors(true)[0]->getMessage();\r\n }\r\n\r\n return new JsonResponse($response);\r\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "public static function cancelar($aD) {\n\n $sJsonCancel = self::makeJsonCancelamento($aD);\n \n \n $sJsonRetorno = self::curlConnect($sJsonCancel, \"Cancel\");\n \n if ($sJsonRetorno==false) {\n\n return self::error('sysbella: retorno json false');\n\n }\n\n $aCancelResponse = json_decode($sJsonRetorno, true);\n\n if (is_array( $aCancelResponse['ErrorReport'] )) {\n\n return self::error( $aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorCode'].\". \".$aCancelResponse['ErrorReport']['ErrorItemCollection']['Description'].\" [\".$aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorField'].\"]\");\n\n } else {\n return $sJsonRetorno;\n }\n\n ##\n return false;\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancel( $id )\n\t{\n\t\treturn $this->controller->cancel( $id );\n\t}", "public function cancel($name, CancelOperationRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('cancel', [$params], LifesciencesEmpty::class);\n }", "public function myBookingCancel(Request $request)\n {\n $bookingService = BookingService::select()\n ->where('bookingCode', '=', $request->get('bookingCode'))\n ->first();\n\n $bookingService->bookingState = 'C';\n $bookingService->cancelDate = now();\n\n // Update to DB\n $bookingService->save();\n\n return response()->json(['success'=>'Booking Cancel']);\n }", "public function cancel()\n {\n dd('Your payment is canceled. You can create cancel page here.');\n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function cancel($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('cancel', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "function cancel() {\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t//only need to cancel on the gateway if there is a subscription id\n\t\t\tif(empty($this->subscription_transaction_id)) {\n\t\t\t\t//just mark as cancelled\n\t\t\t\t$this->updateStatus(\"cancelled\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//get some data\n\t\t\t\t$order_user = get_userdata($this->user_id);\n\n\t\t\t\t//cancel orders for the same subscription\n\t\t\t\t//Note: We do this early to avoid race conditions if and when the\n\t\t\t\t//gateway send the cancel webhook after cancelling the subscription.\t\t\t\t\n\t\t\t\t$sqlQuery = $wpdb->prepare(\n\t\t\t\t\t\"UPDATE $wpdb->pmpro_membership_orders \n\t\t\t\t\t\tSET `status` = 'cancelled' \n\t\t\t\t\t\tWHERE user_id = %d \n\t\t\t\t\t\t\tAND membership_id = %d \n\t\t\t\t\t\t\tAND gateway = %s \n\t\t\t\t\t\t\tAND gateway_environment = %s \n\t\t\t\t\t\t\tAND subscription_transaction_id = %s \n\t\t\t\t\t\t\tAND `status` IN('success', '') \",\t\t\t\t\t\n\t\t\t\t\t$this->user_id,\n\t\t\t\t\t$this->membership_id,\n\t\t\t\t\t$this->gateway,\n\t\t\t\t\t$this->gateway_environment,\n\t\t\t\t\t$this->subscription_transaction_id\n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t\n\t\t\t\t//cancel the gateway subscription first\n\t\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\t\t$result = $this->Gateway->cancel( $this );\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\tif($result == false) {\n\t\t\t\t\t//there was an error, but cancel the order no matter what\n\t\t\t\t\t$this->updateStatus(\"cancelled\");\n\n\t\t\t\t\t//we should probably notify the admin\n\t\t\t\t\t$pmproemail = new PMProEmail();\n\t\t\t\t\t$pmproemail->template = \"subscription_cancel_error\";\n\t\t\t\t\t$pmproemail->data = array(\"body\"=>\"<p>\" . sprintf(__(\"There was an error canceling the subscription for user with ID=%s. You will want to check your payment gateway to see if their subscription is still active.\", 'paid-memberships-pro' ), strval($this->user_id)) . \"</p><p>Error: \" . $this->error . \"</p>\");\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Email', 'paid-memberships-pro') . ': ' . $order_user->user_email . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Display Name', 'paid-memberships-pro') . ': ' . $order_user->display_name . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Order', 'paid-memberships-pro') . ': ' . $this->code . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';\n\t\t\t\t\t$pmproemail->sendEmail(get_bloginfo(\"admin_email\"));\n\t\t\t\t} else {\n\t\t\t\t\t//Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.\n\n\t\t\t\t\t//remove billing numbers in pmpro_memberships_users if the membership is still active\t\t\t\t\t\n\t\t\t\t\t$sqlQuery = \"UPDATE $wpdb->pmpro_memberships_users SET initial_payment = 0, billing_amount = 0, cycle_number = 0 WHERE user_id = '\" . $this->user_id . \"' AND membership_id = '\" . $this->membership_id . \"' AND status = 'active'\";\n\t\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}", "public function actionCancel()\n {\n $this->render('cancel');\n }", "public function cancelBooking($id, BookingCancelRequest $request) {\n $booking = Booking::find($id);\n $dates = $booking->dates;\n $guide_id = $booking->gid;\n $traveler_id = $booking->uid;\n $avails = Availability::where('guide_id', $guide_id)->where('travler_id', $traveler_id)->update(['status' => 'free']);\n $booking->status = 'canceled';\n $booking->save();\n if (is_null($booking))\n throw new GeneralException('This booking does not exist.');\n $booking->status = 'canceled';\n if ($booking->save())\n return redirect()->back()->withFlashSuccess(trans(\"Booking has been canceled\"));\n\n throw new GeneralException(\"There was a problem cancelling this booking. Please try again.\");\n }", "public function cancelRequests()\n {\n $this->prepareCancel();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function paymentcancel(Request $req){\n\treturn(\"Payment was cancelled\");\n }", "function cancel(&$order) {\n\t\t\t$order->updateStatus(\"cancelled\");\n\n\t\t\t// If we're processing an IPN request for this subscription, it's already cancelled at PayPal\n\t\t\tif( !empty( $_POST['subscr_id'] ) && $_POST['subscr_id'] == $order->subscription_transaction_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Build the nvp string for PayPal API\n\t\t\t$nvpStr = \"\";\n\t\t\t$nvpStr .= \"&PROFILEID=\" . urlencode($order->subscription_transaction_id) . \"&ACTION=Cancel&NOTE=\" . urlencode(\"User requested cancel.\");\n\n\t\t\t$nvpStr = apply_filters(\"pmpro_manage_recurring_payments_profile_status_nvpstr\", $nvpStr, $order);\n\n\t\t\t$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\n\t\t\tif(\"SUCCESS\" == strtoupper($this->httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($this->httpParsedResponseAr[\"ACK\"])) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$order->status = \"error\";\n\t\t\t\t$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];\n\t\t\t\t$order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . \". \" . __(\"Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.\", 'paid-memberships-pro' );\n\t\t\t\t$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function customererrandsessioncancel(Request $request){\n $trans_cancelled = Transaction::where('transaction_id',$request->transactions_id)->update([\n \"delivery_status\" => \"CANCELLED\"\n ]);\n\n return ($trans_cancelled == 1 ) ? response()->json([\"success\" => \"Cancelled\"], 200) : response()->json([\"error\" => \"Cancelling failed.. Try again\"], 500);\n\n }", "public function cancelRequest($order)\n {\n /** @var Mage_Sales_Model_Order_Payment $payment */\n $payment = $order->getPayment();\n\n $data = array();\n $authorizationId = $payment->getAdditionalInformation(\"authorizationId\");\n\n if($authorizationId) {\n $data[\"authorizationId\"] = $authorizationId;\n }\n\n $result = $this->_getHelper()->requestApi(\n $this->_getHelper()->getApiUrl(\"/payments/{$order->getIncrementId()}/cancellations\"),\n $data\n );\n\n if(isset($result['success'])) {\n return $result;\n }\n\n return false;\n }", "public function cancel($requestId)\n {\n return $this->_Cancel_operation->call(['requestId' => $requestId]);\n }", "public static function oneClickTokenCancel(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelResponse = \\BigFish\\PaymentGateway::oneClickTokenCancel(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancel($data['TransactionId']));\n\n\t\t\treturn $oneClickTokenCancelResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function cancel($id)\n {\n $reservation = $this->repository->makeModel()->find($id);\n\n $reservation->is_canceled = true;\n $reservation->canceled_at = Carbon::now();\n\n $reservation->is_confirmed = null;\n $reservation->confirmed_at = null;\n\n $history = $reservation->history;\n\n $log = [\n 'full_name' => \\Auth::user()->full_name,\n 'action' => 'cancel',\n 'label' => 'Cancelou a reserva',\n 'date' => Carbon::now()->format('Y-m-d H:i:s')\n ];\n\n if (!$history) {\n $history = [$log];\n }else{\n $history = array_prepend($history, $log);\n }\n\n $reservation->history = $history;\n\n $reservation->save();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'PlaceReservations canceled.',\n 'canceled' => $reservation->load('client'),\n ]);\n }\n\n return redirect()->back()->with('message', 'PlaceReservations deleted.');\n }", "public function cancelAuthorizationShouldCallCreateOnResourceServiceWithNewCancellation(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n $authorization = (new Authorization())->setPayment($payment)->setId('s-aut-1');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($cancellation) use ($payment) {\n /** @var Cancellation $cancellation */\n $newPayment = $cancellation->getPayment();\n return $cancellation instanceof Cancellation &&\n $cancellation->getAmount() === 12.122 &&\n $newPayment instanceof Payment &&\n $newPayment === $payment;\n }))->will($this->returnArgument(0));\n\n $cancelSrv = $heidelpay->setResourceService($resourceSrvMock)->getCancelService();\n $returnedCancellation = $cancelSrv->cancelAuthorization($authorization, 12.122);\n\n $this->assertSame(12.122, $returnedCancellation->getAmount());\n $this->assertSame($payment, $returnedCancellation->getPayment());\n }", "public function cancel($id, $actor) {\n // Make sure the job is in a cancelable status\n \n $curStatus = $this->field('status', array('CoJob.id' => $id));\n \n if(!$curStatus) {\n throw new InvalidArgumentException(_txt('er.notfound', array(_txt('ct.co_jobs.1'), $id)));\n }\n \n // This array corresponds to View/CoJob/fields.inc\n if(!in_array($curStatus, array(JobStatusEnum::InProgress, JobStatusEnum::Queued))) {\n throw new InvalidArgumentException(_txt('er.jb.cxl.status', array(_txt('en.status.job', null, $curStatus))));\n }\n \n // Finally update the status\n \n return $this->finish($id, _txt('rs.jb.cxld.by', array($actor)), JobStatusEnum::Canceled);\n }", "public function cancelOrder($symbol, $orderId = NULL, $origClientOrderId = NULL, $recvWindow = NULL);", "public function actionPaypalCancel($payment_id) {\n /*Do what you want*/ \n }", "function cancelFriendRequest($params) {\n $username1 = $params['username1'];\n $username2 = $params['username2'];\n\n $response = rejectFriendRequest($username1, $username2);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function cancel($subscription_id, $cancelImmediately = false)\n {\n // TODO: Check if subscription is active or in trial\n return ChargeBee_Subscription::cancel($subscription_id, [\n 'end_of_term' => ! $cancelImmediately\n ])->subscription();\n }", "public function build(): CancelSubscriptionResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelService($package, $service, $parent_package = null, $parent_service = null) \n {\n $service_fields = $this->serviceFieldsToObject($service->fields);\n $licensekey = $service_fields->licensekey;\n $row = $this->getModuleRow();\n if (isset($row->meta->username)) {\n $user = $row->meta->username;\n }\n if (isset($row->meta->password)) {\n $pass = $row->meta->password;\n }\n if (isset($package->meta->cwatch_sandbox)) {\n $sandbox = $package->meta->cwatch_sandbox;\n }\n $this->loadApi($user, $pass, $sandbox);\n try {\n $response = $this->api->deactivatelicense($licensekey);\n $json = json_decode($response->resp);\n //print_r($json); exit();\n if ($response->success != 1){\n $this->Input->setErrors(['api' => ['internal' => $json[0]->message]]);\n }\n $this->log('cancelService', serialize($response), 'output', true);\n }catch (exception $e){\n $this->Input->setErrors(['api' => ['internal' => $e]]);\n }\n // Return on error\n if ($this->Input->errors())\n return;\n\n return null;\n }", "protected function prepareCancel()\n {\n include $this->env;\n $this->options['Action'] = 'CancelReportRequests';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'CancelReportRequests';\n unset($this->options['MaxCount']);\n unset($this->options['NextToken']);\n }", "public function cancelar_inscripcion() {\r\n\r\n header('Content-Type: application/json');\r\n\r\n $data = array();\r\n\r\n\r\n\r\n $idEstudiante = $this->session->userdata(\"id\");\r\n\r\n $idTutoria = $this->input->post('identificador');\r\n\r\n\r\n\r\n //busco numero de inscritos a la tutoria para restarle uno\r\n\r\n $arrParam = array(\r\n\r\n \"idTutoria\" => $idTutoria\r\n\r\n );\r\n\r\n $info = $this->general_model->get_tutorias($arrParam);\r\n\r\n\r\n\r\n $numeroInscritos = $info[0]['numero_inscritos'] - 1;\r\n\r\n\r\n\r\n if ($this->estudiante_model->updateTutoriaCancelacion($idTutoria, $numeroInscritos)) {\r\n\r\n //elimino el resgistro de inscripcion del estudiante\r\n\r\n $this->estudiante_model->deleteInscripcionEstudiante($idTutoria, $idEstudiante);\r\n\r\n\r\n\r\n //aumentar en 1 el numero de cancelaciones del estudiante para el periodo activo\r\n\r\n $resultado = $this->update_numero_cancelaciones();\r\n\r\n\r\n\r\n\r\n\r\n $data[\"result\"] = true;\r\n\r\n $this->session->set_flashdata('retornoExito', 'Se canceló la inscripción de una Tutoría.');\r\n\r\n } else {\r\n\r\n $data[\"result\"] = \"error\";\r\n\r\n $data[\"mensaje\"] = \"Error!!! Contactarse con el Administrador.\";\r\n\r\n $this->session->set_flashdata('retornoError', '<strong>Error!!!</strong> Contactarse con el Administrador.');\r\n\r\n }\r\n\r\n\r\n\r\n echo json_encode($data);\r\n\r\n }", "public function cancel($paymentId, array $data = [])\n {\n return $this->rest_delete($paymentId, $data);\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "protected function _getCancelUrl()\n {\n return $this->getUrl('*/*/cancel', array('agreement' => $this->_getBillingAgreement()->getAgreementId()));\n }", "public function deleteSubscription($request);", "public function testPaymentSecupayCreditcardsCancelById()\n {\n try {\n $response = $this->api->cancelPaymentTransactionById('secupaycreditcards', self::$creditCardTransactionId, null);\n } catch (ApiException $e) {\n print_r($e->getResponseBody());\n throw $e;\n }\n\n $this->assertNotEmpty($response);\n $this->assertTrue($response['result']);\n $this->assertTrue($response['demo']);\n }" ]
[ "0.695495", "0.68179494", "0.6613098", "0.64016163", "0.6344411", "0.62848705", "0.6214668", "0.616522", "0.6113742", "0.61121696", "0.6112033", "0.60331535", "0.6009695", "0.60053074", "0.5994889", "0.5975372", "0.5962881", "0.58822674", "0.5871953", "0.5854071", "0.5815874", "0.56958413", "0.56958413", "0.5693423", "0.56564975", "0.56366646", "0.56179965", "0.561629", "0.5608904", "0.557659", "0.55635595", "0.5530829", "0.5520232", "0.5502405", "0.5501158", "0.54795", "0.5424259", "0.54143316", "0.5409524", "0.5406239", "0.54024124", "0.5399827", "0.53967476", "0.5375621", "0.53747576", "0.5352219", "0.53397787", "0.5333002", "0.5325697", "0.5312835", "0.53109556", "0.52620465", "0.52559894", "0.5246016", "0.52376527", "0.5221124", "0.5219599", "0.5216738", "0.52001643", "0.51958036", "0.519461", "0.519461", "0.5190552", "0.51776224", "0.5171441", "0.5160684", "0.51500046", "0.5149364", "0.5146265", "0.5141005", "0.51365054", "0.5134319", "0.5131504", "0.511557", "0.5102071", "0.5090322", "0.5082146", "0.50771797", "0.50690377", "0.50681335", "0.50484955", "0.5045444", "0.50293946", "0.5024455", "0.5022313", "0.50191295", "0.50141346", "0.5010648", "0.5010648", "0.5010648", "0.50104696", "0.5006885", "0.5004403", "0.49888116", "0.49775365", "0.4973712", "0.4969703", "0.49647263", "0.49617562", "0.49539137" ]
0.6632302
2
Operation cancelAsync Cancel Subscription
public function cancelAsync($id, $cancel_subscription_request = null) { return $this->cancelAsyncWithHttpInfo($id, $cancel_subscription_request) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _cancelOperation() {}", "public function cancel(): void;", "public function cancel();", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "protected function cancel(): void\n {\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function handleCancellation($request, $context) { }", "public function cancel(): int;", "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() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "public function cancel($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\cancel)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('cancel', $this->make_soap_params($mixed));\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancel(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('cancel', $subscription)) {\n $subscription->cancel();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "public function actionCancel()\n {\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function cancel(\\Exception $e = null)\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_CANCELLED, $e);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'cancelled'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n \n Stats::incr('cancelled', 1);\n Stats::incr('cancelled', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_CANCELLED, $this);\n }", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "public function cancel()\n {\n $this->_statement =null;\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function canceled()\n {\n return $this->cancelled();\n }", "function cancel() {\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\t//only need to cancel on the gateway if there is a subscription id\n\t\t\tif(empty($this->subscription_transaction_id)) {\n\t\t\t\t//just mark as cancelled\n\t\t\t\t$this->updateStatus(\"cancelled\");\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t//get some data\n\t\t\t\t$order_user = get_userdata($this->user_id);\n\n\t\t\t\t//cancel orders for the same subscription\n\t\t\t\t//Note: We do this early to avoid race conditions if and when the\n\t\t\t\t//gateway send the cancel webhook after cancelling the subscription.\t\t\t\t\n\t\t\t\t$sqlQuery = $wpdb->prepare(\n\t\t\t\t\t\"UPDATE $wpdb->pmpro_membership_orders \n\t\t\t\t\t\tSET `status` = 'cancelled' \n\t\t\t\t\t\tWHERE user_id = %d \n\t\t\t\t\t\t\tAND membership_id = %d \n\t\t\t\t\t\t\tAND gateway = %s \n\t\t\t\t\t\t\tAND gateway_environment = %s \n\t\t\t\t\t\t\tAND subscription_transaction_id = %s \n\t\t\t\t\t\t\tAND `status` IN('success', '') \",\t\t\t\t\t\n\t\t\t\t\t$this->user_id,\n\t\t\t\t\t$this->membership_id,\n\t\t\t\t\t$this->gateway,\n\t\t\t\t\t$this->gateway_environment,\n\t\t\t\t\t$this->subscription_transaction_id\n\t\t\t\t);\t\t\t\t\t\t\t\t\n\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t\n\t\t\t\t//cancel the gateway subscription first\n\t\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\t\t$result = $this->Gateway->cancel( $this );\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\n\t\t\t\tif($result == false) {\n\t\t\t\t\t//there was an error, but cancel the order no matter what\n\t\t\t\t\t$this->updateStatus(\"cancelled\");\n\n\t\t\t\t\t//we should probably notify the admin\n\t\t\t\t\t$pmproemail = new PMProEmail();\n\t\t\t\t\t$pmproemail->template = \"subscription_cancel_error\";\n\t\t\t\t\t$pmproemail->data = array(\"body\"=>\"<p>\" . sprintf(__(\"There was an error canceling the subscription for user with ID=%s. You will want to check your payment gateway to see if their subscription is still active.\", 'paid-memberships-pro' ), strval($this->user_id)) . \"</p><p>Error: \" . $this->error . \"</p>\");\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Email', 'paid-memberships-pro') . ': ' . $order_user->user_email . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('User Display Name', 'paid-memberships-pro') . ': ' . $order_user->display_name . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Order', 'paid-memberships-pro') . ': ' . $this->code . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Gateway', 'paid-memberships-pro') . ': ' . $this->gateway . '</p>';\n\t\t\t\t\t$pmproemail->data[\"body\"] .= '<p>' . __('Subscription Transaction ID', 'paid-memberships-pro') . ': ' . $this->subscription_transaction_id . '</p>';\n\t\t\t\t\t$pmproemail->sendEmail(get_bloginfo(\"admin_email\"));\n\t\t\t\t} else {\n\t\t\t\t\t//Note: status would have been set to cancelled by the gateway class. So we don't have to update it here.\n\n\t\t\t\t\t//remove billing numbers in pmpro_memberships_users if the membership is still active\t\t\t\t\t\n\t\t\t\t\t$sqlQuery = \"UPDATE $wpdb->pmpro_memberships_users SET initial_payment = 0, billing_amount = 0, cycle_number = 0 WHERE user_id = '\" . $this->user_id . \"' AND membership_id = '\" . $this->membership_id . \"' AND status = 'active'\";\n\t\t\t\t\t$wpdb->query($sqlQuery);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancelled($request, $response, $context) {\n $this->finalize($request, $response, $context);\n }", "public static function cancelar($aD) {\n\n $sJsonCancel = self::makeJsonCancelamento($aD);\n \n \n $sJsonRetorno = self::curlConnect($sJsonCancel, \"Cancel\");\n \n if ($sJsonRetorno==false) {\n\n return self::error('sysbella: retorno json false');\n\n }\n\n $aCancelResponse = json_decode($sJsonRetorno, true);\n\n if (is_array( $aCancelResponse['ErrorReport'] )) {\n\n return self::error( $aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorCode'].\". \".$aCancelResponse['ErrorReport']['ErrorItemCollection']['Description'].\" [\".$aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorField'].\"]\");\n\n } else {\n return $sJsonRetorno;\n }\n\n ##\n return false;\n }", "public function cancelNow(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n \n if ($request->user()->customer->can('cancelNow', $subscription)) {\n $subscription->cancelNow();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled_now'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "public function cancelRequests()\n {\n $this->prepareCancel();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function cancelService()\n\t{\n\t\t$client = $this->getClient();\n\n\t\treturn $client->devices->cancelService($this);\n\t}", "public function cancelOrderReference($requestParameters = array());", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "public function cancel()\n\t{\n\t\t$this->pdoStatement = null;\n\t}", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "public function cancel(Timer $timer);", "public function cancellationRequested() : bool;", "public function cancel(Project $project) {\n }", "public function cancelRequest($order)\n {\n /** @var Mage_Sales_Model_Order_Payment $payment */\n $payment = $order->getPayment();\n\n $data = array();\n $authorizationId = $payment->getAdditionalInformation(\"authorizationId\");\n\n if($authorizationId) {\n $data[\"authorizationId\"] = $authorizationId;\n }\n\n $result = $this->_getHelper()->requestApi(\n $this->_getHelper()->getApiUrl(\"/payments/{$order->getIncrementId()}/cancellations\"),\n $data\n );\n\n if(isset($result['success'])) {\n return $result;\n }\n\n return false;\n }", "function cancel($watcherId);", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->cancel();\n event(new SubscriptionCancelled($team));\n\n return response()->json($subscription);\n }", "public function actionCancelconvert() {\n if (!empty($_POST['id']))\n {\n\t CConvertQueue::model()->deleteUserQueue($this->user_id, $_POST['id']);\n }\n }", "public function cancel($requestId)\n {\n return $this->_Cancel_operation->call(['requestId' => $requestId]);\n }", "public function cancel($subscription_id, $cancelImmediately = false)\n {\n // TODO: Check if subscription is active or in trial\n return ChargeBee_Subscription::cancel($subscription_id, [\n 'end_of_term' => ! $cancelImmediately\n ])->subscription();\n }", "public function unSubscribe()\n {\n }", "public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "public static function oneClickTokenCancel(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelResponse = \\BigFish\\PaymentGateway::oneClickTokenCancel(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancel($data['TransactionId']));\n\n\t\t\treturn $oneClickTokenCancelResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function cancelarVenta(Request $request)\n {\n $cancelar_venta = new CancelarVenta();\n\n $cancelar_venta->cancelar($request);\n\n return response()->json([\n 'success' => true\n ]);\n }", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "public function cancel($name, CancelOperationRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('cancel', [$params], LifesciencesEmpty::class);\n }", "public function cancelOrder(Mage_Sales_Model_Order $order)\n {\n try {\n // works for 1.8 and 1.9\n $order->registerCancellation();\n } catch (Mage_Core_Exception $e) {\n // exist for backward compatibility with Magento 1.7\n $cancelState = Mage_Sales_Model_Order::STATE_CANCELED;\n /** @var Mage_Sales_Model_Order_Item $item */\n foreach ($order->getAllItems() as $item) {\n if ($cancelState != Mage_Sales_Model_Order::STATE_PROCESSING && $item->getQtyToRefund()) {\n if ($item->getQtyToShip() > $item->getQtyToCancel()) {\n $cancelState = Mage_Sales_Model_Order::STATE_PROCESSING;\n } else {\n $cancelState = Mage_Sales_Model_Order::STATE_COMPLETE;\n }\n }\n $item->cancel();\n }\n\n $order->setSubtotalCanceled($order->getSubtotal() - $order->getSubtotalInvoiced());\n $order->setBaseSubtotalCanceled($order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced());\n\n $order->setTaxCanceled($order->getTaxAmount() - $order->getTaxInvoiced());\n $order->setBaseTaxCanceled($order->getBaseTaxAmount() - $order->getBaseTaxInvoiced());\n\n $order->setShippingCanceled($order->getShippingAmount() - $order->getShippingInvoiced());\n $order->setBaseShippingCanceled($order->getBaseShippingAmount() - $order->getBaseShippingInvoiced());\n\n $order->setDiscountCanceled(abs($order->getDiscountAmount()) - $order->getDiscountInvoiced());\n $order->setBaseDiscountCanceled(\n abs($order->getBaseDiscountAmount()) - $order->getBaseDiscountInvoiced()\n );\n\n $order->setTotalCanceled($order->getGrandTotal() - $order->getTotalPaid());\n $order->setBaseTotalCanceled($order->getBaseGrandTotal() - $order->getBaseTotalPaid());\n\n $order->setState($cancelState, true);\n }\n\t $order->save();\n }", "public function cancel( Request $request ) {\n\t\ttry {\n\n\t\t\t( new TripController )->cancel( $request );\n\n\t\t\treturn back()->with( [ 'flash_success' => trans( 'admin.provider_msgs.trip_cancelled' ) ] );\n\t\t} catch ( ModelNotFoundException $e ) {\n\t\t\treturn back()->with( [ 'flash_error' => trans( 'admin.something_wrong' ) ] );\n\t\t}\n\t}", "public function cancelService($package, $service, $parent_package = null, $parent_service = null) \n {\n $service_fields = $this->serviceFieldsToObject($service->fields);\n $licensekey = $service_fields->licensekey;\n $row = $this->getModuleRow();\n if (isset($row->meta->username)) {\n $user = $row->meta->username;\n }\n if (isset($row->meta->password)) {\n $pass = $row->meta->password;\n }\n if (isset($package->meta->cwatch_sandbox)) {\n $sandbox = $package->meta->cwatch_sandbox;\n }\n $this->loadApi($user, $pass, $sandbox);\n try {\n $response = $this->api->deactivatelicense($licensekey);\n $json = json_decode($response->resp);\n //print_r($json); exit();\n if ($response->success != 1){\n $this->Input->setErrors(['api' => ['internal' => $json[0]->message]]);\n }\n $this->log('cancelService', serialize($response), 'output', true);\n }catch (exception $e){\n $this->Input->setErrors(['api' => ['internal' => $e]]);\n }\n // Return on error\n if ($this->Input->errors())\n return;\n\n return null;\n }", "public function cancel()\n {\n dd('Your payment is canceled. You can create cancel page here.');\n }", "public function cancelMyReserved($id);", "public function cancelSubscription($subscription_id){\n\t\t$result = Braintree_Subscription::cancel($subscription_id);\n\t\tif ($result->success) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach($result->errors->deepAll() AS $error) {\n\t\t\t\tthrow new Exception($error->code . \": \" . $error->message . \"\\n\");\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function cancelNow() : self\n {\n $subscription = $this->asStripeSubscription();\n $subscription->cancel();\n\n $this->markAsCancelled();\n\n return $this;\n }", "public function cancel()\n {\n if (!empty($_SESSION[$this->_sProgressKey]))\n $_SESSION[$this->_sProgressKey]['cancel_upload'] = true;\n\n return $this;\n }", "public function autorenewal_cancel(Request $request) {\n\n $user_payment = UserSubscription::where('user_id', $request->id)->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n if($user_payment) {\n\n // Check the subscription is already cancelled\n\n if($user_payment->is_cancelled == AUTORENEWAL_CANCELLED) {\n\n $response_array = ['success' => 'false' , 'error_messages' => Helper::error_message(164) , 'error_code' => 164];\n\n return response()->json($response_array , 200);\n\n }\n\n $user_payment->is_cancelled = AUTORENEWAL_CANCELLED;\n\n $user_payment->cancel_reason = $request->cancel_reason;\n\n $user_payment->save();\n\n $subscription = $user_payment->subscription;\n\n $data = ['id'=>$request->id, \n 'subscription_id'=>$user_payment->subscription_id,\n 'user_subscription_id'=>$user_payment->id,\n 'title'=>$subscription ? $subscription->title : '',\n 'description'=>$subscription ? $subscription->description : '',\n 'popular_status'=>$subscription ? $subscription->popular_status : '',\n 'plan'=>$subscription ? $subscription->plan : '',\n 'amount'=>$user_payment->amount,\n 'status'=>$user_payment->status,\n 'expiry_date'=>date('d M Y', strtotime($user_payment->expiry_date)),\n 'created_at'=>$user_payment->created_at,\n 'currency'=>Setting::get('currency'),\n 'payment_mode'=>$user_payment->payment_mode,\n 'is_coupon_applied'=>$user_payment->is_coupon_applied,\n 'coupon_code'=>$user_payment->coupon_code,\n 'coupon_amount'=>$user_payment->coupon_amount,\n 'subscription_amount'=>$user_payment->subscription_amount,\n 'coupon_reason'=>$user_payment->coupon_reason,\n 'is_cancelled'=>$user_payment->is_cancelled,\n 'cancel_reason'=>$user_payment->cancel_reason,\n 'show_autorenewal_options'=> DEFAULT_TRUE,\n 'show_pause_autorenewal'=> DEFAULT_FALSE,\n 'show_enable_autorenewal'=> DEFAULT_TRUE,\n ];\n\n $response_array = ['success'=> true, 'message'=>tr('cancel_subscription_success'), 'data'=>$data];\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(163), 'error_code'=>163];\n\n }\n\n return response()->json($response_array);\n\n }", "public function cancel() {\n # cleanup code before cancellng job\n $ret = array('message'=>'You cancelled this job at '.date('H:i:s'));\n return $ret;\n }", "function eve_api_subtask_cancel(&$form_state) {\n // Clear our ctools cache object. It's good housekeeping.\n eve_api_clear_page_cache('signup');\n}", "public function testCancelPayment()\n {\n $this->mockPaymentMapping(\n MiraklMock::ORDER_COMMERCIAL_CANCELED,\n StripeMock::CHARGE_STATUS_AUTHORIZED,\n 8472\n );\n $this->executeCommand();\n $this->assertCount(0, $this->validateReceiver->getSent());\n $this->assertCount(0, $this->captureReceiver->getSent());\n $this->assertCount(1, $this->cancelReceiver->getSent());\n }", "public function MerchantCancelSubscription($Identifier){\n $result_dto = new dtoResultObject();\n $result_dto->Status = false;\n $result_dto->ErrorMessage = \"SOAP call not executed.\";\n try {\n $client = $this->GetSoapClient();\n $params = array(\n 'Identifier' => $Identifier,\n );\n $result = $client->MerchantCancelSubscription($params);\n $result_dto->Xml = $client->__getLastResponse();\n $result_dto->ErrorMessage = $result->MerchantCancelSubscriptionResult->ErrorMessage;\n $result_dto->Status = $result->MerchantCancelSubscriptionResult->Status;\n $result_dto->Token = $result->MerchantCancelSubscriptionResult->scalar;\n } catch (Exception $e) {\n $result_dto->ErrorMessage = \"Exception occured: \" . $e;\n return $result_dto;\n }\n return $result_dto;\n }", "public function cancelService($package, $service, $parent_package = null, $parent_service = null)\n {\n // Set renewal mode to AUTOEXPIRE\n $this->suspendService($package, $service, $parent_package = null, $parent_service = null);\n #return null; // Nothing to do\n }", "function cancel(&$order) {\n\t\t\t$order->updateStatus(\"cancelled\");\n\n\t\t\t// If we're processing an IPN request for this subscription, it's already cancelled at PayPal\n\t\t\tif( !empty( $_POST['subscr_id'] ) && $_POST['subscr_id'] == $order->subscription_transaction_id ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Build the nvp string for PayPal API\n\t\t\t$nvpStr = \"\";\n\t\t\t$nvpStr .= \"&PROFILEID=\" . urlencode($order->subscription_transaction_id) . \"&ACTION=Cancel&NOTE=\" . urlencode(\"User requested cancel.\");\n\n\t\t\t$nvpStr = apply_filters(\"pmpro_manage_recurring_payments_profile_status_nvpstr\", $nvpStr, $order);\n\n\t\t\t$this->httpParsedResponseAr = $this->PPHttpPost('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\n\t\t\tif(\"SUCCESS\" == strtoupper($this->httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($this->httpParsedResponseAr[\"ACK\"])) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$order->status = \"error\";\n\t\t\t\t$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];\n\t\t\t\t$order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']) . \". \" . __(\"Please contact the site owner or cancel your subscription from within PayPal to make sure you are not charged going forward.\", 'paid-memberships-pro' );\n\t\t\t\t$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }", "public function markAsCancelled() : void\n {\n $this->ends_at = Carbon::now()->toDateTimeString();\n $this->is_cancelled = 1;\n $this->is_active = 0;\n $this->stripe_status = StripeSubscription::STATUS_CANCELED;\n $this->updateOrFail();\n }", "public function cancel($params)\n { \n return $this->request(Resource::RESOURCE_ORDER_CANCEL, $params);\n }", "function cancel($watcherId) {\n return getReactor()->cancel($watcherId);\n}", "public function cancelSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest', $parameters);\n }", "public function cancel($module, Request $request)\n {\n $input = $request->all();\n\n //Recebe as informações do(s) documento(s) || Normal = 1 , Onda = Vários\n $documents = $input['documents'];\n\n //Valida se usuário possui permissão para retornar documento (ex: documents_prod_ret)\n if(App\\Models\\User::getPermission('documents_'.$module.'_ret',Auth::user()->user_type_code)){\n $retDoc = App\\Models\\Document::cancel($documents, $module); \n if($retDoc['erro'] <> 0){\n //Erro no cancelamento\n Flash::error($retDoc['msg']);\n return array('danger',$retDoc['msg']);\n }else{\n //Sucesso no Cancelamento\n Flash::success($retDoc['msg']);\n return array('success',$retDoc['msg']);\n }\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return array('danger',Lang::get('validation.permission'));\n }\n\n\n }", "public function testThrottledTaskCancelledWhenWrappedTaskCancelled() {\n $wrapped = new TaskStub();\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n // Check that the task is not complete\n $this->assertFalse($throttled->isComplete());\n \n // Cancel the wrapped task and check that the the throttled task is cancelled\n $wrapped->cancel();\n $this->assertTrue($throttled->isComplete());\n $this->assertTrue($throttled->isCancelled());\n }" ]
[ "0.7692965", "0.69517905", "0.67626005", "0.6675706", "0.6675706", "0.66532636", "0.64392227", "0.64143974", "0.6355852", "0.6293415", "0.62430686", "0.6200272", "0.6191319", "0.61525214", "0.6113324", "0.60836667", "0.6081519", "0.6035006", "0.60084033", "0.6002759", "0.6002759", "0.6002759", "0.59976643", "0.59586006", "0.59447205", "0.58816594", "0.5874629", "0.5870141", "0.5819681", "0.5816613", "0.57997113", "0.57978296", "0.5780552", "0.57702047", "0.57702047", "0.57702047", "0.57300544", "0.57300544", "0.5729725", "0.56607145", "0.5614024", "0.5613778", "0.5611323", "0.5595833", "0.55799806", "0.5576297", "0.5573444", "0.55729467", "0.5569965", "0.55436325", "0.5507633", "0.5507086", "0.550361", "0.54966074", "0.54946154", "0.54946154", "0.5485493", "0.548311", "0.54800826", "0.54598695", "0.5457688", "0.5451723", "0.5433593", "0.54175377", "0.5409817", "0.53766644", "0.537647", "0.5366015", "0.5344372", "0.5340573", "0.5335219", "0.5335087", "0.53314555", "0.5324978", "0.53214294", "0.5315", "0.5313685", "0.5312859", "0.5312821", "0.5309825", "0.53089476", "0.5307673", "0.53024125", "0.5301667", "0.5301142", "0.53007907", "0.529715", "0.5289582", "0.52892935", "0.52854365", "0.52707773", "0.5268655", "0.52651167", "0.5249442", "0.5247513", "0.5246528", "0.5244171", "0.523339", "0.52280253", "0.52107793", "0.52038276" ]
0.0
-1
Operation cancelAsyncWithHttpInfo Cancel Subscription
public function cancelAsyncWithHttpInfo($id, $cancel_subscription_request = null) { $returnType = '\OpenAPI\Client\Model\Subscription'; $request = $this->cancelRequest($id, $cancel_subscription_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancel($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\cancel)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('cancel', $this->make_soap_params($mixed));\n\t}", "protected function _cancelOperation() {}", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function cancelWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $request = $this->cancelRequest($id, $cancel_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function handleCancellation($request, $context) { }", "public function cancelWithHttpInfo($upload_uuid)\n {\n $returnType = '';\n $request = $this->cancelRequest($upload_uuid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function cancel(): void;", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancel();", "public function cancelOrderReference($requestParameters = array());", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function cancelAsyncWithHttpInfo($upload_uuid)\n {\n $returnType = '';\n $request = $this->cancelRequest($upload_uuid);\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 cancel($params)\n { \n return $this->request(Resource::RESOURCE_ORDER_CANCEL, $params);\n }", "public function cancelled($request, $response, $context) {\n $this->finalize($request, $response, $context);\n }", "protected function cancel(): void\n {\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "public function cancelPaymentLinkAsyncWithHttpInfo($x_client_id, $x_client_secret, $link_id, $x_api_version = '2022-01-01')\n {\n $returnType = '\\Cashfree\\Model\\CFLinkCancelledResponse';\n $request = $this->cancelPaymentLinkRequest($x_client_id, $x_client_secret, $link_id, $x_api_version);\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 }\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 }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function cancel ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('cancel');\n\n return $this->send($req->build());\n }", "public function cancelAction($actionId, $request)\n {\n return $this->start()->uri(\"/api/user/action\")\n ->urlSegment($actionId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->delete()\n ->go();\n }", "public function cancel(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('cancel', $subscription)) {\n $subscription->cancel();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function cancelSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest', $parameters);\n }", "public function cancel(): int;", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function getApiClientCancel()\n {\n $apiClient = new \\Bliskapaczka\\ApiClient\\Bliskapaczka\\Order\\Cancel(\n \\Configuration::get(self::API_KEY),\n $this->getApiMode(\\Configuration::get(self::TEST_MODE))\n );\n\n return $apiClient;\n }", "public function cancelarVenta(Request $request)\n {\n $cancelar_venta = new CancelarVenta();\n\n $cancelar_venta->cancelar($request);\n\n return response()->json([\n 'success' => true\n ]);\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "protected function cancelRequest($upload_uuid)\n {\n // verify the required parameter 'upload_uuid' is set\n if ($upload_uuid === null || (is_array($upload_uuid) && count($upload_uuid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $upload_uuid when calling cancel'\n );\n }\n\n $resourcePath = '/api/v1/upload/{uploadUuid}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($upload_uuid !== null) {\n $resourcePath = str_replace(\n '{' . 'uploadUuid' . '}',\n ObjectSerializer::toPathValue($upload_uuid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // // this endpoint requires Bearer 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 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function deleteRateLimiterAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n $request = $this->deleteRateLimiterRequest($options);\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 }\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 test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "public function cancelAsync($id, $cancel_subscription_request = null)\n {\n return $this->cancelAsyncWithHttpInfo($id, $cancel_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function cancelRequests()\n {\n $this->prepareCancel();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function cancel(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->cancel();\n event(new SubscriptionCancelled($team));\n\n return response()->json($subscription);\n }", "public static function init(): self\n {\n return new self(new CancelSubscriptionResponse());\n }", "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 cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel( Request $request ) {\n\t\ttry {\n\n\t\t\t( new TripController )->cancel( $request );\n\n\t\t\treturn back()->with( [ 'flash_success' => trans( 'admin.provider_msgs.trip_cancelled' ) ] );\n\t\t} catch ( ModelNotFoundException $e ) {\n\t\t\treturn back()->with( [ 'flash_error' => trans( 'admin.something_wrong' ) ] );\n\t\t}\n\t}", "public static function cancelar($aD) {\n\n $sJsonCancel = self::makeJsonCancelamento($aD);\n \n \n $sJsonRetorno = self::curlConnect($sJsonCancel, \"Cancel\");\n \n if ($sJsonRetorno==false) {\n\n return self::error('sysbella: retorno json false');\n\n }\n\n $aCancelResponse = json_decode($sJsonRetorno, true);\n\n if (is_array( $aCancelResponse['ErrorReport'] )) {\n\n return self::error( $aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorCode'].\". \".$aCancelResponse['ErrorReport']['ErrorItemCollection']['Description'].\" [\".$aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorField'].\"]\");\n\n } else {\n return $sJsonRetorno;\n }\n\n ##\n return false;\n }", "public function cancelOrder(string $order_id): \\GDAX\\Types\\Response\\RawData;", "public function actionCancel()\n {\n }", "public function revokeTokenCurrentAsyncWithHttpInfo($options)\n {\n $returnType = '';\n $request = $this->revokeTokenCurrentRequest($options);\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 (string) $response->getBody()\n );\n }\n );\n }", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelOrderByChannelPartnerOrderIdWithHttpInfoRetry($retry , $order_id)\n {\n $returnType = '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse';\n $request = $this->cancelOrderByChannelPartnerOrderIdRequest($order_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n\n if($e->getResponse()) {\n $response = $e->getResponse();\n $statusCode = $response->getStatusCode();\n $retryAfter = 0;\n $headers = $response->getHeaders();\n if (array_key_exists('Retry-After', $headers)) {\n $retryAfter = intval($headers['Retry-After'][0]);\n }\n\n if ($statusCode == 429 && $retry && $retryAfter > 0 && $retryAfter <= $this->config->getMaxRetrySeconds()) {\n sleep($retryAfter);\n return $this->cancelOrderByChannelPartnerOrderIdWithHttpInfoRetry(false , $order_id);\n }\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 410:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function cancelRequest($order)\n {\n /** @var Mage_Sales_Model_Order_Payment $payment */\n $payment = $order->getPayment();\n\n $data = array();\n $authorizationId = $payment->getAdditionalInformation(\"authorizationId\");\n\n if($authorizationId) {\n $data[\"authorizationId\"] = $authorizationId;\n }\n\n $result = $this->_getHelper()->requestApi(\n $this->_getHelper()->getApiUrl(\"/payments/{$order->getIncrementId()}/cancellations\"),\n $data\n );\n\n if(isset($result['success'])) {\n return $result;\n }\n\n return false;\n }", "function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}", "public function cancelNow(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n \n if ($request->user()->customer->can('cancelNow', $subscription)) {\n $subscription->cancelNow();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.cancelled_now'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function cancel($requestId)\n {\n return $this->_Cancel_operation->call(['requestId' => $requestId]);\n }", "public function autorenewal_cancel(Request $request) {\n\n $user_payment = UserSubscription::where('user_id', $request->id)->where('status', DEFAULT_TRUE)->orderBy('created_at', 'desc')->first();\n\n if($user_payment) {\n\n // Check the subscription is already cancelled\n\n if($user_payment->is_cancelled == AUTORENEWAL_CANCELLED) {\n\n $response_array = ['success' => 'false' , 'error_messages' => Helper::error_message(164) , 'error_code' => 164];\n\n return response()->json($response_array , 200);\n\n }\n\n $user_payment->is_cancelled = AUTORENEWAL_CANCELLED;\n\n $user_payment->cancel_reason = $request->cancel_reason;\n\n $user_payment->save();\n\n $subscription = $user_payment->subscription;\n\n $data = ['id'=>$request->id, \n 'subscription_id'=>$user_payment->subscription_id,\n 'user_subscription_id'=>$user_payment->id,\n 'title'=>$subscription ? $subscription->title : '',\n 'description'=>$subscription ? $subscription->description : '',\n 'popular_status'=>$subscription ? $subscription->popular_status : '',\n 'plan'=>$subscription ? $subscription->plan : '',\n 'amount'=>$user_payment->amount,\n 'status'=>$user_payment->status,\n 'expiry_date'=>date('d M Y', strtotime($user_payment->expiry_date)),\n 'created_at'=>$user_payment->created_at,\n 'currency'=>Setting::get('currency'),\n 'payment_mode'=>$user_payment->payment_mode,\n 'is_coupon_applied'=>$user_payment->is_coupon_applied,\n 'coupon_code'=>$user_payment->coupon_code,\n 'coupon_amount'=>$user_payment->coupon_amount,\n 'subscription_amount'=>$user_payment->subscription_amount,\n 'coupon_reason'=>$user_payment->coupon_reason,\n 'is_cancelled'=>$user_payment->is_cancelled,\n 'cancel_reason'=>$user_payment->cancel_reason,\n 'show_autorenewal_options'=> DEFAULT_TRUE,\n 'show_pause_autorenewal'=> DEFAULT_FALSE,\n 'show_enable_autorenewal'=> DEFAULT_TRUE,\n ];\n\n $response_array = ['success'=> true, 'message'=>tr('cancel_subscription_success'), 'data'=>$data];\n\n } else {\n\n $response_array = ['success'=> false, 'error_messages'=>Helper::error_message(163), 'error_code'=>163];\n\n }\n\n return response()->json($response_array);\n\n }", "public function cancelOrderByUltraCartOrderIdWithHttpInfoRetry($retry , $order_id)\n {\n $returnType = '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse';\n $request = $this->cancelOrderByUltraCartOrderIdRequest($order_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n\n if($e->getResponse()) {\n $response = $e->getResponse();\n $statusCode = $response->getStatusCode();\n $retryAfter = 0;\n $headers = $response->getHeaders();\n if (array_key_exists('Retry-After', $headers)) {\n $retryAfter = intval($headers['Retry-After'][0]);\n }\n\n if ($statusCode == 429 && $retry && $retryAfter > 0 && $retryAfter <= $this->config->getMaxRetrySeconds()) {\n sleep($retryAfter);\n return $this->cancelOrderByUltraCartOrderIdWithHttpInfoRetry(false , $order_id);\n }\n }\n\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 410:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\ultracart\\v2\\models\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function revokeTokenAsyncWithHttpInfo($options)\n {\n $returnType = '';\n $request = $this->revokeTokenRequest($options);\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 (string) $response->getBody()\n );\n }\n );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function cancelBooking(string $bookingId, \\Square\\Models\\CancelBookingRequest $body): ApiResponse\n {\n //prepare query string for API call\n $_queryBuilder = '/v2/bookings/{booking_id}/cancel';\n\n //process optional query parameters\n $_queryBuilder = ApiHelper::appendUrlWithTemplateParameters($_queryBuilder, [\n 'booking_id' => $bookingId,\n ]);\n\n //validate and preprocess url\n $_queryUrl = ApiHelper::cleanUrl($this->config->getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = [\n 'user-agent' => BaseApi::USER_AGENT,\n 'Accept' => 'application/json',\n 'Square-Version' => $this->config->getSquareVersion(),\n 'Content-Type' => 'application/json'\n ];\n $_headers = ApiHelper::mergeHeaders($_headers, $this->config->getAdditionalHeaders());\n\n //json encode body\n $_bodyJson = Request\\Body::Json($body);\n\n $_httpRequest = new HttpRequest(HttpMethod::POST, $_headers, $_queryUrl);\n\n // Apply authorization to request\n $this->getAuthManager('global')->apply($_httpRequest);\n\n //call on-before Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n // and invoke the API call request to fetch the response\n try {\n $response = Request::post($_httpRequest->getQueryUrl(), $_httpRequest->getHeaders(), $_bodyJson);\n } catch (\\Unirest\\Exception $ex) {\n throw new ApiException($ex->getMessage(), $_httpRequest);\n }\n\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n if (!$this->isValidResponse($_httpResponse)) {\n return ApiResponse::createFromContext($response->body, null, $_httpContext);\n }\n\n $mapper = $this->getJsonMapper();\n $deserializedResponse = $mapper->mapClass($response->body, 'Square\\\\Models\\\\CancelBookingResponse');\n return ApiResponse::createFromContext($response->body, $deserializedResponse, $_httpContext);\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelAsync($upload_uuid)\n {\n return $this->cancelAsyncWithHttpInfo($upload_uuid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function cancelPaymentLinkRequest($x_client_id, $x_client_secret, $link_id, $x_api_version = '2022-01-01')\n {\n // verify the required parameter 'x_client_id' is set\n if ($x_client_id === null || (is_array($x_client_id) && count($x_client_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $x_client_id when calling cancelPaymentLink'\n );\n }\n // verify the required parameter 'x_client_secret' is set\n if ($x_client_secret === null || (is_array($x_client_secret) && count($x_client_secret) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $x_client_secret when calling cancelPaymentLink'\n );\n }\n // verify the required parameter 'link_id' is set\n if ($link_id === null || (is_array($link_id) && count($link_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $link_id when calling cancelPaymentLink'\n );\n }\n\n $resourcePath = '/links/{link_id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_client_id !== null) {\n $headerParams['x-client-id'] = ObjectSerializer::toHeaderValue($x_client_id);\n }\n // header params\n if ($x_client_secret !== null) {\n $headerParams['x-client-secret'] = ObjectSerializer::toHeaderValue($x_client_secret);\n }\n // header params\n if ($x_api_version !== null) {\n $headerParams['x-api-version'] = ObjectSerializer::toHeaderValue($x_api_version);\n }\n $platform = 'phpsdk_2.1.0';\n $headerParams['x-sdk-platform'] = ObjectSerializer::toHeaderValue($platform);\n\n // path params\n if ($link_id !== null) {\n $resourcePath = str_replace(\n '{' . 'link_id' . '}',\n ObjectSerializer::toPathValue($link_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function oneClickTokenCancel(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelResponse = \\BigFish\\PaymentGateway::oneClickTokenCancel(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancel($data['TransactionId']));\n\n\t\t\treturn $oneClickTokenCancelResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function cancel($id, $actor) {\n // Make sure the job is in a cancelable status\n \n $curStatus = $this->field('status', array('CoJob.id' => $id));\n \n if(!$curStatus) {\n throw new InvalidArgumentException(_txt('er.notfound', array(_txt('ct.co_jobs.1'), $id)));\n }\n \n // This array corresponds to View/CoJob/fields.inc\n if(!in_array($curStatus, array(JobStatusEnum::InProgress, JobStatusEnum::Queued))) {\n throw new InvalidArgumentException(_txt('er.jb.cxl.status', array(_txt('en.status.job', null, $curStatus))));\n }\n \n // Finally update the status\n \n return $this->finish($id, _txt('rs.jb.cxld.by', array($actor)), JobStatusEnum::Canceled);\n }", "public function customererrandsessioncancel(Request $request){\n $trans_cancelled = Transaction::where('transaction_id',$request->transactions_id)->update([\n \"delivery_status\" => \"CANCELLED\"\n ]);\n\n return ($trans_cancelled == 1 ) ? response()->json([\"success\" => \"Cancelled\"], 200) : response()->json([\"error\" => \"Cancelling failed.. Try again\"], 500);\n\n }", "public function cancel( $id )\n\t{\n\t\treturn $this->controller->cancel( $id );\n\t}", "public function cancelService()\n\t{\n\t\t$client = $this->getClient();\n\n\t\treturn $client->devices->cancelService($this);\n\t}", "public function profileTransactionCancellationAction(Request $request)\r\n {\r\n $response = array(\r\n 'isSuccessful' => false,\r\n 'message' => '',\r\n 'data' => array(),\r\n );\r\n\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n $authenticatedUser = $this->getUser(); \r\n $orderProductIds = $request->get('orderProducts');\r\n $em = $this->getDoctrine()->getEntityManager();\r\n $orderProducts = $em->getRepository(\"YilinkerCoreBundle:OrderProduct\")\r\n ->getBuyerOrderProductsByIds(\r\n $authenticatedUser, $orderProductIds\r\n );\r\n \r\n $form = $this->createForm('order_product_cancellation', null, array(\r\n 'orderProducts' => $orderProducts,\r\n 'userCancellationType' => OrderProductCancellationReason::USER_TYPE_BUYER\r\n ));\r\n $form->submit(array(\r\n '_token' => $request->get('_token'),\r\n 'orderProducts' => $orderProductIds,\r\n 'reason' => $request->get('reason'),\r\n 'remark' => $request->get('remark'),\r\n ));\r\n \r\n if ($form->isValid()) {\r\n \r\n $formData = $form->getData();\r\n $invoices = array();\r\n foreach($formData['orderProducts'] as $orderProduct){\r\n $order = $orderProduct->getOrder();\r\n $invoices[$order->getOrderId()] = $order;\r\n }\r\n\r\n if(count($invoices) === 1){\r\n if(reset($invoices)->getBuyer()->getUserId() === $authenticatedUser->getUserId()){\r\n $transactionService = $this->container->get('yilinker_core.service.transaction');\r\n $response['isSuccessful'] = $transactionService->cancellationRequestTransactionByUser(\r\n $formData['orderProducts'],\r\n $formData['reason'],\r\n $formData['remark'],\r\n $authenticatedUser\r\n );\r\n if($response['isSuccessful']){\r\n $response['message'] = \"Cancellation request successfuly sent.\";\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Order does not belong to the authenticated user';\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Items do not belong to the same order';\r\n }\r\n }\r\n else{\r\n $response['message'] = $form->getErrors(true)[0]->getMessage();\r\n }\r\n\r\n return new JsonResponse($response);\r\n }", "public function cancelService($package, $service, $parent_package = null, $parent_service = null) \n {\n $service_fields = $this->serviceFieldsToObject($service->fields);\n $licensekey = $service_fields->licensekey;\n $row = $this->getModuleRow();\n if (isset($row->meta->username)) {\n $user = $row->meta->username;\n }\n if (isset($row->meta->password)) {\n $pass = $row->meta->password;\n }\n if (isset($package->meta->cwatch_sandbox)) {\n $sandbox = $package->meta->cwatch_sandbox;\n }\n $this->loadApi($user, $pass, $sandbox);\n try {\n $response = $this->api->deactivatelicense($licensekey);\n $json = json_decode($response->resp);\n //print_r($json); exit();\n if ($response->success != 1){\n $this->Input->setErrors(['api' => ['internal' => $json[0]->message]]);\n }\n $this->log('cancelService', serialize($response), 'output', true);\n }catch (exception $e){\n $this->Input->setErrors(['api' => ['internal' => $e]]);\n }\n // Return on error\n if ($this->Input->errors())\n return;\n\n return null;\n }", "public function cancel($name, CancelOperationRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('cancel', [$params], LifesciencesEmpty::class);\n }", "public function MerchantCancelSubscription($Identifier){\n $result_dto = new dtoResultObject();\n $result_dto->Status = false;\n $result_dto->ErrorMessage = \"SOAP call not executed.\";\n try {\n $client = $this->GetSoapClient();\n $params = array(\n 'Identifier' => $Identifier,\n );\n $result = $client->MerchantCancelSubscription($params);\n $result_dto->Xml = $client->__getLastResponse();\n $result_dto->ErrorMessage = $result->MerchantCancelSubscriptionResult->ErrorMessage;\n $result_dto->Status = $result->MerchantCancelSubscriptionResult->Status;\n $result_dto->Token = $result->MerchantCancelSubscriptionResult->scalar;\n } catch (Exception $e) {\n $result_dto->ErrorMessage = \"Exception occured: \" . $e;\n return $result_dto;\n }\n return $result_dto;\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "function cancelFriendRequest($params) {\n $username1 = $params['username1'];\n $username2 = $params['username2'];\n\n $response = rejectFriendRequest($username1, $username2);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function cancelAuthorizationShouldCallCreateOnResourceServiceWithNewCancellation(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n $authorization = (new Authorization())->setPayment($payment)->setId('s-aut-1');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($cancellation) use ($payment) {\n /** @var Cancellation $cancellation */\n $newPayment = $cancellation->getPayment();\n return $cancellation instanceof Cancellation &&\n $cancellation->getAmount() === 12.122 &&\n $newPayment instanceof Payment &&\n $newPayment === $payment;\n }))->will($this->returnArgument(0));\n\n $cancelSrv = $heidelpay->setResourceService($resourceSrvMock)->getCancelService();\n $returnedCancellation = $cancelSrv->cancelAuthorization($authorization, 12.122);\n\n $this->assertSame(12.122, $returnedCancellation->getAmount());\n $this->assertSame($payment, $returnedCancellation->getPayment());\n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function removeTrafficControlApisWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiIds)) {\n $query['ApiIds'] = $request->apiIds;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n if (!Utils::isUnset($request->trafficControlId)) {\n $query['TrafficControlId'] = $request->trafficControlId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RemoveTrafficControlApis',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RemoveTrafficControlApisResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function cancel($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('cancel', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "public function myBookingCancel(Request $request)\n {\n $bookingService = BookingService::select()\n ->where('bookingCode', '=', $request->get('bookingCode'))\n ->first();\n\n $bookingService->bookingState = 'C';\n $bookingService->cancelDate = now();\n\n // Update to DB\n $bookingService->save();\n\n return response()->json(['success'=>'Booking Cancel']);\n }", "public function paymentcancel(Request $req){\n\treturn(\"Payment was cancelled\");\n }", "public function cancel(\\Exception $e = null)\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_CANCELLED, $e);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'cancelled'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n \n Stats::incr('cancelled', 1);\n Stats::incr('cancelled', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_CANCELLED, $this);\n }", "public function build(): CancelSubscriptionResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function cancelOrderByChannelPartnerOrderIdAsyncWithHttpInfo($order_id)\n {\n $returnType = '\\ultracart\\v2\\models\\ChannelPartnerCancelResponse';\n $request = $this->cancelOrderByChannelPartnerOrderIdRequest($order_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "protected function prepareCancel()\n {\n include $this->env;\n $this->options['Action'] = 'CancelReportRequests';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'CancelReportRequests';\n unset($this->options['MaxCount']);\n unset($this->options['NextToken']);\n }", "public function cancelOrderByUser(Request $req){\n $validation = Validator::make($req->all(),[\n \"orders_id\" => \"required|numeric|exists:orders,id\"\n ]);\n if($validation->fails())\n {\n return $this->apiResponseNoObj(400,$validation->errors());\n }\n\n /*Check status of this order */\n $order = Order::find($req->orders_id);\n if($order->status != \"awaitingPayment\"){\n return $this->apiResponseNoObj(423,\"can't cancel the order\");\n }\n \n /*update status of this order*/\n $order->status = \"cancelledByUser\";\n $order->save();\n\n /*retrun data*/\n return $this->apiResponseNoObj(200,\"Successfully canceled\");\n }", "public function cancel ($uuid)\n\t{\n\t\t$params = array ('uuid' => $uuid);\n\t\treturn $this->call ('market/cancel', $params, true);\n\t}", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function actionCancel()\n {\n $this->render('cancel');\n }" ]
[ "0.6539046", "0.62920797", "0.6250002", "0.623671", "0.6119566", "0.60108805", "0.5927491", "0.589252", "0.5783784", "0.5776062", "0.57478637", "0.56736225", "0.56557196", "0.56454897", "0.5631176", "0.5627461", "0.55665463", "0.5542984", "0.5515291", "0.55013835", "0.55013835", "0.5477195", "0.5470266", "0.54699683", "0.54618764", "0.54544246", "0.541973", "0.54027134", "0.5344839", "0.53220946", "0.5320976", "0.5312644", "0.5303861", "0.5297242", "0.52889776", "0.5279042", "0.52478045", "0.52434796", "0.5217997", "0.52087915", "0.52005213", "0.5175832", "0.5160825", "0.5156194", "0.51405376", "0.51276207", "0.51236355", "0.51099277", "0.51098144", "0.5105996", "0.50983256", "0.5097918", "0.5097215", "0.5071337", "0.5071337", "0.5071337", "0.5070261", "0.5045384", "0.50439054", "0.50255203", "0.5022482", "0.50204533", "0.5019755", "0.5017097", "0.50162303", "0.5010776", "0.5010776", "0.5010776", "0.4977873", "0.497765", "0.4974852", "0.4974852", "0.49634025", "0.49406594", "0.49303234", "0.48989663", "0.48958388", "0.48906615", "0.48857835", "0.48811296", "0.48727176", "0.48701975", "0.48581722", "0.48514274", "0.48398352", "0.483895", "0.48359993", "0.48309237", "0.48234886", "0.48200795", "0.48191223", "0.47902855", "0.47894922", "0.47892073", "0.47791737", "0.47791407", "0.4770383", "0.4765052", "0.475961", "0.4747621" ]
0.6493573
1
Create request for operation 'cancel'
public function cancelRequest($id, $cancel_subscription_request = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling cancel' ); } $resourcePath = '/subscriptions/{id}/cancel'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($cancel_subscription_request)) { if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request)); } else { $httpBody = $cancel_subscription_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _cancelOperation() {}", "public function actionCancel()\n {\n }", "public function cancel($params)\n { \n return $this->request(Resource::RESOURCE_ORDER_CANCEL, $params);\n }", "public function cancel();", "public function cancel(): void;", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function cancelOrderReference($requestParameters = array());", "public function cancel($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\cancel)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('cancel', $this->make_soap_params($mixed));\n\t}", "public function cancel ($number)\n {\n $req = new FortieRequest();\n $req->method('PUT');\n $req->path($this->basePath)->path($number)->path('cancel');\n\n return $this->send($req->build());\n }", "public function test_manual_CancelOrderRequest() {\n\n // Stop here and mark this test as incomplete.\n// $this->markTestIncomplete(\n// 'skeleton for test_manual_CancelOrderRequest'\n// );\n \n $countryCode = \"SE\";\n $sveaOrderIdToClose = 349698; \n $orderType = \\ConfigurationProvider::INVOICE_TYPE;\n \n $cancelOrderBuilder = new Svea\\CancelOrderBuilder( Svea\\SveaConfig::getDefaultConfig() );\n $cancelOrderBuilder->setCountryCode( $countryCode );\n $cancelOrderBuilder->setOrderId( $sveaOrderIdToClose );\n $cancelOrderBuilder->orderType = $orderType;\n \n $request = new Svea\\AdminService\\CancelOrderRequest( $cancelOrderBuilder );\n $response = $request->doRequest();\n \n ////print_r(\"cancelorderrequest: \"); //print_r( $response ); \n $this->assertInstanceOf('Svea\\AdminService\\CancelOrderResponse', $response);\n $this->assertEquals(1, $response->accepted ); \n $this->assertEquals(0, $response->resultcode ); \n\n }", "protected function cancel(): void\n {\n }", "public function cancel(): int;", "public function actionCancel()\n {\n $this->render('cancel');\n }", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function cancelAction($actionId, $request)\n {\n return $this->start()->uri(\"/api/user/action\")\n ->urlSegment($actionId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->delete()\n ->go();\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function cancelRequests()\n {\n $this->prepareCancel();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "public function paymentcancel(Request $req){\n\treturn(\"Payment was cancelled\");\n }", "protected function getDeleteRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url->getQuery()->setParameter('code', 204);\n\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function cancel($requestId)\n {\n return $this->_Cancel_operation->call(['requestId' => $requestId]);\n }", "public function cancelOrderByUser(Request $req){\n $validation = Validator::make($req->all(),[\n \"orders_id\" => \"required|numeric|exists:orders,id\"\n ]);\n if($validation->fails())\n {\n return $this->apiResponseNoObj(400,$validation->errors());\n }\n\n /*Check status of this order */\n $order = Order::find($req->orders_id);\n if($order->status != \"awaitingPayment\"){\n return $this->apiResponseNoObj(423,\"can't cancel the order\");\n }\n \n /*update status of this order*/\n $order->status = \"cancelledByUser\";\n $order->save();\n\n /*retrun data*/\n return $this->apiResponseNoObj(200,\"Successfully canceled\");\n }", "public function handleCancellation($request, $context) { }", "public function cancel( Request $request ) {\n\t\ttry {\n\n\t\t\t( new TripController )->cancel( $request );\n\n\t\t\treturn back()->with( [ 'flash_success' => trans( 'admin.provider_msgs.trip_cancelled' ) ] );\n\t\t} catch ( ModelNotFoundException $e ) {\n\t\t\treturn back()->with( [ 'flash_error' => trans( 'admin.something_wrong' ) ] );\n\t\t}\n\t}", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }", "public function getCancelType()\n {\n return $this->cancelType;\n }", "public function cancel($name, CancelOperationRequest $postBody, $optParams = [])\n {\n $params = ['name' => $name, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('cancel', [$params], LifesciencesEmpty::class);\n }", "public function cancel($module, Request $request)\n {\n $input = $request->all();\n\n //Recebe as informações do(s) documento(s) || Normal = 1 , Onda = Vários\n $documents = $input['documents'];\n\n //Valida se usuário possui permissão para retornar documento (ex: documents_prod_ret)\n if(App\\Models\\User::getPermission('documents_'.$module.'_ret',Auth::user()->user_type_code)){\n $retDoc = App\\Models\\Document::cancel($documents, $module); \n if($retDoc['erro'] <> 0){\n //Erro no cancelamento\n Flash::error($retDoc['msg']);\n return array('danger',$retDoc['msg']);\n }else{\n //Sucesso no Cancelamento\n Flash::success($retDoc['msg']);\n return array('success',$retDoc['msg']);\n }\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return array('danger',Lang::get('validation.permission'));\n }\n\n\n }", "public function actionCancel() {\n $token = trim($_GET['token']);\n// $payerId = trim($_GET['PayerID']);\n $criteria = new CDbCriteria;\n $criteria->condition = 'token=:Tokenw';\n $criteria->params = array(':Tokenw' => $token);\n $orders = Orders::model()->find($criteria);\n if ($orders->status_id == '4') {\n $orders->status_id = '2';\n $orders->save();\n// need to clear cart\n//Yii::app()->shoppingCart->clear();\n }\n $this->render('cancel');\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "public function cancel()\n {\n $message = new MailMessage;;\n $message->greeting(\"Hi {$this->post->user->name}!\");\n $message->line(\"The post {$this->post->titile} has been cancelled successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "public function cancelAction() {\n /**\n * Admin configuration for order cancel request active status.\n */\n $orderCancelStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request' );\n $data = $this->getRequest ()->getPost ();\n $emailSent = '';\n /**\n * Get order id\n * @var int\n */\n $orderId = $data ['order_id'];\n $loggedInCustomerId = '';\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Get customer data\n * @var id\n */\n $customerData = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n $loggedInCustomerId = $customerData->getId ();\n $customerid = Mage::getModel ( 'sales/order' )->load ( $data ['order_id'] )->getCustomerId ();\n } else {\n /**\n * Error message for the when unwanted person access these request.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/history' );\n return;\n }\n if ($orderCancelStatusFlag == 1 && ! empty ( $loggedInCustomerId ) && $customerid == $loggedInCustomerId) {\n $shippingStatus = 0;\n try {\n /**\n * Get templete id for the order cancel request notification.\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n if ($templateId) {\n /**\n * Load email templete.\n */\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load order product details based on the orde id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Get increment id\n * @var int\n */\n $incrementId = $_order->getIncrementId ();\n $sellerProductDetails = array ();\n $selectedProducts = $data ['products'];\n $selectedItemproductId = '';\n /**\n * Get the order item from the order.\n */\n foreach ( $_order->getAllItems () as $item ) {\n /**\n * Get Product id\n * @var int\n */\n $itemProductId = $item->getProductId ();\n $orderItem = $item;\n if (in_array ( $itemProductId, $selectedProducts )) {\n $shippingStatus = $this->getShippingStatus ( $orderItem );\n\n $sellerId = Mage::getModel ( 'catalog/product' )->load ( $itemProductId )->getSellerId ();\n $selectedItemproductId = $itemProductId;\n $sellerProductDetails [$sellerId] [] = $item->getName ();\n }\n }\n /**\n * Get seller product details.\n */\n foreach ( $sellerProductDetails as $key => $productDetails ) {\n $productDetailsHtml = \"<ul>\";\n /**\n * Increment foreach loop\n */\n foreach ( $productDetails as $productDetail ) {\n $productDetailsHtml .= \"<li>\";\n $productDetailsHtml .= $productDetail;\n $productDetailsHtml .= \"</li>\";\n }\n $productDetailsHtml .= \"</ul>\";\n $customer = Mage::getModel ( 'customer/customer' )->load ( $loggedInCustomerId );\n $seller = Mage::getModel ( 'customer/customer' )->load ( $key );\n /**\n * Get customer name and customer email id.\n */\n $buyerName = $customer->getName ();\n $buyerEmail = $customer->getEmail ();\n $sellerEmail = $seller->getEmail ();\n $sellerName = $seller->getName ();\n $recipient = $sellerEmail;\n if (empty ( $sellerEmail )) {\n $adminEmailIdVal = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n /**\n * Get the to mail id\n */\n $getToMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailIdVal/email\" );\n $recipient = $getToMailId;\n }\n $emailTemplate->setSenderName ( $buyerName );\n $emailTemplate->setSenderEmail ( $buyerEmail );\n /**\n * To set cancel/refund request sent\n */\n if ($shippingStatus == 1) {\n $requestedType = $this->__ ( 'cancellation' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 0 );\n } else {\n $requestedType = $this->__ ( 'return' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 1 );\n }\n $emailTemplateVariables = array (\n 'ownername' => $sellerName,'productdetails' => $productDetailsHtml, 'order_id' => $incrementId,\n 'customer_email' => $buyerEmail,'customer_firstname' => $buyerName,\n 'reason' => $data ['reason'],'requesttype' => $requestedType,\n 'requestperson' => $this->__ ( 'Customer' )\n );\n $emailTemplate->setDesignConfig ( array ('area' => 'frontend') );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailSent = $emailTemplate->send ( $recipient, $sellerName, $emailTemplateVariables );\n }\n if ($shippingStatus == 1) {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item cancellation request has been sent successfully.\" ) );\n } else {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item return request has been sent successfully.\" ) );\n }\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n }\n } else {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $orderId );\n }\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "function cancelOrder($sourceAccount, $orderId) {\n\techo \"Canceling Order: \" . $orderId . \" from: \" . $sourceAccount . \"</br>\";\n\t$response = putRequest('/api/order/' . $sourceAccount . '/' . $orderId . '/cancel');\n\tprintInfo($response);\n}", "public function cancel() {\n # cleanup code before cancellng job\n $ret = array('message'=>'You cancelled this job at '.date('H:i:s'));\n return $ret;\n }", "public function getApiClientCancel()\n {\n $apiClient = new \\Bliskapaczka\\ApiClient\\Bliskapaczka\\Order\\Cancel(\n \\Configuration::get(self::API_KEY),\n $this->getApiMode(\\Configuration::get(self::TEST_MODE))\n );\n\n return $apiClient;\n }", "public function profileTransactionCancellationAction(Request $request)\r\n {\r\n $response = array(\r\n 'isSuccessful' => false,\r\n 'message' => '',\r\n 'data' => array(),\r\n );\r\n\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n $authenticatedUser = $this->getUser(); \r\n $orderProductIds = $request->get('orderProducts');\r\n $em = $this->getDoctrine()->getEntityManager();\r\n $orderProducts = $em->getRepository(\"YilinkerCoreBundle:OrderProduct\")\r\n ->getBuyerOrderProductsByIds(\r\n $authenticatedUser, $orderProductIds\r\n );\r\n \r\n $form = $this->createForm('order_product_cancellation', null, array(\r\n 'orderProducts' => $orderProducts,\r\n 'userCancellationType' => OrderProductCancellationReason::USER_TYPE_BUYER\r\n ));\r\n $form->submit(array(\r\n '_token' => $request->get('_token'),\r\n 'orderProducts' => $orderProductIds,\r\n 'reason' => $request->get('reason'),\r\n 'remark' => $request->get('remark'),\r\n ));\r\n \r\n if ($form->isValid()) {\r\n \r\n $formData = $form->getData();\r\n $invoices = array();\r\n foreach($formData['orderProducts'] as $orderProduct){\r\n $order = $orderProduct->getOrder();\r\n $invoices[$order->getOrderId()] = $order;\r\n }\r\n\r\n if(count($invoices) === 1){\r\n if(reset($invoices)->getBuyer()->getUserId() === $authenticatedUser->getUserId()){\r\n $transactionService = $this->container->get('yilinker_core.service.transaction');\r\n $response['isSuccessful'] = $transactionService->cancellationRequestTransactionByUser(\r\n $formData['orderProducts'],\r\n $formData['reason'],\r\n $formData['remark'],\r\n $authenticatedUser\r\n );\r\n if($response['isSuccessful']){\r\n $response['message'] = \"Cancellation request successfuly sent.\";\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Order does not belong to the authenticated user';\r\n }\r\n }\r\n else{\r\n $response['message'] = 'Items do not belong to the same order';\r\n }\r\n }\r\n else{\r\n $response['message'] = $form->getErrors(true)[0]->getMessage();\r\n }\r\n\r\n return new JsonResponse($response);\r\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "public function cancel_order( $args = array() )\n {\n return $this->_request('cancelorder', $args);\n }", "function cancel()\n\t{\n\t\tif ($_GET[\"obj_id\"] != 0)\n\t\t{\n\t\t\tif ($_GET[\"new_type\"] == \"pg\")\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"view\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"subchap\");\n\t\t\t}\n\t\t}\n\t}", "protected function _getCancelUrl()\n {\n return $this->getUrl('*/*/cancel', array('agreement' => $this->_getBillingAgreement()->getAgreementId()));\n }", "public function isCancelRequest(Order $order, array $postData);", "protected function prepareCancel()\n {\n include $this->env;\n $this->options['Action'] = 'CancelReportRequests';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'CancelReportRequests';\n unset($this->options['MaxCount']);\n unset($this->options['NextToken']);\n }", "public function myBookingCancel(Request $request)\n {\n $bookingService = BookingService::select()\n ->where('bookingCode', '=', $request->get('bookingCode'))\n ->first();\n\n $bookingService->bookingState = 'C';\n $bookingService->cancelDate = now();\n\n // Update to DB\n $bookingService->save();\n\n return response()->json(['success'=>'Booking Cancel']);\n }", "private function getCancelLink() {\n\t\t$cancelParams = array();\n\n\t\treturn Linker::linkKnown(\n\t\t\t$this->getContext()->getTitle(),\n\t\t\twfMessage( 'cancel' )->parse(),\n\t\t\tarray( 'id' => 'mw-editform-cancel' ),\n\t\t\t$cancelParams\n\t\t);\n\t}", "public function cancelarVenta(Request $request)\n {\n $cancelar_venta = new CancelarVenta();\n\n $cancelar_venta->cancelar($request);\n\n return response()->json([\n 'success' => true\n ]);\n }", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "function cancelObject($in_rep = false)\n\t{\n\t\tilUtil::sendInfo($this->lng->txt('msg_cancel'), true);\n\t\t// TODO: check this\n\t\tilUtil::redirect('repository.php?cmd=frameset&ref_id='.$_GET['ref_id']);\n\t}", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function build(): CancelInvoiceRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function getCancelReason()\n {\n return $this->cancel_reason;\n }", "function cancelFriendRequest($params) {\n $username1 = $params['username1'];\n $username2 = $params['username2'];\n\n $response = rejectFriendRequest($username1, $username2);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function actionPaypalCancel($payment_id) {\n /*Do what you want*/ \n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public static function cancelar($aD) {\n\n $sJsonCancel = self::makeJsonCancelamento($aD);\n \n \n $sJsonRetorno = self::curlConnect($sJsonCancel, \"Cancel\");\n \n if ($sJsonRetorno==false) {\n\n return self::error('sysbella: retorno json false');\n\n }\n\n $aCancelResponse = json_decode($sJsonRetorno, true);\n\n if (is_array( $aCancelResponse['ErrorReport'] )) {\n\n return self::error( $aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorCode'].\". \".$aCancelResponse['ErrorReport']['ErrorItemCollection']['Description'].\" [\".$aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorField'].\"]\");\n\n } else {\n return $sJsonRetorno;\n }\n\n ##\n return false;\n }", "function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}", "public function customererrandsessioncancel(Request $request){\n $trans_cancelled = Transaction::where('transaction_id',$request->transactions_id)->update([\n \"delivery_status\" => \"CANCELLED\"\n ]);\n\n return ($trans_cancelled == 1 ) ? response()->json([\"success\" => \"Cancelled\"], 200) : response()->json([\"error\" => \"Cancelling failed.. Try again\"], 500);\n\n }", "public function cancelupdate(Request $request)\n {\n //cancel post\n if (Session::has('Upost')) {\n $data = Session::get('Upost');\n }else {\n $data = Session::get('New');\n }\n return view('post.postupdate')->with(['ptt' => $data]);\n }", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "public function cancelAction()\n {\n $params = $this->getRequest()->getParams();\n if (array_key_exists('shipment', $params)) {\n $shipment = Mage::getModel('sales/order_shipment')->load($params['shipment']);\n if (Mage::helper('iparcel/api')->cancelShipment($shipment)) {\n Mage::getSingleton('adminhtml/session')->addSuccess('Shipment canceled');\n }\n }\n\n $this->_redirectReferer();\n return true;\n }", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "public function cancel( $id )\n\t{\n\t\treturn $this->controller->cancel( $id );\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 cancelUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'cancel',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function cancel(Project $project) {\n }", "public function cancel(){\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t// load additonal language (for breadcrumbs)\n\t\t$this->language->load( 'checkout/success' );\n\n\t\t$this->load->library( 'encryption' );\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t// get order id\n\t\tif( isset( $this->request->get['order_id'] ) ) {\n\t\t\t$order_id = $encryption->decrypt( $this->request->get['order_id'] );\n\t\t}else{\n\t\t\t$order_id = 0;\n\t\t}\n\n\t\t// get project id\n\t\t$project_id = $this->getRequest( 'pid', 0 );\n\n\t\t// write log\n\t\t$msg = sprintf( $this->language->get( 'text_log_return_cancel'), $project_id, $order_id );\n\t\t$this->writeLog( $msg, 4 );\n\n\t\t$this->data['heading_title']\t= $this->language->get( 'text_cancel' );\n\t\t$this->data['text_message']\t\t= sprintf(\n\t\t\t$this->language->get( 'text_cancel_message' ),\n\t\t\t$this->buildUrl( 'information/contact' )\n\t\t);\n\t\t$this->data['button_continue']\t= $this->language->get( 'button_continue' );\n\t\t$this->data['continue']\t\t\t= $this->buildUrl( 'common/home' );\n\n\t\tif( $this->_ocversion == '1.4' ) {\n\t\t\t$breadcrumbs = array(\n\t\t\t\tarray(\n\t\t \t'href' => $this->buildUrl( 'common/home' ),\n\t\t \t'text' => $this->language->get( 'text_home' ),\n\t\t \t'separator' => false\n\t\t \t),\n\t\t \tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/cart' ),\n\t\t \t'text' => $this->language->get( 'text_basket' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t)\n\t\t\t);\n\n\t\t\tif( $this->customer->isLogged() ) {\n\t\t\t\t$breadcrumbs_add = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/shipping' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_shipping' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/payment' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_payment' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/confirm' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_failed' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$breadcrumbs_add = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/guest' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_guest' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'href' => $this->buildUrl( 'checkout/guest/confirm' ),\n\t\t\t\t\t\t'text' => $this->language->get( 'text_failed' ),\n\t\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$breadcrumbs = array_merge( $breadcrumbs, $breadcrumbs_add );\n\n\t \t$breadcrumbs[] = array(\n\t \t'href' => $this->buildUrl( 'checkout/success' ),\n\t \t'text' => $this->language->get( 'text_failed' ),\n\t \t'separator' => $this->language->get( 'text_separator' )\n\t \t);\n\t\t}else{\n\t\t\t$breadcrumbs = array(\n\t\t\t\tarray(\n\t\t\t\t\t'href' => $this->buildUrl( 'common/home' ),\n\t\t \t'text' => $this->language->get( 'text_home' ),\n\t\t \t'separator' => false\n\t\t\t\t),\n\t \tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/cart' ),\n\t\t \t'text' => $this->language->get( 'text_basket' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t),\n\t\t \tarray(\n\t\t\t\t\t'href' => $this->buildUrl( 'checkout/checkout', '', 'SSL' ),\n\t\t\t\t\t'text' => $this->language->get( 'text_checkout' ),\n\t\t\t\t\t'separator' => $this->language->get( 'text_separator' )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t \t'href' => $this->buildUrl( 'checkout/success' ),\n\t\t \t'text' => $this->language->get( 'text_failed' ),\n\t\t \t'separator' => $this->language->get( 'text_separator' )\n\t\t \t)\n\t \t);\n\t\t}\n\n\t\t$this->getTemplate( '/template/common/success.tpl' );\n\t\t$this->buildBreadcrumbs( $breadcrumbs );\n\t\t$this->buildTitle( $this->language->get( 'text_cancel' ) );\n\t\t$this->getChildren();\n\t\t$this->buildResponse();\n\t}", "public function cancelled($request, $response, $context) {\n $this->finalize($request, $response, $context);\n }", "public function cancelMyReserved($id);", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancelRequest($order)\n {\n /** @var Mage_Sales_Model_Order_Payment $payment */\n $payment = $order->getPayment();\n\n $data = array();\n $authorizationId = $payment->getAdditionalInformation(\"authorizationId\");\n\n if($authorizationId) {\n $data[\"authorizationId\"] = $authorizationId;\n }\n\n $result = $this->_getHelper()->requestApi(\n $this->_getHelper()->getApiUrl(\"/payments/{$order->getIncrementId()}/cancellations\"),\n $data\n );\n\n if(isset($result['success'])) {\n return $result;\n }\n\n return false;\n }", "public function cancel() {\n $this->__lastActions__[] = array();\n $this->__dbo__->rollback($this->__instanceId__);\n return $this;\n }", "public static function oneClickTokenCancel(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelResponse = \\BigFish\\PaymentGateway::oneClickTokenCancel(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancel($data['TransactionId']));\n\n\t\t\treturn $oneClickTokenCancelResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function cancel(): CancelLease\n {\n $tx = new CancelLease($this->getId());\n $tx->lease = $this;\n\n return $tx;\n }", "public function cancelAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Prepare product collection for cancel\n */\n $products = Mage::getModel ( 'marketplace/commission' )->getCollection ();\n $products->addFieldToSelect ( '*' );\n $products->addFieldToFilter ( 'seller_id', $sellerId );\n $products->addFieldToFilter ( 'order_id', $orderId );\n $products->addFieldToFilter ( 'product_id', $produtId );\n $collectionId = $products->getFirstItem ()->getId ();\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n if (! empty ( $collectionId ) && $orderStatusFlag == 1) {\n try {\n $data = array (\n 'order_status' => 'canceled',\n 'customer_id' => 0,\n 'credited' => 1,\n 'item_order_status' => 'canceled'\n );\n $commissionModel = Mage::getModel ( 'marketplace/commission' )->load ( $collectionId )->addData ( $data );\n $commissionModel->setId ( $collectionId )->save ();\n\n /**\n * Load order details based on the order id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Update order items to cancel status\n */\n foreach ( $_order->getAllItems () as $item ) {\n if ($this->getRequest ()->getParam ( 'item' ) == $item->getId ()) {\n $item->cancel ();\n }\n }\n /**\n * Send cancel notification for admin\n */\n Mage::helper('marketplace/general')->sendCancelOrderAdminNotification($orderId,$produtId,$sellerId);\n\n Mage::helper('marketplace/general')->sendCancelOrderBuyerNotification($_order);\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( $this->__ ( 'The item has been cancelled.' ) ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Return to order manage page\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "function cancel() {\n\n\t\tif (KRequest::getVar('return')) {\n\t\t\t$url = KLink::base64UrlDecode(KRequest::getVar('return'));\n\t\t}\n\t\telse {\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t}\n\n\t\t$this->setRedirect($url);\n\n\t}", "public function render_cancel_link() {\n\n\t\tif ( ! $this->is_checkout_confirmation() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<a href=\"%1$s\" class=\"wc-' . sanitize_html_class( $this->get_gateway()->get_id_dasherized() ) . '-cancel\">%2$s</a>',\n\t\t\tesc_url( add_query_arg( array( 'wc_' . $this->get_gateway()->get_id() . '_clear_session' => true ), wc_get_cart_url() ) ),\n\t\t\tesc_html__( 'Cancel', 'woocommerce-gateway-paypal-powered-by-braintree' )\n\t\t);\n\t}", "public function cancelOrder($symbol, $orderId = NULL, $origClientOrderId = NULL, $recvWindow = NULL);", "public function redeem_request_cancel(Request $request) {\n\n $validator = Validator::make($request->all() , [\n 'redeem_request_id' => 'required|exists:redeem_requests,id,user_id,'.$request->id,\n ]);\n\n if ($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_code' => 101, 'error_messages'=>$error_messages);\n\n } else {\n\n if($redeem_details = Redeem::where('user_id' , $request->id)->first()) {\n\n if($redeem_request_details = RedeemRequest::find($request->redeem_request_id)) {\n\n // Check status to cancel the redeem request\n\n if(in_array($redeem_request_details->status, [REDEEM_REQUEST_SENT , REDEEM_REQUEST_PROCESSING])) {\n // Update the redeeem \n\n $redeem_details->remaining = $redeem_details->remaining + abs($redeem_request_details->request_amount);\n\n $redeem_details->save();\n\n // Update the redeeem request Status\n\n $redeem_request_details->status = REDEEM_REQUEST_CANCEL;\n\n $redeem_request_details->save();\n\n $response_array = ['success' => true];\n\n\n } else {\n $response_array = ['success' => false , 'error_messages' => Helper::error_message(160) , 'error_code' => 160];\n }\n\n } else {\n $response_array = ['success' => false , 'error_messages' => Helper::error_message(161) , 'error_code' => 161];\n }\n\n } else {\n\n $response_array = ['success' => false , 'error_messages' => Helper::error_message(161) , 'error_code' =>161 ];\n }\n\n }\n\n return response()->json($response_array , 200);\n\n }", "public function cancel(Request $request): RedirectResponse\n {\n $joinable = $request->user()->joinable;\n\n $request->user()->forceFill([\n 'joinable_type' => null,\n 'joinable_id' => null,\n ])->save();\n\n flash(__('You have cancelled your request to join :team.', ['team' => $joinable->name]), 'success');\n\n return redirect(\\localized_route($joinable->getRoutePrefix().'.show', $joinable));\n }", "public function indexcancelAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n $all = $em->getRepository('NvCargaBundle:Bill')->findBy(['status'=>'ANULADA', 'maincompany'=> $maincompany]);\n if ($type == \"MASTER\") {\n $entities = $all;\n } else {\n $entities = [];\n foreach ($all as $entity) {\n $guide = $entity->getGuides()->last();\n if ($guide->getAgency() === $agency()) {\n $entities[] = $entity;\n }\n }\n }\n return array(\n 'entities' => $entities,\n );\n\n }", "public function massCancelAction()\n {\n $this->_ratepayMassEvent('cancel');\n \n $this->_redirect('*/*/index');\n }", "public function cancel($id)\n {\n $reservation = $this->repository->makeModel()->find($id);\n\n $reservation->is_canceled = true;\n $reservation->canceled_at = Carbon::now();\n\n $reservation->is_confirmed = null;\n $reservation->confirmed_at = null;\n\n $history = $reservation->history;\n\n $log = [\n 'full_name' => \\Auth::user()->full_name,\n 'action' => 'cancel',\n 'label' => 'Cancelou a reserva',\n 'date' => Carbon::now()->format('Y-m-d H:i:s')\n ];\n\n if (!$history) {\n $history = [$log];\n }else{\n $history = array_prepend($history, $log);\n }\n\n $reservation->history = $history;\n\n $reservation->save();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'PlaceReservations canceled.',\n 'canceled' => $reservation->load('client'),\n ]);\n }\n\n return redirect()->back()->with('message', 'PlaceReservations deleted.');\n }", "protected function cancelAppointmentRequest($args) {\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $checkBookingsQry = \"select appointment_id from appointment where slave_id = '\" . $this->User['entityId'] . \"' and status IN (6,7,8)\";\n $checkBookingsRes = mysql_query($checkBookingsQry, $this->db->conn);\n\n if (mysql_num_rows($checkBookingsRes) > 0)\n return $this->_getStatusMessage(93, 93);\n\n if ($this->_updateSlvApptStatus($this->User['entityId'], '3') == 0)\n return $this->_getStatusMessage(74, 74);\n else\n return $this->_getStatusMessage(3, 1);\n }", "public function cancelar() {\n $this->reabrir();\n\n //Lo unico que cambia es que seteo el estado a cancelado\n $this->estado = self::CANCELADO;\n if (!$this->save())\n throw new Exception('Pedido: '.$this->getNumero().'. Error al procesar pedido: '.Commons::renderError($pedido->getErrors()));\n }", "public function cancel($id, $actor) {\n // Make sure the job is in a cancelable status\n \n $curStatus = $this->field('status', array('CoJob.id' => $id));\n \n if(!$curStatus) {\n throw new InvalidArgumentException(_txt('er.notfound', array(_txt('ct.co_jobs.1'), $id)));\n }\n \n // This array corresponds to View/CoJob/fields.inc\n if(!in_array($curStatus, array(JobStatusEnum::InProgress, JobStatusEnum::Queued))) {\n throw new InvalidArgumentException(_txt('er.jb.cxl.status', array(_txt('en.status.job', null, $curStatus))));\n }\n \n // Finally update the status\n \n return $this->finish($id, _txt('rs.jb.cxld.by', array($actor)), JobStatusEnum::Canceled);\n }", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }", "public function getCancelReasonAttribute()\n {\n return $this->getParam('cancelReason', []);\n }", "public function cancelAll(Request $req)\n {\n $schedule = $req->schedule;\n $bookingdate = $req->bookingdate;\n\n $tickets = Ticket::where([\n ['schedule_id', $schedule],\n ['from_stop', Auth::user()->terminal_id],\n ['paid', 1]\n ])->whereDate('booking_for', $bookingdate);\n $seats = TicketSeat::whereHas('ticket', function ($query) use ($schedule, $bookingdate) {\n return $query->where([\n ['schedule_id', $schedule],\n ['from_stop', Auth::user()->terminal_id],\n ['paid', 1]\n ])->whereDate('booking_for', $bookingdate);\n });\n\n $seats->delete();\n $tickets->delete();\n\n return response(array('msg' => 'All tickets deleted successfully.'));\n }", "public function getCancelUrl()\n {\n return Mage::getUrl('payulite/processing/cancel', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "function ostGetCanceledStatusId()\r\n{\r\n\treturn 1;\r\n}" ]
[ "0.7341362", "0.70861036", "0.7078121", "0.70541376", "0.701048", "0.6988759", "0.690553", "0.690553", "0.6712775", "0.6673656", "0.6614141", "0.6543088", "0.6530064", "0.6527233", "0.6495489", "0.6458284", "0.6427571", "0.6415554", "0.6371916", "0.6363306", "0.63475204", "0.633301", "0.6329853", "0.62865573", "0.6239021", "0.6223643", "0.61994255", "0.6198465", "0.61861926", "0.61487806", "0.6136282", "0.6124895", "0.6094459", "0.6091575", "0.60703665", "0.6028228", "0.6001487", "0.5990207", "0.5979164", "0.59790456", "0.59634626", "0.5961882", "0.59610003", "0.5956906", "0.59473944", "0.59339833", "0.59277093", "0.59166586", "0.5913749", "0.5907974", "0.5903519", "0.59024954", "0.5896179", "0.58851254", "0.5878826", "0.5878826", "0.5867193", "0.5864039", "0.5863914", "0.5852717", "0.5838814", "0.5838814", "0.58282197", "0.581414", "0.5811316", "0.579575", "0.57853246", "0.57808924", "0.5780644", "0.57655185", "0.5753329", "0.5746164", "0.5741344", "0.57347465", "0.57216656", "0.57210743", "0.57179093", "0.5717391", "0.5709945", "0.56976813", "0.56909907", "0.5686505", "0.5677648", "0.56663674", "0.56525916", "0.56426", "0.56425935", "0.5639971", "0.56390494", "0.5638583", "0.56355", "0.56307876", "0.56297576", "0.56164426", "0.5612375", "0.559848", "0.55853593", "0.5570057", "0.55660784", "0.5561845" ]
0.6534386
12
Operation create Create Subscription
public function create($create_subscription_request) { list($response) = $this->createWithHttpInfo($create_subscription_request); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSubscription($request);", "public function create()\n {\n $subscription = new Subscription();\n\n return $subscription;\n }", "function createNewSubscription(array $data){\nreturn $this->post($data, \"/subscription\");\n}", "function create_subscription($subscription) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Try to save the subscription\n if ( $CI->base_model->insert('subscriptions', $subscription) ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "public function create()\n {\n return view(\"admin.subscriptions.create\");\n }", "public function create()\n {\n //\n return view('backend.subscriptions.create');\n }", "public function create()\n {\n return view('subscription::create');\n }", "public function create()\n {\n $subscriptions = Subscription::all();\n\n return view('subscription.subscribe', compact('subscriptions'));\n }", "public function createRequest($create_subscription_request)\n {\n // verify the required parameter 'create_subscription_request' is set\n if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_subscription_request when calling create'\n );\n }\n\n $resourcePath = '/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request));\n } else {\n $httpBody = $create_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create(CreateSubscriberRequest $request)\n {\n // create a new object, fill with data and save\n $data = $request->toArray();\n $subscriber = new Subscriber($data);\n $subscriber->save();\n\n // save to cache\n $cacheKey = \"subscriber-{$subscriber->id}\";\n RedisCache::instance()->set($cacheKey, serialize($subscriber));\n\n return new Response(201, 'Subscriber created', $subscriber);\n }", "public function create()\n {\n return view('subscriptions.create');\n }", "public function createSubscription(CustomerInterface $customer, PaymentMethodInterface $payment_method, $product_name, string $period, ...$arguments): SubscriptionInterface;", "public function createAction(Request $request)\n {\n $entity = new SubscriptionBase();\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('admin_subscriptions_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createWithHttpInfo($create_subscription_request)\n {\n $request = $this->createRequest($create_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function create()\n {\n \n return view('backend.subscriber.create');\n \n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "abstract public function add_subscription( Payment_Subscription $subscription );", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "public function create()\n {\n return view ('subscriber::subscriber_create');\n }", "public function actionCreate()\n {\n $model = new UserSubscriber();\n\n $success = false;\n $msg = 'There was an error, please try again later.';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $success = true;\n $msg = 'Thank you for subscription for newsletter.';\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['success' => $success, 'msg' => $msg];\n\n }", "public function makeSubscription($subscriptionFields = [])\n {\n /** @var SubscriptionRepository $subscriptionRepo */\n $subscriptionRepo = App::make(SubscriptionRepository::class);\n $theme = $this->fakeSubscriptionData($subscriptionFields);\n return $subscriptionRepo->create($theme);\n }", "public function createSubscription($parameters) {\r\n $request = FlexmailAPI::parseArray($parameters);\r\n\r\n $response = $this->execute(\"CreateGroupSubscription\", $request);\r\n return FlexmailAPI::stripHeader($response, $this->config->get('debug_mode'));\r\n }", "public function postCreateSubscription(CreateSubscriptionRequest $request)\n {\n try {\n DB::beginTransaction();\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($request->cardExist === \"true\") {\n $this->addUserTOSubscription($recruiter['customer_id'], $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n if ($recruiter['customer_id'] == null) {\n $createCustomer = $this->createCustomer();\n if ($createCustomer['success'] == true) {\n $customer = $createCustomer['data']['id'];\n } else {\n $customer = null;\n $this->response['success'] = false;\n $this->response['message'] = $createCustomer['message'];\n $this->response['data'] = null;\n }\n } else {\n $customer = $recruiter['customer_id'];\n }\n if ($customer != null) {\n $addCard = $this->addCardForSubscription($request->all(), $customer);\n if ($addCard['success'] == true) {\n $this->addUserTOSubscription($customer, $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $addCard['message'];\n }\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = trans('messages.cannot_subscribe');\n }\n }\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollback();\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function createSubscriptionWithPaymentMethod(CreateSubscriptionWithPaymentMethodRequest $request)\n {\n $response = $this->paymentMethodService->createPaymentMethod($request);\n $request->merge([\n 'payment_method' => $response['id'],\n ]);\n\n $this->apiData = $this->subscriptionService->createSubscription($request);\n\n return $this->success();\n }", "protected function _create_subscription ( array $values ){\n\n return new Payment_Subscription( $values );\n\n }", "function createObject() {\n\t\treturn new InstitutionalSubscription();\n\t}", "public function Create()\n {\n \t// CREATE RETAILER TYPE ////////////////////////////////////////////\n \t$rs = mysql_query(\"INSERT INTO subscriptions (subscription_name_fr,\n\t subscription_name_en,\n \t\t\t\t\t\t\t\t\t\t\t\t subscription_desc_fr,\n\t subscription_desc_en,\n\t created_by_id,\n\t created_date,\n\t modified_by_id,\n\t modified_date,\n\t \t\t\t\t\t\t\t\t rowguid) VALUES\n ('\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->created_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . create_guid() .\"')\");\n \t\t \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\t \n \t\t \n \t$this->subscription_id = mysql_insert_id();\n \t\t \n \treturn mysql_insert_id();\n \t\t \n \t\n }", "public function create()\n {\n $title = 'Create Subscriber';\n $topics = Auth::user()->topics;\n return view('subscriber.create', compact('title','topics'));\n }", "public function newSubscription(array $data = [], string $name = 'default')\n {\n $trialEndsAt = null;\n if ($data['status'] === Paddle::STATUS_TRIALING) {\n $time = Carbon::parse($data['event_time'])->format('H:i:s');\n $trialEndsAt = Carbon::parse(\"{$data['next_bill_date']} {$time}\");\n }\n\n return $this->subscriptions()->create([\n 'user_id' => $this->id,\n 'name' => $name,\n 'paddle_id' => $data['subscription_id'],\n 'paddle_plan_id' => $data['subscription_plan_id'],\n 'paddle_cancel_url' => $data['cancel_url'],\n 'paddle_update_url' => $data['update_url'],\n 'paddle_status' => $data['status'],\n 'quantity' => $data['quantity'],\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null\n ]);\n }", "public function saveSubscription($subscription)\n {\n return Stripe\\Subscription::create(array(\n 'customer' => Stripe\\Customer::retrieve(\n Customer::where('id', $subscription->customer_id)->first()->token\n ),\n 'plan' => $subscription->plan_level\n ));\n }", "protected function createdASubscription(): bool\n {\n $this->createSubscription();\n\n if(!$this->subscription):\n return $this->subscriptionCreationFailed();\n endif;\n\n // Making sure clients won't be charged after trial period.\n $this->subscription_api->cancelAtTerms($this->subscription);\n\n return true;\n }", "public function create()\n {\n return view('backend.vendor-subscription-plan.create');\n }", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public function postCreate(Request $request)\n {\n //echo \"dfadsf\";exit;\n \n // // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription= new Subscription();\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data inserted successfully'));\n\n }", "public function create(Request $request)\n {\n $user = $request->user();\n $user->createOrGetStripeCustomer();\n if($user->subscribed()){\n return $user->redirectToBillingPortal();\n }\n\n return view('.subscription.create', [\n 'intent' => $user->createSetupIntent()\n ]);\n }", "private function subscriptionFactory($name, array $info = [])\n {\n return new Subscription(\n $this->connection,\n $this->projectId,\n $name,\n $this->name,\n $this->encode,\n $info\n );\n }", "public function create()\n {\n return view('admin.subs.subscriptiontype.create')->with('dates', self::dates());\n }", "public function store(SubscriptionStoreRequest $request)\n {\n $user = Auth::user();\n\n $company_name = $request->get('company_name');\n\n $user_password = $request->get('user_password');\n\n\n try {\n\n\n $result = $this->saasService->validateAccount($company_name, $user->email);\n\n if ($result->status == 'error') {\n flash($result->message)->error();\n return back();\n }\n\n } catch (\\Exception $exception) {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n\n\n $plan = $this->planSservice->getByGateway($request->get('plan'));\n\n $subscription = $request->user()->newSubscription('main', $request->plan);\n\n if ($plan->trial) {\n $subscription->trialDays($plan->trial_days);\n\n }\n\n\n\n if ($request->has('coupon')) {\n $subscription->withCoupon($request->coupon);\n }\n\n try {\n if (config('saas.payment_gateway', '') == 'stripe') {\n $subscription->create($request->token);\n } else {\n $subscription->create($request->payment_method_nonce);\n }\n\n\n } catch (\\Exception $exception) {\n\n flash(trans($exception->getMessage()))->warning();\n\n return redirect(route('account.index'));\n }\n\n try {\n\n if (!config('saas.api_url')) {\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n return back();\n }\n\n $result = $this->saasService->createAccount($company_name, $user->name, $user->email, $user_password, $plan->teams_limit, $plan->storage_limit, $plan->api_plan);\n\n if ($result->status) {\n\n $user->application_id = $result->data->company->id;\n\n if ($user->save()) {\n\n\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n } else {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n } else {\n flash(trans('saas.error_something_went_wrong'), $result->message)->error();\n }\n\n } catch (\\Exception $exception) {\n\n\n flash(trans('saas.error_something_went_wrong'), $exception->getMessage())->error();\n }\n\n return redirect(route('account.index'));\n }", "public function create(array $attributes = [])\n {\n $trialEndsAt = null;\n\n if (!$this->skipTrial) {\n if (!is_null($this->trialPeriod) && $this->trialPeriod > 0) {\n $trial = new Period($this->trialInterval, $this->trialPeriod, now());\n $trialEndsAt = $trial->getEndAt();\n } elseif ($this->plan->hasTrial()) {\n $trial = new Period($this->plan->trial_interval, $this->plan->trial_period, now());\n $trialEndsAt = $trial->getEndAt();\n }\n }\n\n $period = new Period($this->plan->invoice_interval, $this->plan->invoice_period, $trialEndsAt);\n\n return $this->subscriber->subscriptions()->create(array_merge([\n 'name' => $this->name,\n 'plan_id' => $this->plan->getKey(),\n 'trial_ends_at' => $trialEndsAt,\n 'starts_at' => $period->getStartAt(),\n 'ends_at' => $period->getEndAt(),\n ], $attributes));\n }", "public function actionCreate() {\n /*if (substr_count(Yii::app()->session['premission_info']['module_info']['subscribedProduct'], 'C') == 0) {\n Yii::app()->user->setFlash('permission_error', 'You have not permission to access');\n Yii::app()->controller->redirect(\"index.php?r=DashboardPage/index\");\n }*/\n $model = new SubscribedProduct;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['SubscribedProduct'])) {\n $model->attributes = $_POST['SubscribedProduct'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->subscribed_product_id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function createSubscription($plan=null,$customer=null,$trial_period=null)\n {\n $subscription = \\Stripe\\Subscription::create([\n 'customer' => $customer,\n 'items' => [\n [\n 'plan' => $plan,\n ],\n ],\n 'expand' => ['latest_invoice.payment_intent'],\n 'trial_end' => ($trial_period > 0)? Carbon::now()->addDays($trial_period)->timestamp:null,\n ]);\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_subscriptionId = $subscription->id;\n $user->save();\n\n return $subscription;\n }", "protected function createBasicSubscriptionAndOrder() {\n $subscription = Subscription::create([\n 'type' => 'product_variation',\n 'store_id' => $this->store->id(),\n 'billing_schedule' => $this->billingSchedule,\n 'uid' => $this->user,\n 'payment_method' => $this->paymentMethod,\n 'purchased_entity' => $this->variation,\n 'title' => $this->variation->getOrderItemTitle(),\n 'unit_price' => new Price('2', 'USD'),\n 'state' => 'pending',\n 'starts' => \\Drupal::time()->getRequestTime() - 5,\n 'ends' => \\Drupal::time()->getRequestTime() + 1000,\n ]);\n $subscription->save();\n\n $order_storage = \\Drupal::entityTypeManager()->getStorage('commerce_order');\n $result = $order_storage->getQuery()\n ->condition('type', 'recurring')\n ->pager(1)\n ->execute();\n $this->assertEmpty($result);\n\n $subscription->getState()->applyTransition($subscription->getState()->getTransitions()['activate']);\n $subscription->save();\n\n $orders = $order_storage->loadMultiple($order_storage->getQuery()\n ->condition('type', 'recurring')\n ->execute());\n $this->assertCount(1, $orders);\n $order = reset($orders);\n\n return [$subscription, $order];\n }", "public function create(Request $request){\n\n $suscription = new Subscription([\n 'plan_id' => $request->plan_id,\n 'date_start' => Carbon::now(),\n 'date_end' => Carbon::now()->addMonths(2),\n ]);\n $suscription->save();\n $car_suscription = new CarSubscription([\n 'subscription_id' => $suscription->id,\n 'cars_id' => $request->car_id,\n ]);\n $car_suscription->save();\n return response()->json([\n 'message' => 'Creado exitosamente!'], 201);\n }", "public function create()\n {\n\t\t $subplans = \\DB::table('subscrptions')->lists('title', 'subscribe_id');\n\t\t $clients = \\DB::table('clients')->lists('orgname', 'client_id');\n return view('subscribeusers.create')->with('subplans', $subplans)->with('clients', $clients);\n \n }", "public function created(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'started');\n }", "public function create(CreateSubscriberDTO $details)\r\n {\r\n $details = json_decode(json_encode($details), true);\r\n $res = $this->subscriberModel->create($details);\r\n\r\n return $res;\r\n }", "public function create(Request $request)\n {\n $id = $request->id;\n\n return view('subscriber.create',compact('id'));\n }", "public function createSubscription(\\HGON\\HgonPayment\\Domain\\Model\\Article $article)\n {\n $settings = $this->getSettings();\n\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n /** @var \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder $uriBuilder */\n $uriBuilder = $objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Routing\\\\UriBuilder');\n $returnUri = $uriBuilder->reset()->setCreateAbsoluteUri(true)\n ->setTargetPageUid(intval($settings['subscriptionPid']))\n ->uriFor('confirmSubscription', null, 'PayPal', 'HgonPayment', 'Subscription');\n\n // the api does not accept return urls without \".de\" at the end\n // because of this, the api throws error while testing. Use pseudo .de domain\n if (\n $this->context == \"Development\"\n //|| $this->context == \"Production/Staging\"\n ) {\n // override returnUri\n $returnUri = 'http://stage.hgon.de/mitmachen/hgon-sagt-danke/';\n }\n\n\n // get PayPalProduct by sku\n // -> create, if not exists\n $payPalProduct = $this->getPayPalProduct($article);\n\n // @toDo: get PayPayPlan by PayPalProduct (product_id)\n // -> create, if not exists\n // give Article: If it's a donation, this article will not be found in database table\n $payPalPlan = $this->getPayPalPlan($payPalProduct, $article);\n\n if (! ($payPalPlan instanceof \\HGON\\HgonPayment\\Domain\\Model\\PayPalPlan)) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('Cannot fetch PayPalPlan for Article with UID \"%s\". Please check the configuration.', $article->getUid()));\n return false;\n //===\n }\n\n // active directyl with \"SUBSCRIBE_NOW\": https://developer.paypal.com/docs/platforms/subscriptions/#step-3-create-a-subscription\n // (Optional) Use the application_context/user_action field to automatically activate subscriptions. Set the field to SUBSCRIBE_NOW or send it empty. The default value is SUBSCRIBE_NOW. Otherwise, you need to make a POST v1/billing/subscriptions/{ID}/activate call to activate the subscription.\n\n // Create subscription by plan_id\n $data = [\n 'plan_id' => $payPalPlan->getPlanId(),\n //'quantity' => 1,\n 'application_context' => [\n 'user_action' => 'SUBSCRIBE_NOW',\n 'shipping_preference' => 'NO_SHIPPING',\n // IMPORTANT: A local URI with .local to the end was NOT supported by the sandbox for testing!!\n 'return_url' => $returnUri,\n 'cancel_url' => $settings['api']['cancelUrl']\n ]\n ];\n\n $url = $this->host . '/v1/billing/subscriptions';\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n $this->cUrl = $curl;\n return $this->sendRequest();\n //===\n }", "public function create()\n\t{\n\t\treturn view('subscribers/create');\n\t}", "public function save(array $data) {\n $subscription = new Subscriptions();\n \n $subscription->user()->associate($data['customer']);\n $subscription->service()->associate($data['service']);\n $subscription->status()->associate($data['status']);\n $subscription->status_change = $data['date'];\n \n if (isset($data['previousStatus'])) {\n $subscription->previousStatus()->associate($data['previousStatus']);\n }\n \n $subscription->save();\n\n return $subscription;\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "public function store()\n\t{\n//\t\t$validator = Validator::make($data = Input::all(), Subscription::$rules);\n\n//\t\tif ($validator->fails())\n//\t\t{\n//\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n//\t\t}\n//\t\tSubscription::create($data);\n\n $serviceId = Input::get('service_name');\n// $clientName = Client::findOrNew(null,['name' => Input::get('client_name')]);\n $clientName = Client::firstOrCreate(['name' => Input::get('client_name')]);\n if($clientName instanceof \\Illuminate\\Database\\Eloquent\\Model ){\n $clientName->save();\n $clientName->services()->sync([intval($serviceId+1) ]);\n $period = 0;\n switch(intval(Input::get('period'))){\n case 1:\n $period = Cb::now()->addMonth();\n break;\n case 6:\n $period = Cb::now()->addMonths(6);\n break;\n case 12:\n $period = Cb::now()->addMonths(12);\n break;\n\n }\n $clientName->services()->updateExistingPivot(intval($serviceId+1), [ 'expires_at' => $period ]);\n\n }\n return Redirect::route('subscriptions.index');\n\t}", "public function store(Request $request)\n {\n //\n\n\n\n // $brands = new Subscriptions( $request->all());\n Subscriptions::create($request->all());\n return view('backend.subscriptions.create');\n\n\n }", "public function store(SubscribeRequest $request)\n {\n $this->subscribes->create($request);\n setMessage('message','success',\"Create Successfully\");\n return redirect()->route('subscribe.index');\n }", "public function postAdd() {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ()) {\n $isCreated = true;\n $this->request->session ()->flash ( StringLiterals::SUCCESS, trans ( 'cms::subscription.add.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.add.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.add.error' ) );\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public function createAsync($create_subscription_request)\n {\n return $this->createAsyncWithHttpInfo($create_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function defaultSubscription($user){\n\n $subscription = $user->subscriptions()->create([\n 'subscription_category_id' => SubscriptionCategory::where('subscription_category', 2)->first()->id,\n 'subscription_status_id' => SubscriptionStatus::where('status_code', 1)->first()->id\n ]);\n\n $this->setSubscriptionDetails($subscription);\n\n }", "private function createCreateForm(SubscriptionBase $entity)\n {\n $form = $this->createForm(new SubscriptionBaseType(), $entity, array(\n 'action' => $this->generateUrl('admin_subscriptions_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function store(CreateSubscriberRequest $request)\n\t{\n\t\t$input = $request->all();\n\t\t$input['email'] = strtolower($input['email']);\n\n\t\t// Check whether subscriber exists\n\t\tif (Subscriber::where('email', $input['email'])->count() > 0) {\n\t\t\t// Fetch the subscriber from the database\n\t\t\t$subscriber = Subscriber::where('email', $input['email'])->firstOrFail();\n\n\t\t\t// If the subscriber isn't verified, resend verification email with new nonce\n\t\t\tif (!$subscriber->verified) {\n\t\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t\t$subscriber->save();\n\n\t\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If they are already subscribe, send an 'already-verified' email\n\t\t\t\t$this->sendAlreadyVerifiedEmail($subscriber);\n\t\t\t}\n\t\t} else {\n\t\t\t// Create a Subscriber\n\t\t\t$subscriber = new Subscriber($input);\n\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t$subscriber->verified = False;\n\t\t\t$subscriber->save();\n\n\t\t\t// Send a verification email\n\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t}\n\n\t\treturn view('subscribers/sent');\n\t}", "protected function _processTransactionSubscriptionCreated($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'New subscription #' . $subscriptionData[0]['id'] . ' created',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_created',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function create()\n {\n return view('table.subscribers.create');\n }", "function register_subscription ($user_id, $subscription) {\n global $sql;\n if (empty($subscription['note']) || $subscription['note']['status'] !== 'COMPLETED') {\n return false;\n }\n $result = false;\n $current = $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n if (!empty($current)) {\n if($subscription['subscription_type'] <= $current[0]['subscription_type']) {\n $days_remaining = strtotime($current[0]['end_date']) > time() ? date_diff(date_create($current[0]['end_date']), date_create(date('Y-m-d H:i:s')))->format('%a') : 0;\n $end_date = $subscription['end_date'];\n $subscription['end_date'] = date('Y-m-d H:i:s', strtotime(\"{$end_date} + {$days_remaining} days\"));\n }\n $result = $sql->sql_update('subscription', $subscription, ['user_id' => $user_id]);\n } else {\n $result = $sql->sql_insert('subscription', $subscription);\n }\n $user = $sql->sql_select_array_query(\"SELECT email FROM `user` WHERE id = '{$user_id}' LIMIT 1\");\n if (count($user) === 1) {\n $this->send_email(\n EMAIL['email'], \n $user[0]['email'], \n 'Thank you for subscribing on IPTV-Tools.com', \n $this->subscription_body(date('j M Y', strtotime($subscription['end_date'])))\n );\n }\n return $result;\n }", "function _insertSubscription(&$subscription) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('INSERT INTO subscriptions\n\t\t\t\t(journal_id, user_id, type_id, date_start, date_end, date_reminded_before, date_reminded_after, status, membership, reference_number, notes)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, %s, %s, %s, %s, ?, ?, ?, ?)',\n\t\t\t\t$this->dateToDB($subscription->getDateStart()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateEnd()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedBefore()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedAfter())\n\t\t\t), array(\n\t\t\t\t$subscription->getJournalId(),\n\t\t\t\t$subscription->getUserId(),\n\t\t\t\t$subscription->getTypeId(),\n\t\t\t\t$subscription->getStatus(),\n\t\t\t\t$subscription->getMembership(),\n\t\t\t\t$subscription->getReferenceNumber(),\n\t\t\t\t$subscription->getNotes()\n\t\t\t)\n\t\t);\n\n\t\t$subscriptionId = $this->getInsertSubscriptionId();\n\t\t$subscription->setId($subscriptionId);\n\n\t\treturn $subscriptionId;\n\t}", "public function createNewSubscription()\n\t{\n \n \n\t\t// Fetch state and validation variables\n\t\t$state = $this->getStateVariables();\n\t\t$validation = $this->getValidation();\n\n\t\t// Step #1.a. Check that the form is valid\n\t\t// ----------------------------------------------------------------------\n\t\t$isValid = $this->isValid();\n\n\t\tif(!$isValid) return false;\n\n\t\t// Step #1.b. Check that the subscription level is allowed\n\t\t// ----------------------------------------------------------------------\n\n\t\t// Is this actually an allowed subscription level?\n\t\t$allowedLevels = FOFModel::getTmpInstance('Levels','AkeebasubsModel')\n\t\t\t->only_once(1)\n\t\t\t->enabled(1)\n\t\t\t->getItemList();\n\t\t$allowed = false;\n\t\tif(count($allowedLevels)) foreach($allowedLevels as $l) {\n\t\t\tif($l->akeebasubs_level_id == $state->id) {\n\t\t\t\t$allowed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!$allowed) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Fetch the level's object, used later on\n\t\t$level = FOFModel::getTmpInstance('Levels', 'AkeebasubsModel')\n\t\t\t->getItem($state->id);\n\n\t\t// Step #2. Check that the payment plugin exists or return false\n\t\t// ----------------------------------------------------------------------\n\t\t$plugins = $this->getPaymentPlugins();\n\t\t$found = false;\n\t\tif(!empty($plugins)) {\n\t\t\tforeach($plugins as $plugin) {\n\t\t\t\tif($plugin->name == $state->paymentmethod) {\n\t\t\t\t\t$found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!$found) return false;\n\n\t\t// Reset the session flag, so that future registrations will merge the\n\t\t// data from the database\n\t\tJFactory::getSession()->set('firstrun', true, 'com_akeebasubs');\n\n\t\t// Step #3. Create or update a user record\n\t\t// ----------------------------------------------------------------------\n\t\t$user = JFactory::getUser();\n\t\t$this->setState('user', $user);\n\t\t$userIsSaved = $this->updateUserInfo(true, $level);\n\n\t\tif(!$userIsSaved) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$user = $this->getState('user', $user);\n\t\t}\n \n \n \n // reset credit ballance to zero for user if his subscription was expire\n require_once JPATH_ROOT . '/components/com_member/models/credit.php';\n $credit_model = new MemberModelCredit();\n require_once JPATH_ROOT . '/components/com_member/models/billing.php';\n $billing_model = new MemberModelBilling();\n // burn all credits only if user is not new and his subscription expire\n $subscription = $billing_model->getUserSubscriptionData($user->id);\n $checkIfUserWasSubscribedBefore = $billing_model->checkIfUserWasSubscribedBefore($user_id);\n if($checkIfUserWasSubscribedBefore) {\n $subscriptionExpired = $billing_model->checkIfSubscriptionIsExpired($subscription);\n if($subscriptionExpired) {\n $billing_model->setToZeroUserCreditBallance($user->id);\n }\n }\n // \n \n\n\t\t// Step #4. Create or add user extra fields\n\t\t// ----------------------------------------------------------------------\n\t\t// Find an existing record\n\t\t$dummy = $this->saveCustomFields();\n\n\t\t// Step #5. Check for existing subscription records and calculate the subscription expiration date\n\t\t// ----------------------------------------------------------------------\n\t\t// First, the question: is this level part of a group?\n\t\t$haveLevelGroup = false;\n\t\tif($level->akeebasubs_levelgroup_id > 0) {\n\t\t\t// Is the level group published?\n\t\t\t$levelGroup = FOFModel::getTmpInstance('Levelgroups', 'AkeebasubsModel')\n\t\t\t\t->getItem($level->akeebasubs_levelgroup_id);\n\t\t\tif($levelGroup instanceof FOFTable) {\n\t\t\t\t$haveLevelGroup = $levelGroup->enabled;\n\t\t\t}\n\t\t}\n\n\t\tif($haveLevelGroup) {\n\t\t\t// We have a level group. Get all subscriptions for all levels in\n\t\t\t// the group.\n\t\t\t$subscriptions = array();\n\t\t\t$levelsInGroup = FOFModel::getTmpInstance('Levels', 'AkeebasubsModel')\n\t\t\t\t->levelgroup($level->akeebasubs_levelgroup_id)\n\t\t\t\t->getList(true);\n\t\t\tforeach($levelsInGroup as $l) {\n\t\t\t\t$someSubscriptions = FOFModel::getTmpInstance('Subscriptions','AkeebasubsModel')\n\t\t\t\t\t->user_id($user->id)\n\t\t\t\t\t->level($l->akeebasubs_level_id)\n\t\t\t\t\t->enabled(1)\n\t\t\t\t\t->getList(true);\n\t\t\t\tif(count($someSubscriptions)) {\n\t\t\t\t\t$subscriptions = array_merge($subscriptions, $someSubscriptions);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No level group found. Get subscriptions on the same level.\n\t\t\t$subscriptions = FOFModel::getTmpInstance('Subscriptions','AkeebasubsModel')\n\t\t\t\t->user_id($user->id)\n\t\t\t\t->level($state->id)\n\t\t\t\t->enabled(1)\n\t\t\t\t->getList(true);\n\t\t}\n\n\n\n\t\t$jNow = new JDate();\n\t\t$now = $jNow->toUnix();\n\t\t$mNow = $jNow->toSql();\n\n\t\tif(empty($subscriptions)) {\n\t\t\t$startDate = $now;\n\t\t} else {\n\t\t\t$startDate = $now;\n\t\t\tforeach($subscriptions as $row) {\n\t\t\t\t// Only take into account active subscriptions\n\t\t\t\tif(!$row->enabled) continue;\n\t\t\t\t// Calculate the expiration date\n\t\t\t\t$jDate = new JDate($row->publish_down);\n\t\t\t\t$expiryDate = $jDate->toUnix();\n\t\t\t\t// If the subscription expiration date is earlier than today, ignore it\n\t\t\t\tif($expiryDate < $now) continue;\n\t\t\t\t// If the previous subscription's expiration date is later than the current start date,\n\t\t\t\t// update the start date to be one second after that.\n\t\t\t\tif($expiryDate > $startDate) {\n\t\t\t\t\t$startDate = $expiryDate + 1;\n\t\t\t\t}\n\t\t\t\t// Also mark the old subscription as \"communicated\". We don't want\n\t\t\t\t// to spam our users with subscription renewal notices or expiration\n\t\t\t\t// notification after they have effectively renewed!\n\t\t\t\tFOFModel::getTmpInstance('Subscriptions','AkeebasubsModel')\n\t\t\t\t\t->setId($row->akeebasubs_subscription_id)\n\t\t\t\t\t->getItem()\n\t\t\t\t\t->save(array(\n\t\t\t\t\t\t'contact_flag' => 3\n\t\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\t// Step #6. Create a new subscription record\n\t\t// ----------------------------------------------------------------------\n\t\t$nullDate = JFactory::getDbo()->getNullDate();\n\t\t$level = FOFModel::getTmpInstance('Levels','AkeebasubsModel')\n\t\t\t->setId($state->id)\n\t\t\t->getItem();\n\t\tif($level->forever)\n\t\t{\n\t\t\t$jStartDate = new JDate();\n\t\t\t$endDate = '2038-01-01 00:00:00';\n\t\t}\n\t\telseif(!is_null($level->fixed_date) && ($level->fixed_date != $nullDate))\n\t\t{\n\t\t\t$jStartDate = new JDate();\n\t\t\t$endDate = $level->fixed_date;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$jStartDate = new JDate($startDate);\n\t\t\t$duration = (int)$level->duration * 3600 * 24;\n\t\t\t$endDate = $startDate + $duration;\n\t\t}\n\n\t\t$mStartDate = $jStartDate->toSql();\n\t\t$jEndDate = new JDate($endDate);\n\t\t$mEndDate = $jEndDate->toSql();\n\n\t\t// Get the affiliate ID and make sure it exists and that it's enabled\n\t\t$session = JFactory::getSession();\n\t\t$affid = $session->get('affid', 0);\n \n //get afiiliate user_id on affiliate username\n $db = &JFactory::getDbo();\n $query1 = \"SELECT id FROM #__users WHERE username='$affid'\";\n $db->setQuery($query1);\n $affid = $db->loadResult();\n //var_dump($affid);\n /*\n\t\tif($affid > 0) {\n\t\t\t$affiliate = FOFModel::getTmpInstance('Affiliates','AkeebasubsModel')\n\t\t\t\t->setId($affid)\n\t\t\t\t->getItem();\n\t\t\tif($affiliate->akeebasubs_affiliate_id == $affid) {\n\t\t\t\tif(!$affiliate->enabled) $affid = 0;\n\t\t\t} else {\n\t\t\t\t$affid = 0;\n\t\t\t}\n\t\t}\n die($affid);\n */\n \n\t\t$aff_comission = 0;\n\t\tif($affid > 0) {\n\t\t\t$aff_comission = $validation->price->net * $affiliate->comission / 100;\n\t\t}\n\n\t\t// Store the price validation's \"oldsub\" and \"expiration\" keys in\n\t\t// the subscriptions subcustom array\n\t\t$subcustom = $state->subcustom;\n\t\tif (empty($subcustom))\n\t\t{\n\t\t\t$subcustom = array();\n\t\t}\n\t\telseif (is_object($subcustom))\n\t\t{\n\t\t\t$subcustom = (array)$subcustom;\n\t\t}\n\t\t$priceValidation = $this->_validatePrice();\n\t\t$subcustom['fixdates'] = array(\n\t\t\t'oldsub'\t\t=> $priceValidation->oldsub,\n\t\t\t'allsubs'\t\t=> $priceValidation->allsubs,\n\t\t\t'expiration'\t=> $priceValidation->expiration,\n\t\t);\n\n\t\t// Serialise custom subscription parameters\n\t\t$custom_subscription_params = json_encode($subcustom);\n \n\t\t// Setup the new subscription\n\t\t$data = array(\n\t\t\t'akeebasubs_subscription_id' => null,\n\t\t\t'user_id'\t\t\t\t=> $user->id,\n\t\t\t'akeebasubs_level_id'\t=> $state->id,\n\t\t\t'publish_up'\t\t\t=> $mStartDate,\n\t\t\t'publish_down'\t\t\t=> $mEndDate,\n\t\t\t'notes'\t\t\t\t\t=> '',\n\t\t\t'enabled'\t\t\t\t=> ($validation->price->gross < 0.01) ? 1 : 0,\n\t\t\t'processor'\t\t\t\t=> ($validation->price->gross < 0.01) ? 'none' : $state->paymentmethod,\n\t\t\t'processor_key'\t\t\t=> ($validation->price->gross < 0.01) ? $this->_uuid(true) : '',\n\t\t\t'state'\t\t\t\t\t=> ($validation->price->gross < 0.01) ? 'C' : 'N',\n\t\t\t'net_amount'\t\t\t=> $validation->price->net - $validation->price->discount,\n\t\t\t'tax_amount'\t\t\t=> $validation->price->tax,\n\t\t\t'gross_amount'\t\t\t=> $validation->price->gross,\n\t\t\t'tax_percent'\t\t\t=> $validation->price->taxrate,\n\t\t\t'created_on'\t\t\t=> $mNow,\n\t\t\t'params'\t\t\t\t=> $custom_subscription_params,\n\t\t\t'akeebasubs_coupon_id'\t=> $validation->price->couponid,\n\t\t\t'akeebasubs_upgrade_id'\t=> $validation->price->upgradeid,\n\t\t\t'contact_flag'\t\t\t=> 0,\n\t\t\t'prediscount_amount'\t=> $validation->price->net,\n\t\t\t'discount_amount'\t\t=> $validation->price->discount,\n\t\t\t'first_contact'\t\t\t=> '0000-00-00 00:00:00',\n\t\t\t'second_contact'\t\t=> '0000-00-00 00:00:00',\n\t\t\t'akeebasubs_affiliate_id' => $affid,\n\t\t\t'affiliate_comission'\t=> $aff_comission\n\t\t);\n\n\t\t$subscription = FOFModel::getTmpInstance('Subscriptions','AkeebasubsModel')\n\t\t\t->getTable();\n\t\t$subscription->reset();\n\t\t$subscription->akeebasubs_subscription_id = 0;\n\t\t$subscription->_dontCheckPaymentID = true;\n\t\t$result = $subscription->save($data);\n \n //var_dump($subscription->akeebasubs_subscription_id);\n //die('test');\n\t\t$this->_item = $subscription;\n \n /**\n * create payment date table \n */\n \n $db = &JFactory::getDbo();\n $query = \"SELECT id FROM #__akeebasubs_payment_data WHERE user_id='$subscription->user_id'\";\n $db->setQuery($query);\n $payment_data = $db->loadResult();\n if(!$payment_data) {\n $object = new stdClass();\n $object->user_id = $subscription->user_id;\n $db->insertObject('#__akeebasubs_payment_data', $object, 'id');\n }\n //\n \n \n \n \n \n\n\t\t// Step #7. Hit the coupon code, if a coupon is indeed used\n\t\t// ----------------------------------------------------------------------\n\t\tif($validation->price->couponid) {\n\t\t\tFOFModel::getTmpInstance('Coupons','AkeebasubsModel')\n\t\t\t\t->setId($validation->price->couponid)\n\t\t\t\t->getItem()\n\t\t\t\t->hit();\n\t\t}\n\n\t\t// Step #8. Clear the session\n\t\t// ----------------------------------------------------------------------\n\t\t$session = JFactory::getSession();\n\t\t$session->set('validation_cache_data', null, 'com_akeebasubs');\n\n\t\t// Step #9. Call the specific plugin's onAKPaymentNew() method and get the redirection URL,\n\t\t// or redirect immediately on auto-activated subscriptions\n\t\t// ----------------------------------------------------------------------\n\t\tif($subscription->gross_amount != 0) {\n\t\t\t// Non-zero charges; use the plugins\n\t\t\t$app = JFactory::getApplication();\n\t\t\t$jResponse = $app->triggerEvent('onAKPaymentNew',array(\n\t\t\t\t$state->paymentmethod,\n\t\t\t\t$user,\n\t\t\t\t$level,\n\t\t\t\t$subscription\n\t\t\t));\n\t\t\tif(empty($jResponse)) return false;\n\n\t\t\tforeach($jResponse as $response) {\n\t\t\t\tif($response === false) continue;\n\n\t\t\t\t$this->paymentForm = $response;\n\t\t\t}\n\t\t} else {\n\t\t\t// Zero charges; just redirect\n\t\t\t$app = JFactory::getApplication();\n\t\t\t$slug = FOFModel::getTmpInstance('Levels','AkeebasubsModel')\n\t\t\t\t->setId($subscription->akeebasubs_level_id)\n\t\t\t\t->getItem()\n\t\t\t\t->slug;\n\t\t\t$app->redirect( str_replace('&amp;','&', JRoute::_('index.php?option=com_akeebasubs&layout=default&view=message&slug='.$slug.'&layout=order&subid='.$subscription->akeebasubs_subscription_id)) );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Return true\n\t\t// ----------------------------------------------------------------------\n\t\treturn true;\n\t}", "protected function createSubscriptionPayment(array $data, Currency $currency): SubscriptionPayment\n {\n $this->configureStripeClient();\n return new SubscriptionPayment([\n 'paymentAmount' => $data['amount_due'] / (10 ** $currency->minorUnit),\n 'paymentCurrency' => $currency,\n 'paymentDate' => $data['created'],\n 'paymentReference' => $data['charge'],\n 'paid' => $data['paid'],\n 'response' => Json::encode($data),\n ]);\n }", "public function stripeSubscribe(Request $request)\n {\n $this->validate($request, [\n 'plan_id' => 'string|required',\n 'payment_method_id' => 'string|required',\n ]);\n\n // Create New Stripe customer\n if (is_null(auth()->user()->stripe_id) || empty(auth()->user()->stripe_id)) {\n $name = auth()->user()->fullname ? auth()->user()->email : null;\n $address = [\n 'line1' => '510 Townsend St',\n 'postal_code' => '98140',\n 'city' => 'San Francisco',\n 'state' => 'CA',\n 'country' => 'US',\n ];\n $email = (auth()->user()->email) ? auth()->user()->email : null;\n $customer = $this->stripeCustomer->createSubscriptionCustomer($name,$email,$address,$request->payment_method_id);\n }\n //stripe customer id\n $customer_id = auth()->user()->stripe_id;\n\n // Subscribe customer to a plan\n $subscription = $this->stripeCustomer->createSubscription($request->plan_id, $customer_id, $request->trial_period);\n\n $sub = Subscriptions::create([\n 'user_id' => auth()->user()->id,\n 'customer_id' => $subscription->customer,\n 'subscription_id' => $subscription->id,\n 'subscription_amount' => $subscription->plan->amount,\n 'plan_name' => $subscription->plan->nickname,\n 'subscription_start_date' => date('Y-m-d h:i:s', $subscription->current_period_start),\n 'subscription_end_date' =>date('Y-m-d h:i:s', $subscription->current_period_end),\n 'subscription_trial_period' => date('Y-m-d h:i:s', $subscription->trial_end),\n ]);\n\n if ($subscription && $sub) {\n $response = \"successful\";\n return json_encode($response);\n } else {\n $response = \"failed\";\n return json_encode($response);\n }\n }", "public function makeSubscription()\n {\n\n $url = Credentials::getCredentials('/pre-approvals');\n\n $response = Http::withHeaders([\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1'\n ])\n ->post($url, [\n 'plan' => $this->data['plan_reference'],\n 'sender' => [\n 'name' => 'Teste Usuário Sender',\n 'email' => '[email protected]',\n 'hash' => $this->data['senderHash'],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ],\n 'address' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ]\n ],\n 'paymentMethod' => [\n 'type' => 'CREDITCARD',\n 'creditCard' => [\n 'token' => $this->data['token'],\n 'holder' => [\n 'name' => 'Customer Credit Name',\n 'birthDate' => '30/10/1990',\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ],\n 'billingAddress' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ]\n ]\n\n ]\n ]\n ]);\n\n return $response->json();\n }", "public function create(string $customerId, array $parameters = []): ApiResponse\n {\n $parameters['customer'] = $customerId;\n\n return $this->_post('subscriptions', $parameters);\n }", "public function create()\n {\n //\n return view('purchase.asns.create');\n }", "function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }", "public function createSubscriber();", "public function record_subscription_payment() { }", "public function newAction()\n {\n $entity = new SubscriptionBase();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function store()\n\t{\n\t\t$subscriptionPlan = $this->subscriptionPlans->createForShop();\n\n\t\treturn redirect($subscriptionPlan->confirmation_url);\n\t}", "public function setSubscription(array $data)\n {\n $returnValue = false;\n\n // check if subscription id exists\n if (!isset($data['id'])) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'ID must be set before attempting a save'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $data['id']\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription has properties update the changed one's\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n $createdTimePropertyUri = $this->_subscriptionConfig->get($this->_propertyMatching['created_time']);\n $data['created_time'] = $subscriptionResourceProperties[$createdTimePropertyUri][0]['content'];\n\n // get the current time\n $now = new Zend_Date;\n\n // if lease seconds is set to the subscription, calculate a new expiration time\n if (isset($data['lease_seconds'])) {\n $data['expiration_time'] = $now\n ->add($data['lease_seconds'], Zend_Date::SECOND)\n ->get('yyyy-MM-dd HH:mms');\n }\n\n // generate new add and delete statements from subscriber data array\n $statements = $this->_generateStatements(\n $subscriptionResourceUri,\n $data,\n $subscriptionResourceProperties\n );\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_UPDATE_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add and delete the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n $this->_selectedModelInstance->deleteMultipleStatements($statements['deleteStatements']);\n\n $returnValue = false;\n // if the subscription has now proberties only add the properties\n } else {\n // generate the add statements\n $statements = $this->_generateStatements($subscriptionResourceUri, $data);\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_ADD_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n\n $returnValue = true;\n }\n\n // end versioning\n $this->_versioning->endAction();\n\n return $returnValue;\n }", "public function create()\n\t{\n $services = Service::all(['name', 'id'])->toArray();\n //fetches name from the array ...\n $services = array_fetch($services, 'name');\n// dd($services);\n\t\treturn View::make('subscriptions.create', compact('services'));\n\t}", "public function newSubscription($subscription, Plan $plan, $dont_start = false): PlanSubscription\n {\n $trial = new Period($plan->trial_interval, $plan->trial_period, now());\n $period = new Period($plan->invoice_interval, $plan->invoice_period, $trial->getEndDate());\n\n return $this->subscriptions()->create([\n 'name' => $subscription,\n 'slug' => $subscription,\n 'plan_id' => $plan->getKey(),\n 'trial_ends_at' => $trial->getEndDate(),\n 'starts_at' => $dont_start ? null : $period->getStartDate(),\n 'ends_at' => $dont_start ? null : $period->getEndDate(),\n ]);\n }", "public function createSubscriber()\n {\n return view('add-subscriber');\n }", "public function store(SubscriptionStoreRequest $request)\n {\n try {\n $subscription = ($user = $request->user())->newSubscription('main', $request->plan);\n\n if($request->has('coupon')) {\n $subscription->withCoupon($request->coupon);\n }\n\n $subscription->create($request->payment_method, [\n 'email' => $user->email,\n ]);\n } catch (IncompletePayment $exception) {\n return redirect()->route(\n 'cashier.payment',\n [$exception->payment->id, 'redirect' => route('account.subscriptions.index')]\n );\n }\n\n return redirect()->route('account.dashboard')->withSuccess(__('Thank you. Your subscription is now active.'));\n }", "public function saveSubscription()\n {\n $email = $this->request->getParam('email');\n $jsonFactory = $this->jsonFactory->create();\n\n $subscribed_text = $this->helperData->getGeneralConfig(\"is_subscribed_text\");\n $thanksyou_text = $this->helperData->getGeneralConfig(\"thanksyou_text\");\n $confirm_text = $this->helperData->getGeneralConfig(\"confirm_text\");\n\n $subscribed_text = $subscribed_text ? $subscribed_text : __('This email address is already subscribed.');\n $thanksyou_text = $thanksyou_text ? $thanksyou_text : __('Thank you for your subscription.');\n $confirm_text = $confirm_text ? $confirm_text : __('The confirmation request has been sent.');\n\n try {\n $this->validateEmailFormat($email);\n $this->validateGuestSubscription();\n $this->validateEmailAvailable($email);\n\n $subscriber = $this->_subscriberFactory->create()->loadByEmail($email);\n if ($subscriber->getId()\n && $subscriber->getSubscriberStatus() == \\Magento\\Newsletter\\Model\\Subscriber::STATUS_SUBSCRIBED\n ) {\n $jsonData = [\n 'status' => 'error',\n 'message' => $subscribed_text\n ];\n\n return $jsonFactory->setData($jsonData);\n }\n\n $status = $this->_subscriberFactory->create()->subscribe($email);\n\n if ($status == \\Magento\\Newsletter\\Model\\Subscriber::STATUS_NOT_ACTIVE) {\n $jsonData = [\n 'status' => 'success',\n 'message' => $confirm_text\n ];\n } else {\n $jsonData = [\n 'status' => 'success',\n 'message' => $thanksyou_text\n ];\n }\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $jsonData = [\n 'status' => 'error',\n 'message' => __('There was a problem with the subscription: %1', $e->getMessage())\n ];\n } catch (\\Exception $e) {\n $jsonData = [\n 'status' => 'error',\n 'message' => __('Something went wrong with the subscription.')\n ];\n }\n\n return $jsonFactory->setData($jsonData);\n }", "public function subscription_create($customerId, $planId){\n\t\t$params = array(\n\t\t\t'planId' => $planId,\n\t\t\t'customerId' => $customerId,\n\t\t);\n\t\t\n\t\t$flow = $this->send('subscription/create', $params, 'POST');\t\t\n\t\t$response = array(\n\t\t\t'subscriptionId' => $flow['subscriptionId'],\n\t\t\t'planId' => $flow['planId'],\n\t\t\t'plan_name' => $flow['plan_name'],\n\t\t\t'customerId' => $flow['customerId'],\n\t\t\t'created' => $flow['created'],\n\t\t\t'subscription_start' => $flow['subscription_start'],\n\t\t\t'subscription_end' => $flow['subscription_end'],\n\t\t\t'period_start' => $flow['period_start'],\n\t\t\t'period_end' => $flow['period_end'],\n\t\t\t'next_invoice_date' => $flow['next_invoice_date'],\n\t\t\t'trial_period_days' => $flow['trial_period_days'],\n\t\t\t'trial_start' => $flow['trial_start'],\n\t\t\t'trial_end' => $flow['trial_end'],\n\t\t\t'cancel_at_period_end' => $flow['cancel_at_period_end'],\n\t\t\t'cancel_at' => $flow['cancel_at'],\n\t\t\t'periods_number' => $flow['periods_number'],\n\t\t\t'days_until_due' => $flow['days_until_due'],\n\t\t\t'status' => $flow['status'],\n\t\t\t'morose' => $flow['morose'],\n\t\t\t'discount' => $flow['discount'],\n\t\t\t'invoices' => $flow['invoices']\n\t\t);\n\t\treturn $response['customerId'];\n\t}", "public function store(StoreTenantRequest $request){\n DB::beginTransaction();\n try {\n $createdTenant = Tenant::create([\n 'id'=> $request->id ,\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request['password']),\n 'status' => $request->status,\n 'number_of_branches' => $request->number_of_branches,\n 'subscription_price' => $request->subscription_price,\n 'subscription_period_in_days' => $request->subscription_period_in_days,\n //'subscription_date' => $request->subscription_date,\n //'subscription_end_date' => $request->subscription_end_date,\n ]);\n $createdTenant->domains()->create(['domain' => $request->domain]);\n\n MailController::SendWelcomeMail($createdTenant);\n MailController::SendRequestApprovedEmail($createdTenant);\n return response()->json(['NewSubscriber'=>$createdTenant],200);\n DB::commit();\n } catch (\\Exception $e) {\n return response()->json(['Error'=>$e],500);\n\n DB::rollback();\n }\n }", "public function onSubscriptionCreate(SubscriptionInterface $subscription, OrderItemInterface $order_item);", "public function createTopicAndSubscription(string $topicName, string $subscriptionName, string $type): PubSubService\n {\n if (!$this->validName($topicName) || ('pull' == $type && !$this->validName($subscriptionName))) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'The Resource name (topic or subscription) has not a valid format see https://cloud.google.com/pubsub/docs/admin#resource_names for more information.', 'HTTP_CONFLICT')));\n }\n\n $topic = $this->pubSubClient()->topic($topicName);\n\n if (!$topic->exists()) {\n $topic = $this->createTopic($topicName);\n if ($this->getTopicFullName() == $topic) {\n $subscription = $this->pubSubClient()->subscription($subscriptionName);\n\n if ('pull' == $type) {\n if (!$subscription->exists()) {\n $topic = $this->createSubscription($topicName, $subscriptionName);\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n } else {\n if (!$subscription->exists()) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" not exist, add a new subscription in the GCP Console by specify the push method.', 'HTTP_CONFLICT')));\n }\n }\n\n $this->setTopicFullName($topicName);\n $this->setSubscriptionFullName($subscriptionName);\n\n $this->_setInfo();\n\n return $this;\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" not exist, there was an error during topic creation.', 'HTTP_CONFLICT')));\n }\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n }", "public function __construct()\n {\n $this->subscription = new Subscription();\n }", "public function create($data = array())\n {\n $matches = array();\n preg_match('/([^@]+)$/', $data['email'], $matches);\n $data['domain'] = $matches[1];\n $table = $this->getTable(); \n $this->_subscriberId = $table->insert($data); \n return $this->_subscriberId;\n }", "function create_subscription_token($data){\n // $n = convert_timezone(strtotime(\"now\"), true, true,false,\"m/d/Y h:i:sP\");\n // $now = new DateTime($n);\n // $now->format(\"m/d/Y h:i:sP\");\n $plandata = $this->get_plan_name($data->planId);\n if($data->addOnId != ''){\n $result = Braintree_Subscription::create([\n 'paymentMethodToken' => $data->paymentMethodToken,\n 'planId' => $data->planId,\n 'addOns' => [\n 'add' => [\n [\n 'inheritedFromId' => $data->addOnId,\n 'neverExpires' => true,\n 'quantity' => $data->quantity\n ] \n ] \n ],\n 'descriptor' => [\n //'name' => \"TRACKER*\".$plandata['description']\n 'name' => \"TRCKRTR*PLAN\"\n ]\n // 'firstBillingDate' => $now,\n // 'options' => ['startImmediately' => true]\n ]);\n // if($result){\n // return $result;\n // }else{\n // // $error = \"\";\n // // // foreach($result->errors->deepAll() AS $error) {\n // // // $error .= $error->code . \": \" . $error->message . \"\\n\";\n // // // //echo($error->code . \": \" . $error->message . \"\\n\");\n // // // }\n // return $error;\n // }\n }else{\n $result = Braintree_Subscription::create([\n 'paymentMethodToken' => $data->paymentMethodToken,\n 'planId' => $data->planId,\n 'descriptor' => [\n //'name' => \"TRACKER*\".$plandata['description']\n\n 'name' => \"TRCKRTR*PLAN\"\n ]\n // 'firstBillingDate' => $now,\n // 'options' => ['startImmediately' => true]\n ]);\n }\n\n return $result;\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "public function subscribe($subscriber, $startDateTime = null, $createInvoice = true, $user = null) {\n\t\tif ($this->isNewRecord) throw new \\Exception('Subscription package is not yet saved. ');\n\t\t\t\n\t\tif ($subscriber instanceof User) {\n\t\t\t$user = $subscriber;\n\t\t\tif (!$user->id) throw new \\Exception('User is not an valid user. ');\n\t\n\t\t\t$billTo = $user;\n\t\t} else if ($subscriber instanceof Organization || $subscriber instanceof OldOrganizationClass) {\n\t\t\t$organization = $subscriber;\n\t\t\tif (!$organization->id) throw new \\Exception('Organization is not an valid organization. ');\n\t\t\t$billTo = $organization;\n\t\t} else {\n\t\t\tthrow new \\Exception('Subscriber must be instance of either User or Organization. ');\n\t\t}\n\t\t\n\t\t$items = SubscriptionPackageItem::findAll(['package_id' => $this->id]);\n\t\t\n\t\t$transaction = Yii::$app->db->beginTransaction();\n\t\t\n\t\ttry {\n\t\t\tif ($createInvoice) {\n\t\t\t\tif (!isset($user->profile->contact)) throw new \\Exception('Cannot issue invoice to user (user ID: '.$user->id.') without default contact info. ');\n\n\t\t\t\t$invoice = Invoice::createFromBillableItem($this, $billTo);\n\t\t\t}\n\t\t\t\n\t\t\t$bundle = new SubscriptionBundle;\n\t\t\t$bundle->attributes = $this->attributes;\n\t\t\t$bundle->invoice_id = isset($invoice) ? $invoice->id : null;\n\t\t\t$bundle->package_id = $this->id;\n\t\t\t$bundle->organization_id = isset($organization) ? $organization->id : null;\n\t\t\tif (!$bundle->save()) throw new \\Exception('Failed to create bundle. '.print_r($bundle->errors, 1));\n\t\t\t\n\t\t\tforeach ($items as $item) {\n\t\t\t\t\n\t\t\t\t$subscription = new Subscription;\n\t\t\t\t$subscription->bundle_id = $bundle->id;\n\t\t\t\t\n\t\t\t\t$subscription->attributes = [\n\t\t\t\t\t'subscription_identity' => $item->subscription_identity,\n\t\t\t\t\t'price' => $this->price,\n\t\t\t\t\t'purchased_unit' => $item->unit,\n\t\t\t\t\t'used_unit' => 0,\n\t\t\t\t\t'content_valid_period' => $item->content_valid_period,\n\t\t\t\t\t'content_valid_period_type' => $item->content_valid_period_type,\n\t\t\t\t\t'invoice_id' => isset($invoice) ? $invoice->id : null,\n\t\t\t\t\t'priority' => $item->priority,\n\t\t\t\t];\n\t\t\t\tif (isset($user)) $subscription->owned_by = $user->id;\n\t\t\t\t\n\t\t\t\t$subscription->package_id = $this->id;\n\t\t\t\t$subscription->owned_by = isset($user) ? $user->id : null;\n\t\t\t\t$subscription->setExpireAt($item->valid_period, $item->valid_period_type, true, $startDateTime);\n\t\t\t\t\n\t\t\t\tif (!$subscription->save()) throw new \\Exception('Failed to create subscription. '.print_r($subscription->errors, 1));\n\t\t\t}\n\t\t\t\n\t\t\t$transaction->commit();\n\t\t\t\n\t\t\treturn $bundle;\n\t\t} catch (\\Exception $ex) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $ex;\n\t\t}\n\t}", "public function addFreeSubscriptionRequest()\n {\n\n $resourcePath = '/subscriptions/saas/free';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function store(Request $request)\n {\n\n $user = $request->user();\n $plan = $request->plan;\n\n $paymentMethod = $request->payment_method;\n // create the subscription\n try {\n $user->newSubscription('default', $plan)\n ->create($paymentMethod, [\n 'name' => $user->name\n ]);\n return redirect('/dashboard')->with('status', 'Sweet job! You have successfully subscribed.');\n } catch (\\Exception $e) {\n return back()->withErrors(['message' => 'Bummer, there was an issue subscribing.']);\n }\n }", "public function saveSubscription($subscription)\n {\n $payments = new SubscriptionPayments;\n $payments->recruiter_id = Auth::user()->id;\n $payments->expiryDate = date('Y-m-d H:i:s', $subscription['current_period_end']);\n $payments->trialEnd = $payments->expiryDate;\n if ($subscription['trial_end'] != null) {\n $payments->trialEnd = date('Y-m-d H:i:s', $subscription['trial_end']);\n }\n $payments->paymentId = $subscription['id'];\n $payments->paymentResponse = json_encode($subscription);\n $payments->save();\n }", "public function create()\n {\n \n //\n }", "function addSubscription() {\r\n if(isset($_REQUEST['corp_id'])) {\r\n $arrArg=array(\r\n \"id\"=>$_SESSION['id'],\r\n \"corp_id\"=>$_REQUEST['corp_id']\r\n );\r\n $result=loadModel(\"subscription\",\"addSubscription\",$arrArg);\r\n if ($result == true) {\r\n echo \"Subscribed\";\r\n } else {\r\n echo \"Error! Try later\";\r\n }\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Subscribeclass();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createSubscriptionCustomer($name,$address,$email,$payment_method)\n {\n $customer = \\Stripe\\Customer::create([\n 'name' => $name,\n 'address' => $address,\n 'email' => $email,\n 'payment_method' => $payment_method,\n 'invoice_settings' => [\n 'default_payment_method' => $payment_method,\n ],\n ]);\n\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_id = $customer->id;\n $user->save();\n\n return $customer;\n }", "public function create()\n {\n //TODO\n }", "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 subscription($name)\n {\n return $this->subscriptionFactory($name);\n }" ]
[ "0.78620964", "0.74412364", "0.71910346", "0.7108687", "0.7087301", "0.700485", "0.694343", "0.6895691", "0.6764189", "0.6710562", "0.66451645", "0.6636957", "0.6564832", "0.65515083", "0.6480991", "0.6454733", "0.6450996", "0.6395456", "0.63853854", "0.6379672", "0.6367608", "0.63538134", "0.6298206", "0.62888867", "0.6288105", "0.62832624", "0.6281341", "0.62765974", "0.6262525", "0.6250084", "0.6239862", "0.6231181", "0.6231153", "0.62298626", "0.6188806", "0.6186382", "0.6183903", "0.6173429", "0.61689174", "0.61492157", "0.61279124", "0.6127124", "0.6113592", "0.60672927", "0.6064437", "0.6059794", "0.60454834", "0.60381687", "0.6024472", "0.60121745", "0.5985411", "0.5979325", "0.59775305", "0.5956593", "0.5950044", "0.5942581", "0.59326774", "0.59184647", "0.5887526", "0.58872616", "0.5862819", "0.5849897", "0.57946616", "0.5790634", "0.5779271", "0.5777859", "0.57479227", "0.5722259", "0.57150644", "0.5713872", "0.5705942", "0.5698664", "0.56865394", "0.5675586", "0.56740844", "0.5649274", "0.5641761", "0.5639854", "0.5633618", "0.56138057", "0.5609802", "0.56084496", "0.5603454", "0.559919", "0.55925375", "0.55924696", "0.55890256", "0.55878216", "0.55808276", "0.5569373", "0.55669135", "0.55596817", "0.5549426", "0.5548612", "0.55341816", "0.5533848", "0.5509099", "0.55087376", "0.5497295", "0.5495491" ]
0.6078584
43
Operation createWithHttpInfo Create Subscription
public function createWithHttpInfo($create_subscription_request) { $request = $this->createRequest($create_subscription_request); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Subscription' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Subscription' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Subscription', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Subscription'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSubscription($request);", "public function createRequest($create_subscription_request)\n {\n // verify the required parameter 'create_subscription_request' is set\n if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_subscription_request when calling create'\n );\n }\n\n $resourcePath = '/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request));\n } else {\n $httpBody = $create_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "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 }", "private function subscriptionFactory($name, array $info = [])\n {\n return new Subscription(\n $this->connection,\n $this->projectId,\n $name,\n $this->name,\n $this->encode,\n $info\n );\n }", "public function create(string $customerId, array $parameters = []): ApiResponse\n {\n $parameters['customer'] = $customerId;\n\n return $this->_post('subscriptions', $parameters);\n }", "public function create(CreateSubscriberRequest $request)\n {\n // create a new object, fill with data and save\n $data = $request->toArray();\n $subscriber = new Subscriber($data);\n $subscriber->save();\n\n // save to cache\n $cacheKey = \"subscriber-{$subscriber->id}\";\n RedisCache::instance()->set($cacheKey, serialize($subscriber));\n\n return new Response(201, 'Subscriber created', $subscriber);\n }", "function createNewSubscription(array $data){\nreturn $this->post($data, \"/subscription\");\n}", "public function create()\n {\n $subscription = new Subscription();\n\n return $subscription;\n }", "public function createAction(Request $request)\n {\n $entity = new SubscriptionBase();\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('admin_subscriptions_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createSubscription($parameters) {\r\n $request = FlexmailAPI::parseArray($parameters);\r\n\r\n $response = $this->execute(\"CreateGroupSubscription\", $request);\r\n return FlexmailAPI::stripHeader($response, $this->config->get('debug_mode'));\r\n }", "public function newSubscription(array $data = [], string $name = 'default')\n {\n $trialEndsAt = null;\n if ($data['status'] === Paddle::STATUS_TRIALING) {\n $time = Carbon::parse($data['event_time'])->format('H:i:s');\n $trialEndsAt = Carbon::parse(\"{$data['next_bill_date']} {$time}\");\n }\n\n return $this->subscriptions()->create([\n 'user_id' => $this->id,\n 'name' => $name,\n 'paddle_id' => $data['subscription_id'],\n 'paddle_plan_id' => $data['subscription_plan_id'],\n 'paddle_cancel_url' => $data['cancel_url'],\n 'paddle_update_url' => $data['update_url'],\n 'paddle_status' => $data['status'],\n 'quantity' => $data['quantity'],\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null\n ]);\n }", "public function createSubscription(CustomerInterface $customer, PaymentMethodInterface $payment_method, $product_name, string $period, ...$arguments): SubscriptionInterface;", "public function addFreeSubscriptionRequest()\n {\n\n $resourcePath = '/subscriptions/saas/free';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create($create_subscription_request)\n {\n list($response) = $this->createWithHttpInfo($create_subscription_request);\n return $response;\n }", "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "function create_subscription($subscription) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Try to save the subscription\n if ( $CI->base_model->insert('subscriptions', $subscription) ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "public function createAsync($create_subscription_request)\n {\n return $this->createAsyncWithHttpInfo($create_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function create()\n {\n return view(\"admin.subscriptions.create\");\n }", "abstract public function add_subscription( Payment_Subscription $subscription );", "public function created(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'started');\n }", "public function createSubscriptionWithPaymentMethod(CreateSubscriptionWithPaymentMethodRequest $request)\n {\n $response = $this->paymentMethodService->createPaymentMethod($request);\n $request->merge([\n 'payment_method' => $response['id'],\n ]);\n\n $this->apiData = $this->subscriptionService->createSubscription($request);\n\n return $this->success();\n }", "public function create()\n {\n return view('subscription::create');\n }", "public function create()\n {\n //\n return view('backend.subscriptions.create');\n }", "public function addPassTrialSubscriptionRequest()\n {\n\n $resourcePath = '/subscriptions/paas/trial';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create()\n {\n $subscriptions = Subscription::all();\n\n return view('subscription.subscribe', compact('subscriptions'));\n }", "function createObject() {\n\t\treturn new InstitutionalSubscription();\n\t}", "public function create(CreateSubscriberDTO $details)\r\n {\r\n $details = json_decode(json_encode($details), true);\r\n $res = $this->subscriberModel->create($details);\r\n\r\n return $res;\r\n }", "protected function _processTransactionSubscriptionCreated($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'New subscription #' . $subscriptionData[0]['id'] . ' created',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_created',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "protected function createSubscriptionResponse(ApiResource $resource): SubscriptionResponseInterface\n {\n $this->configureStripeClient();\n $data = $resource->toArray();\n\n return new SubscriptionResponse($data);\n }", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "protected function _create_subscription ( array $values ){\n\n return new Payment_Subscription( $values );\n\n }", "public function postCreate(Request $request)\n {\n //echo \"dfadsf\";exit;\n \n // // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription= new Subscription();\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data inserted successfully'));\n\n }", "public function actionCreate()\n {\n $model = new UserSubscriber();\n\n $success = false;\n $msg = 'There was an error, please try again later.';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $success = true;\n $msg = 'Thank you for subscription for newsletter.';\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['success' => $success, 'msg' => $msg];\n\n }", "public function create(Request $request)\n {\n $id = $request->id;\n\n return view('subscriber.create',compact('id'));\n }", "public function create(Request $request)\n {\n $user = $request->user();\n $user->createOrGetStripeCustomer();\n if($user->subscribed()){\n return $user->redirectToBillingPortal();\n }\n\n return view('.subscription.create', [\n 'intent' => $user->createSetupIntent()\n ]);\n }", "public function cancelWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $request = $this->cancelRequest($id, $cancel_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function create(Request $request){\n\n $suscription = new Subscription([\n 'plan_id' => $request->plan_id,\n 'date_start' => Carbon::now(),\n 'date_end' => Carbon::now()->addMonths(2),\n ]);\n $suscription->save();\n $car_suscription = new CarSubscription([\n 'subscription_id' => $suscription->id,\n 'cars_id' => $request->car_id,\n ]);\n $car_suscription->save();\n return response()->json([\n 'message' => 'Creado exitosamente!'], 201);\n }", "private function createCreateForm(SubscriptionBase $entity)\n {\n $form = $this->createForm(new SubscriptionBaseType(), $entity, array(\n 'action' => $this->generateUrl('admin_subscriptions_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "protected function createBasicSubscriptionAndOrder() {\n $subscription = Subscription::create([\n 'type' => 'product_variation',\n 'store_id' => $this->store->id(),\n 'billing_schedule' => $this->billingSchedule,\n 'uid' => $this->user,\n 'payment_method' => $this->paymentMethod,\n 'purchased_entity' => $this->variation,\n 'title' => $this->variation->getOrderItemTitle(),\n 'unit_price' => new Price('2', 'USD'),\n 'state' => 'pending',\n 'starts' => \\Drupal::time()->getRequestTime() - 5,\n 'ends' => \\Drupal::time()->getRequestTime() + 1000,\n ]);\n $subscription->save();\n\n $order_storage = \\Drupal::entityTypeManager()->getStorage('commerce_order');\n $result = $order_storage->getQuery()\n ->condition('type', 'recurring')\n ->pager(1)\n ->execute();\n $this->assertEmpty($result);\n\n $subscription->getState()->applyTransition($subscription->getState()->getTransitions()['activate']);\n $subscription->save();\n\n $orders = $order_storage->loadMultiple($order_storage->getQuery()\n ->condition('type', 'recurring')\n ->execute());\n $this->assertCount(1, $orders);\n $order = reset($orders);\n\n return [$subscription, $order];\n }", "private function _setInfo(): PubSubService\n {\n $this->_info = [\n 'info' => [\n 'code' => Response::HTTP_CREATED,\n 'message' => [\n 'topicName' => $this->getTopicFullName(),\n 'subscriptionName' => $this->getSubscriptionFullName(),\n 'projectId' => $this->_projectId,\n ],\n 'status' => 'HTTP_CREATED',\n ],\n ];\n\n return $this;\n }", "public function update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function create()\n {\n return view('subscriptions.create');\n }", "public function createTopicAndSubscription(string $topicName, string $subscriptionName, string $type): PubSubService\n {\n if (!$this->validName($topicName) || ('pull' == $type && !$this->validName($subscriptionName))) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'The Resource name (topic or subscription) has not a valid format see https://cloud.google.com/pubsub/docs/admin#resource_names for more information.', 'HTTP_CONFLICT')));\n }\n\n $topic = $this->pubSubClient()->topic($topicName);\n\n if (!$topic->exists()) {\n $topic = $this->createTopic($topicName);\n if ($this->getTopicFullName() == $topic) {\n $subscription = $this->pubSubClient()->subscription($subscriptionName);\n\n if ('pull' == $type) {\n if (!$subscription->exists()) {\n $topic = $this->createSubscription($topicName, $subscriptionName);\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n } else {\n if (!$subscription->exists()) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" not exist, add a new subscription in the GCP Console by specify the push method.', 'HTTP_CONFLICT')));\n }\n }\n\n $this->setTopicFullName($topicName);\n $this->setSubscriptionFullName($subscriptionName);\n\n $this->_setInfo();\n\n return $this;\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" not exist, there was an error during topic creation.', 'HTTP_CONFLICT')));\n }\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n }", "public function create(array $attributes = [])\n {\n $trialEndsAt = null;\n\n if (!$this->skipTrial) {\n if (!is_null($this->trialPeriod) && $this->trialPeriod > 0) {\n $trial = new Period($this->trialInterval, $this->trialPeriod, now());\n $trialEndsAt = $trial->getEndAt();\n } elseif ($this->plan->hasTrial()) {\n $trial = new Period($this->plan->trial_interval, $this->plan->trial_period, now());\n $trialEndsAt = $trial->getEndAt();\n }\n }\n\n $period = new Period($this->plan->invoice_interval, $this->plan->invoice_period, $trialEndsAt);\n\n return $this->subscriber->subscriptions()->create(array_merge([\n 'name' => $this->name,\n 'plan_id' => $this->plan->getKey(),\n 'trial_ends_at' => $trialEndsAt,\n 'starts_at' => $period->getStartAt(),\n 'ends_at' => $period->getEndAt(),\n ], $attributes));\n }", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "public function getWithHttpInfo($id)\n {\n $request = $this->getRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function TestPlan_create($author_id, $product_id, $default_product_version, $type_id, $name, $creation_date = NULL, $isactive = TRUE) {\n\t$varray = array(\"author_id\" => \"int\", \"product_id\" => \"int\", \"default_product_version\" => \"string\", \"type_id\" => \"int\", \"name\" => \"string\", \"creation_date\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function stripeSubscribe(Request $request)\n {\n $this->validate($request, [\n 'plan_id' => 'string|required',\n 'payment_method_id' => 'string|required',\n ]);\n\n // Create New Stripe customer\n if (is_null(auth()->user()->stripe_id) || empty(auth()->user()->stripe_id)) {\n $name = auth()->user()->fullname ? auth()->user()->email : null;\n $address = [\n 'line1' => '510 Townsend St',\n 'postal_code' => '98140',\n 'city' => 'San Francisco',\n 'state' => 'CA',\n 'country' => 'US',\n ];\n $email = (auth()->user()->email) ? auth()->user()->email : null;\n $customer = $this->stripeCustomer->createSubscriptionCustomer($name,$email,$address,$request->payment_method_id);\n }\n //stripe customer id\n $customer_id = auth()->user()->stripe_id;\n\n // Subscribe customer to a plan\n $subscription = $this->stripeCustomer->createSubscription($request->plan_id, $customer_id, $request->trial_period);\n\n $sub = Subscriptions::create([\n 'user_id' => auth()->user()->id,\n 'customer_id' => $subscription->customer,\n 'subscription_id' => $subscription->id,\n 'subscription_amount' => $subscription->plan->amount,\n 'plan_name' => $subscription->plan->nickname,\n 'subscription_start_date' => date('Y-m-d h:i:s', $subscription->current_period_start),\n 'subscription_end_date' =>date('Y-m-d h:i:s', $subscription->current_period_end),\n 'subscription_trial_period' => date('Y-m-d h:i:s', $subscription->trial_end),\n ]);\n\n if ($subscription && $sub) {\n $response = \"successful\";\n return json_encode($response);\n } else {\n $response = \"failed\";\n return json_encode($response);\n }\n }", "function createSubscriptionFromCustomerProfile($intervalLength, $customerProfileId,\n $customerPaymentProfileId, $customerAddressId\n ) {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(config('services.authorize.login'));\n $merchantAuthentication->setTransactionKey(config('services.authorize.key'));\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Sample Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime('2020-08-30'));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"1\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount(rand(1,99999)/12.0*12);\n $subscription->setTrialAmount(\"0.00\");\n\n $profile = new AnetAPI\\CustomerProfileIdType();\n $profile->setCustomerProfileId($customerProfileId);\n $profile->setCustomerPaymentProfileId($customerPaymentProfileId);\n $profile->setCustomerAddressId($customerAddressId);\n\n $subscription->setProfile($profile);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n echo \"SUCCESS: Subscription ID : \" . $response->getSubscriptionId() . \"\\n\";\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n }\n\n return $response;\n }", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "public static function createSubscriptionRequest($paymentInfos)\n {\n // Get Payline instance\n $instance = self::getInstance();\n\n $paymentInfos['order']['date'] = date('d/m/Y H:i', self::getTimestampFromPaylineDate($paymentInfos['order']['date']));\n $paymentInfos['payment']['mode'] = 'REC';\n\n $params = array(\n 'version' => self::API_VERSION,\n 'payment' => $paymentInfos['payment'],\n 'orderRef' => $paymentInfos['order']['ref'],\n 'orderDate' => $paymentInfos['order']['date'],\n 'scheduledDate' => '',\n 'cardInd' => '',\n 'walletId' => $paymentInfos['wallet']['walletId'],\n 'recurring' => PaylinePaymentGateway::getSubscriptionConfiguration($paymentInfos['payment']['amount']),\n 'privateDataList' => $paymentInfos['privateDataList'],\n 'order' => $paymentInfos['order'],\n );\n\n // Add private data to the payment request\n foreach ($paymentInfos['formatedPrivateDataList'] as $k => $v) {\n $instance->addPrivateData(array('key' => $k, 'value' => $v));\n }\n\n $result = $instance->doRecurrentWalletPayment($params);\n\n return $result;\n }", "function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }", "protected function createdASubscription(): bool\n {\n $this->createSubscription();\n\n if(!$this->subscription):\n return $this->subscriptionCreationFailed();\n endif;\n\n // Making sure clients won't be charged after trial period.\n $this->subscription_api->cancelAtTerms($this->subscription);\n\n return true;\n }", "public function onSubscriptionCreate(SubscriptionInterface $subscription, OrderItemInterface $order_item);", "public function subscription($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Subscription::find_with_client($this, $id);\n\n }", "public function makeSubscription($subscriptionFields = [])\n {\n /** @var SubscriptionRepository $subscriptionRepo */\n $subscriptionRepo = App::make(SubscriptionRepository::class);\n $theme = $this->fakeSubscriptionData($subscriptionFields);\n return $subscriptionRepo->create($theme);\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "public function create(string $name, array $options = []);", "public function __construct( $subscription ) {\n\n\t\tparent::__construct( $subscription );\n\n\t\t$this->order_type = 'shop_subscription';\n\n\t\t$this->schedule = new stdClass();\n\t}", "public function updateWithHttpInfo($id, $update_subscription_request)\n {\n $request = $this->updateRequest($id, $update_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createSubscription($plan=null,$customer=null,$trial_period=null)\n {\n $subscription = \\Stripe\\Subscription::create([\n 'customer' => $customer,\n 'items' => [\n [\n 'plan' => $plan,\n ],\n ],\n 'expand' => ['latest_invoice.payment_intent'],\n 'trial_end' => ($trial_period > 0)? Carbon::now()->addDays($trial_period)->timestamp:null,\n ]);\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_subscriptionId = $subscription->id;\n $user->save();\n\n return $subscription;\n }", "public function create()\n {\n return view('admin.subs.subscriptiontype.create')->with('dates', self::dates());\n }", "public function getSubscription($request);", "public function create()\n {\n $ostObj = $this->instantiateOSTSDKForV2Api();\n $usersService = $ostObj->services->users;\n $params = array();\n $response = $usersService->create($params)->wait();\n $this->isSuccessResponse($response);\n }", "public function create($publication, array $options = array())\n {\n $body = (isset($options['body']) ? $options['body'] : array());\n $body['publication'] = $publication;\n\n $response = $this->client->post('/api/topics/'.rawurlencode($this->topic_id).'/publications', $body, $options);\n\n return $response;\n }", "public function create_or_update_subscriber( $params ) {\n\t\tif ( empty( $params['account_id'] ) ) {\n\t\t\tthrow new Exception( 'Account ID not specified' );\n\t\t}\n\n\t\t$account_id = $params['account_id'];\n\t\tunset( $params['account_id'] ); // clear it from the params\n\n\t\t$api_action = \"/$account_id/subscribers\";\n\t\t$url = $this->api_end_point . $api_action;\n\n\t\t// The API wants the params to be JSON encoded\n\t\t$req_params = array( 'subscribers' => array( $params ) );\n\n\t\t$res = $this->make_request( $url, $req_params, static::POST );\n\n\t\treturn empty( $res ) ? false : $res;\n\t}", "function subscribeById ( $id )\n {\n try\n {\n $result = $this->apiCall('post',\"{$this->api['cms_manager_url']}/resources/subscriptions/{$id}\",array(),'json');\n return $this->createResponse($result,'Subscribe','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function __construct($subscription)\n {\n $this->subscription = $subscription;\n }", "public function create( UserCreationInfo $userCreationInfo )\n {\n $response = $this->simplePostRequest( $userCreationInfo->toArray() );\n\n return new UserCreationResponse( $response );\n }", "public function subscription_create($customerId, $planId){\n\t\t$params = array(\n\t\t\t'planId' => $planId,\n\t\t\t'customerId' => $customerId,\n\t\t);\n\t\t\n\t\t$flow = $this->send('subscription/create', $params, 'POST');\t\t\n\t\t$response = array(\n\t\t\t'subscriptionId' => $flow['subscriptionId'],\n\t\t\t'planId' => $flow['planId'],\n\t\t\t'plan_name' => $flow['plan_name'],\n\t\t\t'customerId' => $flow['customerId'],\n\t\t\t'created' => $flow['created'],\n\t\t\t'subscription_start' => $flow['subscription_start'],\n\t\t\t'subscription_end' => $flow['subscription_end'],\n\t\t\t'period_start' => $flow['period_start'],\n\t\t\t'period_end' => $flow['period_end'],\n\t\t\t'next_invoice_date' => $flow['next_invoice_date'],\n\t\t\t'trial_period_days' => $flow['trial_period_days'],\n\t\t\t'trial_start' => $flow['trial_start'],\n\t\t\t'trial_end' => $flow['trial_end'],\n\t\t\t'cancel_at_period_end' => $flow['cancel_at_period_end'],\n\t\t\t'cancel_at' => $flow['cancel_at'],\n\t\t\t'periods_number' => $flow['periods_number'],\n\t\t\t'days_until_due' => $flow['days_until_due'],\n\t\t\t'status' => $flow['status'],\n\t\t\t'morose' => $flow['morose'],\n\t\t\t'discount' => $flow['discount'],\n\t\t\t'invoices' => $flow['invoices']\n\t\t);\n\t\treturn $response['customerId'];\n\t}", "public function subscribeToTopic(Request $request, $topic)\n {\n\n $validator = Validator::make($request->all(), [\n \"url\" => [\"required\", \"url\"]\n ]);\n\n if ($validator->fails()) {\n return response()->json(['errors' => $validator->errors()]);\n }\n\n $subscription = $this->subscriptionService->createSubscription($request->url, $topic);\n\n if($subscription[\"success\"])\n return response()->json(new CreateSubscriptionResource($subscription[\"data\"]));\n\n return response()->json($subscription, 201);\n }", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling get'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "function create_subscription_token($data){\n // $n = convert_timezone(strtotime(\"now\"), true, true,false,\"m/d/Y h:i:sP\");\n // $now = new DateTime($n);\n // $now->format(\"m/d/Y h:i:sP\");\n $plandata = $this->get_plan_name($data->planId);\n if($data->addOnId != ''){\n $result = Braintree_Subscription::create([\n 'paymentMethodToken' => $data->paymentMethodToken,\n 'planId' => $data->planId,\n 'addOns' => [\n 'add' => [\n [\n 'inheritedFromId' => $data->addOnId,\n 'neverExpires' => true,\n 'quantity' => $data->quantity\n ] \n ] \n ],\n 'descriptor' => [\n //'name' => \"TRACKER*\".$plandata['description']\n 'name' => \"TRCKRTR*PLAN\"\n ]\n // 'firstBillingDate' => $now,\n // 'options' => ['startImmediately' => true]\n ]);\n // if($result){\n // return $result;\n // }else{\n // // $error = \"\";\n // // // foreach($result->errors->deepAll() AS $error) {\n // // // $error .= $error->code . \": \" . $error->message . \"\\n\";\n // // // //echo($error->code . \": \" . $error->message . \"\\n\");\n // // // }\n // return $error;\n // }\n }else{\n $result = Braintree_Subscription::create([\n 'paymentMethodToken' => $data->paymentMethodToken,\n 'planId' => $data->planId,\n 'descriptor' => [\n //'name' => \"TRACKER*\".$plandata['description']\n\n 'name' => \"TRCKRTR*PLAN\"\n ]\n // 'firstBillingDate' => $now,\n // 'options' => ['startImmediately' => true]\n ]);\n }\n\n return $result;\n }", "public function newAction()\n {\n $entity = new SubscriptionBase();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create(\n string $connection,\n array $body,\n ?RequestOptions $options = null,\n ): ResponseInterface;", "public function subscriptionPurchaseAllowedWithHttpInfo()\n {\n $returnType = '';\n $request = $this->subscriptionPurchaseAllowedRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function subscription($attributes)\n {\n $attributes = shortcode_atts(array('id' => ''), $attributes, 'happyrsubscription');\n\n $id = $attributes['id'];\n if (empty($id)) {\n return 'You are missing company ID. See https://happyr.com/integration/doc/retrieveId';\n }\n\n return 'https://happyr.com/user/spontaneous/'.$id.'/start';\n }", "public function store(SubscriptionStoreRequest $request)\n {\n $user = Auth::user();\n\n $company_name = $request->get('company_name');\n\n $user_password = $request->get('user_password');\n\n\n try {\n\n\n $result = $this->saasService->validateAccount($company_name, $user->email);\n\n if ($result->status == 'error') {\n flash($result->message)->error();\n return back();\n }\n\n } catch (\\Exception $exception) {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n\n\n $plan = $this->planSservice->getByGateway($request->get('plan'));\n\n $subscription = $request->user()->newSubscription('main', $request->plan);\n\n if ($plan->trial) {\n $subscription->trialDays($plan->trial_days);\n\n }\n\n\n\n if ($request->has('coupon')) {\n $subscription->withCoupon($request->coupon);\n }\n\n try {\n if (config('saas.payment_gateway', '') == 'stripe') {\n $subscription->create($request->token);\n } else {\n $subscription->create($request->payment_method_nonce);\n }\n\n\n } catch (\\Exception $exception) {\n\n flash(trans($exception->getMessage()))->warning();\n\n return redirect(route('account.index'));\n }\n\n try {\n\n if (!config('saas.api_url')) {\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n return back();\n }\n\n $result = $this->saasService->createAccount($company_name, $user->name, $user->email, $user_password, $plan->teams_limit, $plan->storage_limit, $plan->api_plan);\n\n if ($result->status) {\n\n $user->application_id = $result->data->company->id;\n\n if ($user->save()) {\n\n\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n } else {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n } else {\n flash(trans('saas.error_something_went_wrong'), $result->message)->error();\n }\n\n } catch (\\Exception $exception) {\n\n\n flash(trans('saas.error_something_went_wrong'), $exception->getMessage())->error();\n }\n\n return redirect(route('account.index'));\n }", "public function saveSubscription($subscription)\n {\n return Stripe\\Subscription::create(array(\n 'customer' => Stripe\\Customer::retrieve(\n Customer::where('id', $subscription->customer_id)->first()->token\n ),\n 'plan' => $subscription->plan_level\n ));\n }", "public function create($name, $type = null, array $options = array());", "public function getSubscription(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n $result = $this->validateAuthenticator($data);\n if (empty($result['error'])) {\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n unset($result['secret']);\n return new JsonResponse($result);\n }\n unset($result['secret']);\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }", "public function postCreateSubscription(CreateSubscriptionRequest $request)\n {\n try {\n DB::beginTransaction();\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($request->cardExist === \"true\") {\n $this->addUserTOSubscription($recruiter['customer_id'], $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n if ($recruiter['customer_id'] == null) {\n $createCustomer = $this->createCustomer();\n if ($createCustomer['success'] == true) {\n $customer = $createCustomer['data']['id'];\n } else {\n $customer = null;\n $this->response['success'] = false;\n $this->response['message'] = $createCustomer['message'];\n $this->response['data'] = null;\n }\n } else {\n $customer = $recruiter['customer_id'];\n }\n if ($customer != null) {\n $addCard = $this->addCardForSubscription($request->all(), $customer);\n if ($addCard['success'] == true) {\n $this->addUserTOSubscription($customer, $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $addCard['message'];\n }\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = trans('messages.cannot_subscribe');\n }\n }\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollback();\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public function get(string $id): Subscription\n {\n $response = $this->performApiCall(\n 'GET',\n \"subscriptions/{$id}\"\n );\n\n return new Subscription(collect($response));\n }", "public function postSubscribe(WP_REST_Request $request)\r\n {\r\n global $wpdb;\r\n $first_name = $request['first_name'];\r\n $last_name = $request['last_name'];\r\n $email = $request['email'];\r\n $errors = [];\r\n\r\n if (!$first_name || strlen($first_name) > 100)\r\n array_push($errors, \"First name is required\");\r\n\r\n if (!$last_name || strlen($last_name) > 100)\r\n array_push($errors, \"Last name is required\");\r\n\r\n if (!is_email($email) || strlen($email) > 100)\r\n array_push($errors, \"Please enter a valid email\");\r\n\r\n if (count($errors) > 0)\r\n return new WP_REST_Response($errors, 400);\r\n\r\n $validation_code = md5($email);\r\n $wpdb->insert(\r\n $wpdb->prefix . self::$tableName,\r\n array(\r\n 'first_name' => $first_name,\r\n 'last_name' => $last_name,\r\n 'email' => $email,\r\n 'validation_code' => $validation_code\r\n ),\r\n array(\r\n '%s',\r\n '%s',\r\n '%s',\r\n '%s'\r\n )\r\n );\r\n\r\n $link = \"<a href='\" . get_home_url() . \"/wp-json/ohsnewsletter/v1/validate/\" . $validation_code . \"'>\" . get_home_url() . \"/wp-json/ohsnewsletter/v1/validate/\" . $validation_code . \"</a>\";\r\n $message = \"Thank you for your interest in OHS Insider newsletter. Please confirm your email address by clicking the following link: \" . $link;\r\n\r\n add_filter( 'wp_mail_content_type', array($this, 'wpse27856_set_content_type') );\r\n wp_mail($email, \"Please confirm your OHS Insider newsletter subscription\", $message);\r\n remove_filter( 'wp_mail_content_type', array($this, 'wpse27856_set_content_type') );\r\n\r\n return new WP_REST_Response(\"We have sent you a confirmation email. Please check your email and verify it to complete your subscription. Thank you\", 200);\r\n }", "public function create(Request $request)\n {\n $data = $this->report->call($request);\n\n return apiResponseBuilder(200, $data, 'Success');\n }", "public function create()\n {\n return view ('subscriber::subscriber_create');\n }", "public function subscription($name)\n {\n return $this->subscriptionFactory($name);\n }", "protected function subscriptionPurchaseAllowedRequest()\n {\n\n $resourcePath = '/accounts/purchaseable';\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/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 __construct($subscriptionId = null)\n {\n $this->subscriptionId = $subscriptionId;\n }", "public function createSubscription(\\HGON\\HgonPayment\\Domain\\Model\\Article $article)\n {\n $settings = $this->getSettings();\n\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n /** @var \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder $uriBuilder */\n $uriBuilder = $objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Routing\\\\UriBuilder');\n $returnUri = $uriBuilder->reset()->setCreateAbsoluteUri(true)\n ->setTargetPageUid(intval($settings['subscriptionPid']))\n ->uriFor('confirmSubscription', null, 'PayPal', 'HgonPayment', 'Subscription');\n\n // the api does not accept return urls without \".de\" at the end\n // because of this, the api throws error while testing. Use pseudo .de domain\n if (\n $this->context == \"Development\"\n //|| $this->context == \"Production/Staging\"\n ) {\n // override returnUri\n $returnUri = 'http://stage.hgon.de/mitmachen/hgon-sagt-danke/';\n }\n\n\n // get PayPalProduct by sku\n // -> create, if not exists\n $payPalProduct = $this->getPayPalProduct($article);\n\n // @toDo: get PayPayPlan by PayPalProduct (product_id)\n // -> create, if not exists\n // give Article: If it's a donation, this article will not be found in database table\n $payPalPlan = $this->getPayPalPlan($payPalProduct, $article);\n\n if (! ($payPalPlan instanceof \\HGON\\HgonPayment\\Domain\\Model\\PayPalPlan)) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('Cannot fetch PayPalPlan for Article with UID \"%s\". Please check the configuration.', $article->getUid()));\n return false;\n //===\n }\n\n // active directyl with \"SUBSCRIBE_NOW\": https://developer.paypal.com/docs/platforms/subscriptions/#step-3-create-a-subscription\n // (Optional) Use the application_context/user_action field to automatically activate subscriptions. Set the field to SUBSCRIBE_NOW or send it empty. The default value is SUBSCRIBE_NOW. Otherwise, you need to make a POST v1/billing/subscriptions/{ID}/activate call to activate the subscription.\n\n // Create subscription by plan_id\n $data = [\n 'plan_id' => $payPalPlan->getPlanId(),\n //'quantity' => 1,\n 'application_context' => [\n 'user_action' => 'SUBSCRIBE_NOW',\n 'shipping_preference' => 'NO_SHIPPING',\n // IMPORTANT: A local URI with .local to the end was NOT supported by the sandbox for testing!!\n 'return_url' => $returnUri,\n 'cancel_url' => $settings['api']['cancelUrl']\n ]\n ];\n\n $url = $this->host . '/v1/billing/subscriptions';\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n $this->cUrl = $curl;\n return $this->sendRequest();\n //===\n }", "public function postAdd() {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ()) {\n $isCreated = true;\n $this->request->session ()->flash ( StringLiterals::SUCCESS, trans ( 'cms::subscription.add.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.add.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.add.error' ) );\n }", "public function create()\n {\n return response() -> json([\n \"success\" => true,\n \"services\" => \"Crear\"\n ], 200);\n }", "public function transactionCreate(Request $request)\n {\n $invoice_request = $request->all();\n\n $response = BilldeskHmac::transactionCreate($invoice_request);\n }", "public function subscribe($subId, array $params, $request)\n {\n if ($this->subscriptions->has($subId)) {\n $this->subscriptions->forget($subId);\n }\n\n $query = array_get($params, 'query', '');\n $args = array_get($params, 'variables', []);\n\n $this->validateSubscription($query, $args, $request);\n\n $triggerName = Parser::getInstance()->subscriptionName($query);\n\n $this->subscriptions->put(\n $subId,\n compact('args', 'query', 'triggerName')\n );\n }", "public function newSubscription($name, $plan)\n {\n return new SubscriptionBuilder($this, $name, $plan);\n }" ]
[ "0.6787618", "0.63246804", "0.62454414", "0.612119", "0.6012842", "0.5855699", "0.5843244", "0.56057495", "0.546624", "0.53863406", "0.5215567", "0.5215361", "0.52113795", "0.52106977", "0.5200128", "0.51342887", "0.513114", "0.5128389", "0.50850976", "0.5046759", "0.50391", "0.50227207", "0.49843955", "0.49705777", "0.4947777", "0.49474224", "0.49424782", "0.4936971", "0.49273822", "0.49068624", "0.48975667", "0.4887228", "0.48763", "0.48607016", "0.4855823", "0.4853457", "0.48438036", "0.48433265", "0.4838747", "0.48268628", "0.4817168", "0.4805919", "0.48041028", "0.48036143", "0.48025572", "0.4783656", "0.47717974", "0.47646934", "0.47601023", "0.47534293", "0.47455937", "0.47406068", "0.47198555", "0.47097299", "0.47021186", "0.46913815", "0.46816596", "0.46275294", "0.46147215", "0.46118027", "0.46097395", "0.46067566", "0.45968416", "0.45939967", "0.45929497", "0.45899576", "0.4578922", "0.45777658", "0.45702636", "0.45646554", "0.45625728", "0.45570445", "0.4552351", "0.4549239", "0.45367697", "0.45366684", "0.45127955", "0.45125824", "0.45123672", "0.45037302", "0.45008346", "0.4496039", "0.44934118", "0.44817117", "0.4480101", "0.44794744", "0.44787762", "0.44763643", "0.44758135", "0.4474644", "0.4469095", "0.44643438", "0.44590294", "0.44564056", "0.44532117", "0.44527715", "0.4450116", "0.44473028", "0.4431874", "0.4430815" ]
0.72404015
0
Operation createAsync Create Subscription
public function createAsync($create_subscription_request) { return $this->createAsyncWithHttpInfo($create_subscription_request) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSubscription($request);", "public function create()\n {\n $subscription = new Subscription();\n\n return $subscription;\n }", "public function createRequest($create_subscription_request)\n {\n // verify the required parameter 'create_subscription_request' is set\n if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_subscription_request when calling create'\n );\n }\n\n $resourcePath = '/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request));\n } else {\n $httpBody = $create_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function createNewSubscription(array $data){\nreturn $this->post($data, \"/subscription\");\n}", "public function create()\n {\n //\n return view('backend.subscriptions.create');\n }", "public function create()\n {\n return view(\"admin.subscriptions.create\");\n }", "public function create(CreateSubscriberRequest $request)\n {\n // create a new object, fill with data and save\n $data = $request->toArray();\n $subscriber = new Subscriber($data);\n $subscriber->save();\n\n // save to cache\n $cacheKey = \"subscriber-{$subscriber->id}\";\n RedisCache::instance()->set($cacheKey, serialize($subscriber));\n\n return new Response(201, 'Subscriber created', $subscriber);\n }", "public function create()\n {\n return view('subscription::create');\n }", "public function create()\n {\n $subscriptions = Subscription::all();\n\n return view('subscription.subscribe', compact('subscriptions'));\n }", "function create_subscription($subscription) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Try to save the subscription\n if ( $CI->base_model->insert('subscriptions', $subscription) ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "protected function createdASubscription(): bool\n {\n $this->createSubscription();\n\n if(!$this->subscription):\n return $this->subscriptionCreationFailed();\n endif;\n\n // Making sure clients won't be charged after trial period.\n $this->subscription_api->cancelAtTerms($this->subscription);\n\n return true;\n }", "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 subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public function create()\n {\n return view('subscriptions.create');\n }", "function createObject() {\n\t\treturn new InstitutionalSubscription();\n\t}", "public function actionCreate()\n {\n $model = new UserSubscriber();\n\n $success = false;\n $msg = 'There was an error, please try again later.';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $success = true;\n $msg = 'Thank you for subscription for newsletter.';\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['success' => $success, 'msg' => $msg];\n\n }", "public function create()\n {\n \n return view('backend.subscriber.create');\n \n }", "public function createSubscriptionWithPaymentMethod(CreateSubscriptionWithPaymentMethodRequest $request)\n {\n $response = $this->paymentMethodService->createPaymentMethod($request);\n $request->merge([\n 'payment_method' => $response['id'],\n ]);\n\n $this->apiData = $this->subscriptionService->createSubscription($request);\n\n return $this->success();\n }", "private function subscriptionFactory($name, array $info = [])\n {\n return new Subscription(\n $this->connection,\n $this->projectId,\n $name,\n $this->name,\n $this->encode,\n $info\n );\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "public function create()\n {\n // handled by client\n }", "public function create()\n {\n return view ('subscriber::subscriber_create');\n }", "public function create(array $attributes = [])\n {\n $trialEndsAt = null;\n\n if (!$this->skipTrial) {\n if (!is_null($this->trialPeriod) && $this->trialPeriod > 0) {\n $trial = new Period($this->trialInterval, $this->trialPeriod, now());\n $trialEndsAt = $trial->getEndAt();\n } elseif ($this->plan->hasTrial()) {\n $trial = new Period($this->plan->trial_interval, $this->plan->trial_period, now());\n $trialEndsAt = $trial->getEndAt();\n }\n }\n\n $period = new Period($this->plan->invoice_interval, $this->plan->invoice_period, $trialEndsAt);\n\n return $this->subscriber->subscriptions()->create(array_merge([\n 'name' => $this->name,\n 'plan_id' => $this->plan->getKey(),\n 'trial_ends_at' => $trialEndsAt,\n 'starts_at' => $period->getStartAt(),\n 'ends_at' => $period->getEndAt(),\n ], $attributes));\n }", "public function newSubscription(array $data = [], string $name = 'default')\n {\n $trialEndsAt = null;\n if ($data['status'] === Paddle::STATUS_TRIALING) {\n $time = Carbon::parse($data['event_time'])->format('H:i:s');\n $trialEndsAt = Carbon::parse(\"{$data['next_bill_date']} {$time}\");\n }\n\n return $this->subscriptions()->create([\n 'user_id' => $this->id,\n 'name' => $name,\n 'paddle_id' => $data['subscription_id'],\n 'paddle_plan_id' => $data['subscription_plan_id'],\n 'paddle_cancel_url' => $data['cancel_url'],\n 'paddle_update_url' => $data['update_url'],\n 'paddle_status' => $data['status'],\n 'quantity' => $data['quantity'],\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null\n ]);\n }", "public function createWithHttpInfo($create_subscription_request)\n {\n $request = $this->createRequest($create_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "public function createSubscription(CustomerInterface $customer, PaymentMethodInterface $payment_method, $product_name, string $period, ...$arguments): SubscriptionInterface;", "public function create(Request $request){\n\n $suscription = new Subscription([\n 'plan_id' => $request->plan_id,\n 'date_start' => Carbon::now(),\n 'date_end' => Carbon::now()->addMonths(2),\n ]);\n $suscription->save();\n $car_suscription = new CarSubscription([\n 'subscription_id' => $suscription->id,\n 'cars_id' => $request->car_id,\n ]);\n $car_suscription->save();\n return response()->json([\n 'message' => 'Creado exitosamente!'], 201);\n }", "public function makeSubscription($subscriptionFields = [])\n {\n /** @var SubscriptionRepository $subscriptionRepo */\n $subscriptionRepo = App::make(SubscriptionRepository::class);\n $theme = $this->fakeSubscriptionData($subscriptionFields);\n return $subscriptionRepo->create($theme);\n }", "public function postCreateSubscription(CreateSubscriptionRequest $request)\n {\n try {\n DB::beginTransaction();\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($request->cardExist === \"true\") {\n $this->addUserTOSubscription($recruiter['customer_id'], $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n if ($recruiter['customer_id'] == null) {\n $createCustomer = $this->createCustomer();\n if ($createCustomer['success'] == true) {\n $customer = $createCustomer['data']['id'];\n } else {\n $customer = null;\n $this->response['success'] = false;\n $this->response['message'] = $createCustomer['message'];\n $this->response['data'] = null;\n }\n } else {\n $customer = $recruiter['customer_id'];\n }\n if ($customer != null) {\n $addCard = $this->addCardForSubscription($request->all(), $customer);\n if ($addCard['success'] == true) {\n $this->addUserTOSubscription($customer, $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $addCard['message'];\n }\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = trans('messages.cannot_subscribe');\n }\n }\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollback();\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function createSubscription($parameters) {\r\n $request = FlexmailAPI::parseArray($parameters);\r\n\r\n $response = $this->execute(\"CreateGroupSubscription\", $request);\r\n return FlexmailAPI::stripHeader($response, $this->config->get('debug_mode'));\r\n }", "public function postAdd() {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ()) {\n $isCreated = true;\n $this->request->session ()->flash ( StringLiterals::SUCCESS, trans ( 'cms::subscription.add.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.add.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.add.error' ) );\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "protected function _create_subscription ( array $values ){\n\n return new Payment_Subscription( $values );\n\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "public function createSubscriber();", "protected function createBasicSubscriptionAndOrder() {\n $subscription = Subscription::create([\n 'type' => 'product_variation',\n 'store_id' => $this->store->id(),\n 'billing_schedule' => $this->billingSchedule,\n 'uid' => $this->user,\n 'payment_method' => $this->paymentMethod,\n 'purchased_entity' => $this->variation,\n 'title' => $this->variation->getOrderItemTitle(),\n 'unit_price' => new Price('2', 'USD'),\n 'state' => 'pending',\n 'starts' => \\Drupal::time()->getRequestTime() - 5,\n 'ends' => \\Drupal::time()->getRequestTime() + 1000,\n ]);\n $subscription->save();\n\n $order_storage = \\Drupal::entityTypeManager()->getStorage('commerce_order');\n $result = $order_storage->getQuery()\n ->condition('type', 'recurring')\n ->pager(1)\n ->execute();\n $this->assertEmpty($result);\n\n $subscription->getState()->applyTransition($subscription->getState()->getTransitions()['activate']);\n $subscription->save();\n\n $orders = $order_storage->loadMultiple($order_storage->getQuery()\n ->condition('type', 'recurring')\n ->execute());\n $this->assertCount(1, $orders);\n $order = reset($orders);\n\n return [$subscription, $order];\n }", "public function create(CreateSubscriberDTO $details)\r\n {\r\n $details = json_decode(json_encode($details), true);\r\n $res = $this->subscriberModel->create($details);\r\n\r\n return $res;\r\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public function store(SubscriptionStoreRequest $request)\n {\n $user = Auth::user();\n\n $company_name = $request->get('company_name');\n\n $user_password = $request->get('user_password');\n\n\n try {\n\n\n $result = $this->saasService->validateAccount($company_name, $user->email);\n\n if ($result->status == 'error') {\n flash($result->message)->error();\n return back();\n }\n\n } catch (\\Exception $exception) {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n\n\n $plan = $this->planSservice->getByGateway($request->get('plan'));\n\n $subscription = $request->user()->newSubscription('main', $request->plan);\n\n if ($plan->trial) {\n $subscription->trialDays($plan->trial_days);\n\n }\n\n\n\n if ($request->has('coupon')) {\n $subscription->withCoupon($request->coupon);\n }\n\n try {\n if (config('saas.payment_gateway', '') == 'stripe') {\n $subscription->create($request->token);\n } else {\n $subscription->create($request->payment_method_nonce);\n }\n\n\n } catch (\\Exception $exception) {\n\n flash(trans($exception->getMessage()))->warning();\n\n return redirect(route('account.index'));\n }\n\n try {\n\n if (!config('saas.api_url')) {\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n return back();\n }\n\n $result = $this->saasService->createAccount($company_name, $user->name, $user->email, $user_password, $plan->teams_limit, $plan->storage_limit, $plan->api_plan);\n\n if ($result->status) {\n\n $user->application_id = $result->data->company->id;\n\n if ($user->save()) {\n\n\n flash(trans('saas.thanks_for_becoming_a_subscriber'))->success();\n } else {\n flash(trans('saas.error_something_went_wrong'))->error();\n }\n } else {\n flash(trans('saas.error_something_went_wrong'), $result->message)->error();\n }\n\n } catch (\\Exception $exception) {\n\n\n flash(trans('saas.error_something_went_wrong'), $exception->getMessage())->error();\n }\n\n return redirect(route('account.index'));\n }", "public function createAction(Request $request)\n {\n $entity = new SubscriptionBase();\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('admin_subscriptions_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n $title = 'Create Subscriber';\n $topics = Auth::user()->topics;\n return view('subscriber.create', compact('title','topics'));\n }", "public function create()\n {\n return view('backend.vendor-subscription-plan.create');\n }", "public function createSubscription(\\HGON\\HgonPayment\\Domain\\Model\\Article $article)\n {\n $settings = $this->getSettings();\n\n /** @var \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager $objectManager */\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n /** @var \\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder $uriBuilder */\n $uriBuilder = $objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Mvc\\\\Web\\\\Routing\\\\UriBuilder');\n $returnUri = $uriBuilder->reset()->setCreateAbsoluteUri(true)\n ->setTargetPageUid(intval($settings['subscriptionPid']))\n ->uriFor('confirmSubscription', null, 'PayPal', 'HgonPayment', 'Subscription');\n\n // the api does not accept return urls without \".de\" at the end\n // because of this, the api throws error while testing. Use pseudo .de domain\n if (\n $this->context == \"Development\"\n //|| $this->context == \"Production/Staging\"\n ) {\n // override returnUri\n $returnUri = 'http://stage.hgon.de/mitmachen/hgon-sagt-danke/';\n }\n\n\n // get PayPalProduct by sku\n // -> create, if not exists\n $payPalProduct = $this->getPayPalProduct($article);\n\n // @toDo: get PayPayPlan by PayPalProduct (product_id)\n // -> create, if not exists\n // give Article: If it's a donation, this article will not be found in database table\n $payPalPlan = $this->getPayPalPlan($payPalProduct, $article);\n\n if (! ($payPalPlan instanceof \\HGON\\HgonPayment\\Domain\\Model\\PayPalPlan)) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('Cannot fetch PayPalPlan for Article with UID \"%s\". Please check the configuration.', $article->getUid()));\n return false;\n //===\n }\n\n // active directyl with \"SUBSCRIBE_NOW\": https://developer.paypal.com/docs/platforms/subscriptions/#step-3-create-a-subscription\n // (Optional) Use the application_context/user_action field to automatically activate subscriptions. Set the field to SUBSCRIBE_NOW or send it empty. The default value is SUBSCRIBE_NOW. Otherwise, you need to make a POST v1/billing/subscriptions/{ID}/activate call to activate the subscription.\n\n // Create subscription by plan_id\n $data = [\n 'plan_id' => $payPalPlan->getPlanId(),\n //'quantity' => 1,\n 'application_context' => [\n 'user_action' => 'SUBSCRIBE_NOW',\n 'shipping_preference' => 'NO_SHIPPING',\n // IMPORTANT: A local URI with .local to the end was NOT supported by the sandbox for testing!!\n 'return_url' => $returnUri,\n 'cancel_url' => $settings['api']['cancelUrl']\n ]\n ];\n\n $url = $this->host . '/v1/billing/subscriptions';\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n $this->cUrl = $curl;\n return $this->sendRequest();\n //===\n }", "public function created(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'started');\n }", "public function postCreate(Request $request)\n {\n //echo \"dfadsf\";exit;\n \n // // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription= new Subscription();\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data inserted successfully'));\n\n }", "public function Create()\n {\n \t// CREATE RETAILER TYPE ////////////////////////////////////////////\n \t$rs = mysql_query(\"INSERT INTO subscriptions (subscription_name_fr,\n\t subscription_name_en,\n \t\t\t\t\t\t\t\t\t\t\t\t subscription_desc_fr,\n\t subscription_desc_en,\n\t created_by_id,\n\t created_date,\n\t modified_by_id,\n\t modified_date,\n\t \t\t\t\t\t\t\t\t rowguid) VALUES\n ('\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->created_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . create_guid() .\"')\");\n \t\t \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\t \n \t\t \n \t$this->subscription_id = mysql_insert_id();\n \t\t \n \treturn mysql_insert_id();\n \t\t \n \t\n }", "abstract public function add_subscription( Payment_Subscription $subscription );", "protected function subscriber()\n {\n return Subscriber::connection(1, [\n 'id' => 1,\n 'payload' => [\n 'query' => 'subscription { onPostCreated { id } }',\n 'variables' => [],\n 'operationName' => ''\n ]\n ]);\n }", "public function create()\n {\n return view('admin.subs.subscriptiontype.create')->with('dates', self::dates());\n }", "public function create()\n {\n \n //\n }", "public function addFreeSubscriptionRequest()\n {\n\n $resourcePath = '/subscriptions/saas/free';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create(Request $request)\n {\n $user = $request->user();\n $user->createOrGetStripeCustomer();\n if($user->subscribed()){\n return $user->redirectToBillingPortal();\n }\n\n return view('.subscription.create', [\n 'intent' => $user->createSetupIntent()\n ]);\n }", "public function store(SubscribeRequest $request)\n {\n $this->subscribes->create($request);\n setMessage('message','success',\"Create Successfully\");\n return redirect()->route('subscribe.index');\n }", "public function create() {}", "public function store(CreateSubscriberRequest $request)\n\t{\n\t\t$input = $request->all();\n\t\t$input['email'] = strtolower($input['email']);\n\n\t\t// Check whether subscriber exists\n\t\tif (Subscriber::where('email', $input['email'])->count() > 0) {\n\t\t\t// Fetch the subscriber from the database\n\t\t\t$subscriber = Subscriber::where('email', $input['email'])->firstOrFail();\n\n\t\t\t// If the subscriber isn't verified, resend verification email with new nonce\n\t\t\tif (!$subscriber->verified) {\n\t\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t\t$subscriber->save();\n\n\t\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If they are already subscribe, send an 'already-verified' email\n\t\t\t\t$this->sendAlreadyVerifiedEmail($subscriber);\n\t\t\t}\n\t\t} else {\n\t\t\t// Create a Subscriber\n\t\t\t$subscriber = new Subscriber($input);\n\t\t\t$subscriber->nonce = str_random(32);\n\t\t\t$subscriber->verified = False;\n\t\t\t$subscriber->save();\n\n\t\t\t// Send a verification email\n\t\t\t$this->sendVerificationEmail($subscriber);\n\t\t}\n\n\t\treturn view('subscribers/sent');\n\t}", "public function create()\n\t{\n\t\treturn view('subscribers/create');\n\t}", "public function create()\n {\n return response() -> json([\n \"success\" => true,\n \"services\" => \"Crear\"\n ], 200);\n }", "public function store()\n\t{\n//\t\t$validator = Validator::make($data = Input::all(), Subscription::$rules);\n\n//\t\tif ($validator->fails())\n//\t\t{\n//\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n//\t\t}\n//\t\tSubscription::create($data);\n\n $serviceId = Input::get('service_name');\n// $clientName = Client::findOrNew(null,['name' => Input::get('client_name')]);\n $clientName = Client::firstOrCreate(['name' => Input::get('client_name')]);\n if($clientName instanceof \\Illuminate\\Database\\Eloquent\\Model ){\n $clientName->save();\n $clientName->services()->sync([intval($serviceId+1) ]);\n $period = 0;\n switch(intval(Input::get('period'))){\n case 1:\n $period = Cb::now()->addMonth();\n break;\n case 6:\n $period = Cb::now()->addMonths(6);\n break;\n case 12:\n $period = Cb::now()->addMonths(12);\n break;\n\n }\n $clientName->services()->updateExistingPivot(intval($serviceId+1), [ 'expires_at' => $period ]);\n\n }\n return Redirect::route('subscriptions.index');\n\t}", "public function create()\n {\n //TODO\n }", "public function saveSubscription($subscription)\n {\n return Stripe\\Subscription::create(array(\n 'customer' => Stripe\\Customer::retrieve(\n Customer::where('id', $subscription->customer_id)->first()->token\n ),\n 'plan' => $subscription->plan_level\n ));\n }", "public function create(Request $request)\n {\n $id = $request->id;\n\n return view('subscriber.create',compact('id'));\n }", "public function create(): void\n {\n $this->register();\n }", "public function create()\n {\n return $this->work->srvCreate();\n }", "function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }", "public function createSubscription($plan=null,$customer=null,$trial_period=null)\n {\n $subscription = \\Stripe\\Subscription::create([\n 'customer' => $customer,\n 'items' => [\n [\n 'plan' => $plan,\n ],\n ],\n 'expand' => ['latest_invoice.payment_intent'],\n 'trial_end' => ($trial_period > 0)? Carbon::now()->addDays($trial_period)->timestamp:null,\n ]);\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_subscriptionId = $subscription->id;\n $user->save();\n\n return $subscription;\n }", "public function create()\n {\n return view('table.subscribers.create');\n }", "public function subscription($name)\n {\n return $this->subscriptionFactory($name);\n }", "public function makeSubscription()\n {\n\n $url = Credentials::getCredentials('/pre-approvals');\n\n $response = Http::withHeaders([\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1'\n ])\n ->post($url, [\n 'plan' => $this->data['plan_reference'],\n 'sender' => [\n 'name' => 'Teste Usuário Sender',\n 'email' => '[email protected]',\n 'hash' => $this->data['senderHash'],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ],\n 'address' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ]\n ],\n 'paymentMethod' => [\n 'type' => 'CREDITCARD',\n 'creditCard' => [\n 'token' => $this->data['token'],\n 'holder' => [\n 'name' => 'Customer Credit Name',\n 'birthDate' => '30/10/1990',\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ],\n 'billingAddress' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ]\n ]\n\n ]\n ]\n ]);\n\n return $response->json();\n }", "public function create() {\n \n }", "public function create() {\n \n }", "function register_subscription ($user_id, $subscription) {\n global $sql;\n if (empty($subscription['note']) || $subscription['note']['status'] !== 'COMPLETED') {\n return false;\n }\n $result = false;\n $current = $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n if (!empty($current)) {\n if($subscription['subscription_type'] <= $current[0]['subscription_type']) {\n $days_remaining = strtotime($current[0]['end_date']) > time() ? date_diff(date_create($current[0]['end_date']), date_create(date('Y-m-d H:i:s')))->format('%a') : 0;\n $end_date = $subscription['end_date'];\n $subscription['end_date'] = date('Y-m-d H:i:s', strtotime(\"{$end_date} + {$days_remaining} days\"));\n }\n $result = $sql->sql_update('subscription', $subscription, ['user_id' => $user_id]);\n } else {\n $result = $sql->sql_insert('subscription', $subscription);\n }\n $user = $sql->sql_select_array_query(\"SELECT email FROM `user` WHERE id = '{$user_id}' LIMIT 1\");\n if (count($user) === 1) {\n $this->send_email(\n EMAIL['email'], \n $user[0]['email'], \n 'Thank you for subscribing on IPTV-Tools.com', \n $this->subscription_body(date('j M Y', strtotime($subscription['end_date'])))\n );\n }\n return $result;\n }", "public function create()\n {\n\n \n \n }", "public function create(string $customerId, array $parameters = []): ApiResponse\n {\n $parameters['customer'] = $customerId;\n\n return $this->_post('subscriptions', $parameters);\n }", "public function create() {\n //\n }", "public function create() {\n }", "public function create() {\n }", "protected function create(array $data)\n { \n /*\n * add new users\n */\n $registrationToken = strtotime(\"now\") . rand(0, 999999);\n $newCreatedUser = User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'registration_token' => bcrypt($registrationToken),\n ]); \n\n /*\n * Create new account\n */ \n $account = Account::create(\n [ \n 'time_zone'=>'Asia/Taipei' \n ]\n ); \n // print \"<br><br> account id \" . $account->id;\n // dd($account);\n \n // dd($insertIntoUserAccount);\n\n /**\n * Create new user account\n */ \n UserAccount::create([\n 'account_id' => $account->id, \n 'user_id' => $newCreatedUser->id, \n 'role' => 'administrator'\n ]);\n \n // exit;\n /*\n * Send registration confirmation to the email \n */\n $user = User::find($newCreatedUser->id); \n $user->notify(new UserRegisteredNotification($user));\n\n\n /**\n * Create subscription\n */\n\n\n $subscription = Subscription::createNewSubscription($account->id); \n\n Activity::createActivity( ['account_id'=> $account->id, 'table_name'=>'users', 'table_id'=> $newCreatedUser->id, 'action'=> 'New user successfully created!'] );\n Activity::createActivity( ['account_id'=> $account->id, 'table_name'=>'accounts', 'table_id'=>$account->id, 'action'=> 'Your account successfully created!'] );\n Activity::createActivity( ['account_id'=> $account->id, 'table_name'=>'subscriptions', 'table_id'=> $subscription ->id, 'action'=> 'User account trial subscription successfully created!'] ); \n\n /*\n * return instance\n */\n return $newCreatedUser; \n }", "public function saveSubscription()\n {\n $email = $this->request->getParam('email');\n $jsonFactory = $this->jsonFactory->create();\n\n $subscribed_text = $this->helperData->getGeneralConfig(\"is_subscribed_text\");\n $thanksyou_text = $this->helperData->getGeneralConfig(\"thanksyou_text\");\n $confirm_text = $this->helperData->getGeneralConfig(\"confirm_text\");\n\n $subscribed_text = $subscribed_text ? $subscribed_text : __('This email address is already subscribed.');\n $thanksyou_text = $thanksyou_text ? $thanksyou_text : __('Thank you for your subscription.');\n $confirm_text = $confirm_text ? $confirm_text : __('The confirmation request has been sent.');\n\n try {\n $this->validateEmailFormat($email);\n $this->validateGuestSubscription();\n $this->validateEmailAvailable($email);\n\n $subscriber = $this->_subscriberFactory->create()->loadByEmail($email);\n if ($subscriber->getId()\n && $subscriber->getSubscriberStatus() == \\Magento\\Newsletter\\Model\\Subscriber::STATUS_SUBSCRIBED\n ) {\n $jsonData = [\n 'status' => 'error',\n 'message' => $subscribed_text\n ];\n\n return $jsonFactory->setData($jsonData);\n }\n\n $status = $this->_subscriberFactory->create()->subscribe($email);\n\n if ($status == \\Magento\\Newsletter\\Model\\Subscriber::STATUS_NOT_ACTIVE) {\n $jsonData = [\n 'status' => 'success',\n 'message' => $confirm_text\n ];\n } else {\n $jsonData = [\n 'status' => 'success',\n 'message' => $thanksyou_text\n ];\n }\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $jsonData = [\n 'status' => 'error',\n 'message' => __('There was a problem with the subscription: %1', $e->getMessage())\n ];\n } catch (\\Exception $e) {\n $jsonData = [\n 'status' => 'error',\n 'message' => __('Something went wrong with the subscription.')\n ];\n }\n\n return $jsonFactory->setData($jsonData);\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }" ]
[ "0.7494986", "0.73442197", "0.673031", "0.6701283", "0.66004896", "0.6591463", "0.65320283", "0.6472106", "0.6424054", "0.6403879", "0.6383709", "0.63482016", "0.6236066", "0.6219002", "0.6192785", "0.6143085", "0.60586184", "0.6057284", "0.6034366", "0.6026528", "0.5985806", "0.5973536", "0.59734", "0.59723073", "0.5954501", "0.59531116", "0.59415627", "0.5919138", "0.5907824", "0.58766323", "0.5869983", "0.5851937", "0.5847948", "0.58462054", "0.5835384", "0.58224964", "0.582126", "0.5817159", "0.5785235", "0.5780723", "0.5750388", "0.5713897", "0.57039946", "0.56785756", "0.5678541", "0.5662494", "0.5654756", "0.5635704", "0.56282175", "0.56227833", "0.56122494", "0.55875", "0.55827546", "0.55692667", "0.5568713", "0.5565755", "0.5527508", "0.5521054", "0.55130625", "0.55112946", "0.5502064", "0.55011237", "0.54992944", "0.54904336", "0.5485349", "0.54836774", "0.5482613", "0.54696983", "0.5469073", "0.5466289", "0.5466289", "0.5460391", "0.5458523", "0.54583704", "0.54574573", "0.5457122", "0.5457122", "0.54507756", "0.5450323", "0.54482013", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263", "0.5447263" ]
0.70536435
2
Operation createAsyncWithHttpInfo Create Subscription
public function createAsyncWithHttpInfo($create_subscription_request) { $returnType = '\OpenAPI\Client\Model\Subscription'; $request = $this->createRequest($create_subscription_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createSubscription($request);", "public function createWithHttpInfo($create_subscription_request)\n {\n $request = $this->createRequest($create_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function createAsync($create_subscription_request)\n {\n return $this->createAsyncWithHttpInfo($create_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createRequest($create_subscription_request)\n {\n // verify the required parameter 'create_subscription_request' is set\n if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $create_subscription_request when calling create'\n );\n }\n\n $resourcePath = '/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($create_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request));\n } else {\n $httpBody = $create_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create(CreateSubscriberRequest $request)\n {\n // create a new object, fill with data and save\n $data = $request->toArray();\n $subscriber = new Subscriber($data);\n $subscriber->save();\n\n // save to cache\n $cacheKey = \"subscriber-{$subscriber->id}\";\n RedisCache::instance()->set($cacheKey, serialize($subscriber));\n\n return new Response(201, 'Subscriber created', $subscriber);\n }", "public function create()\n {\n $subscription = new Subscription();\n\n return $subscription;\n }", "private function subscriptionFactory($name, array $info = [])\n {\n return new Subscription(\n $this->connection,\n $this->projectId,\n $name,\n $this->name,\n $this->encode,\n $info\n );\n }", "function createNewSubscription(array $data){\nreturn $this->post($data, \"/subscription\");\n}", "public function create(string $customerId, array $parameters = []): ApiResponse\n {\n $parameters['customer'] = $customerId;\n\n return $this->_post('subscriptions', $parameters);\n }", "public function create()\n {\n return view(\"admin.subscriptions.create\");\n }", "public function createSubscription($parameters) {\r\n $request = FlexmailAPI::parseArray($parameters);\r\n\r\n $response = $this->execute(\"CreateGroupSubscription\", $request);\r\n return FlexmailAPI::stripHeader($response, $this->config->get('debug_mode'));\r\n }", "public function create()\n {\n //\n return view('backend.subscriptions.create');\n }", "public function create(CreateSubscriberDTO $details)\r\n {\r\n $details = json_decode(json_encode($details), true);\r\n $res = $this->subscriberModel->create($details);\r\n\r\n return $res;\r\n }", "public function create()\n {\n return view('subscription::create');\n }", "public function newSubscription(array $data = [], string $name = 'default')\n {\n $trialEndsAt = null;\n if ($data['status'] === Paddle::STATUS_TRIALING) {\n $time = Carbon::parse($data['event_time'])->format('H:i:s');\n $trialEndsAt = Carbon::parse(\"{$data['next_bill_date']} {$time}\");\n }\n\n return $this->subscriptions()->create([\n 'user_id' => $this->id,\n 'name' => $name,\n 'paddle_id' => $data['subscription_id'],\n 'paddle_plan_id' => $data['subscription_plan_id'],\n 'paddle_cancel_url' => $data['cancel_url'],\n 'paddle_update_url' => $data['update_url'],\n 'paddle_status' => $data['status'],\n 'quantity' => $data['quantity'],\n 'trial_ends_at' => $trialEndsAt,\n 'ends_at' => null\n ]);\n }", "public function actionCreate()\n {\n $model = new UserSubscriber();\n\n $success = false;\n $msg = 'There was an error, please try again later.';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $success = true;\n $msg = 'Thank you for subscription for newsletter.';\n }\n\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['success' => $success, 'msg' => $msg];\n\n }", "public function addFreeSubscriptionRequest()\n {\n\n $resourcePath = '/subscriptions/saas/free';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create()\n {\n $subscriptions = Subscription::all();\n\n return view('subscription.subscribe', compact('subscriptions'));\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "function createObject() {\n\t\treturn new InstitutionalSubscription();\n\t}", "function create_subscription($subscription) {\n\n // Get codeigniter object instance\n $CI = &get_instance();\n\n // Try to save the subscription\n if ( $CI->base_model->insert('subscriptions', $subscription) ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n \n }", "protected function createdASubscription(): bool\n {\n $this->createSubscription();\n\n if(!$this->subscription):\n return $this->subscriptionCreationFailed();\n endif;\n\n // Making sure clients won't be charged after trial period.\n $this->subscription_api->cancelAtTerms($this->subscription);\n\n return true;\n }", "public function create()\n {\n // handled by client\n }", "public function createAction(Request $request)\n {\n $entity = new SubscriptionBase();\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('admin_subscriptions_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createSubscriptionWithPaymentMethod(CreateSubscriptionWithPaymentMethodRequest $request)\n {\n $response = $this->paymentMethodService->createPaymentMethod($request);\n $request->merge([\n 'payment_method' => $response['id'],\n ]);\n\n $this->apiData = $this->subscriptionService->createSubscription($request);\n\n return $this->success();\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create(array $attributes = [])\n {\n $trialEndsAt = null;\n\n if (!$this->skipTrial) {\n if (!is_null($this->trialPeriod) && $this->trialPeriod > 0) {\n $trial = new Period($this->trialInterval, $this->trialPeriod, now());\n $trialEndsAt = $trial->getEndAt();\n } elseif ($this->plan->hasTrial()) {\n $trial = new Period($this->plan->trial_interval, $this->plan->trial_period, now());\n $trialEndsAt = $trial->getEndAt();\n }\n }\n\n $period = new Period($this->plan->invoice_interval, $this->plan->invoice_period, $trialEndsAt);\n\n return $this->subscriber->subscriptions()->create(array_merge([\n 'name' => $this->name,\n 'plan_id' => $this->plan->getKey(),\n 'trial_ends_at' => $trialEndsAt,\n 'starts_at' => $period->getStartAt(),\n 'ends_at' => $period->getEndAt(),\n ], $attributes));\n }", "public function create()\n {\n return view('subscriptions.create');\n }", "public function create()\n {\n return response() -> json([\n \"success\" => true,\n \"services\" => \"Crear\"\n ], 200);\n }", "public function createSubscription(CustomerInterface $customer, PaymentMethodInterface $payment_method, $product_name, string $period, ...$arguments): SubscriptionInterface;", "public function create()\n {\n return $this->makeJSONResponse(true, 'This endpoint is not implemented', [], []);\n }", "public function create()\n {\n $ostObj = $this->instantiateOSTSDKForV2Api();\n $usersService = $ostObj->services->users;\n $params = array();\n $response = $usersService->create($params)->wait();\n $this->isSuccessResponse($response);\n }", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public function create($create_subscription_request)\n {\n list($response) = $this->createWithHttpInfo($create_subscription_request);\n return $response;\n }", "function TestPlan_create($author_id, $product_id, $default_product_version, $type_id, $name, $creation_date = NULL, $isactive = TRUE) {\n\t$varray = array(\"author_id\" => \"int\", \"product_id\" => \"int\", \"default_product_version\" => \"string\", \"type_id\" => \"int\", \"name\" => \"string\", \"creation_date\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function create(Request $request){\n\n $suscription = new Subscription([\n 'plan_id' => $request->plan_id,\n 'date_start' => Carbon::now(),\n 'date_end' => Carbon::now()->addMonths(2),\n ]);\n $suscription->save();\n $car_suscription = new CarSubscription([\n 'subscription_id' => $suscription->id,\n 'cars_id' => $request->car_id,\n ]);\n $car_suscription->save();\n return response()->json([\n 'message' => 'Creado exitosamente!'], 201);\n }", "public function createLicenseKeyAsyncWithHttpInfo($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\LicenseKeyModel';\n $request = $this->createLicenseKeyRequest($id, $x_avalara_client, $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 create(\n string $connection,\n array $body,\n ?RequestOptions $options = null,\n ): ResponseInterface;", "public function create() {\n\t\treturn parent::post(false, ['api_key'=>self::$apiKey]);\n\t}", "public function create(string $name, array $options = []);", "public function createTopicAndSubscription(string $topicName, string $subscriptionName, string $type): PubSubService\n {\n if (!$this->validName($topicName) || ('pull' == $type && !$this->validName($subscriptionName))) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'The Resource name (topic or subscription) has not a valid format see https://cloud.google.com/pubsub/docs/admin#resource_names for more information.', 'HTTP_CONFLICT')));\n }\n\n $topic = $this->pubSubClient()->topic($topicName);\n\n if (!$topic->exists()) {\n $topic = $this->createTopic($topicName);\n if ($this->getTopicFullName() == $topic) {\n $subscription = $this->pubSubClient()->subscription($subscriptionName);\n\n if ('pull' == $type) {\n if (!$subscription->exists()) {\n $topic = $this->createSubscription($topicName, $subscriptionName);\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n } else {\n if (!$subscription->exists()) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" not exist, add a new subscription in the GCP Console by specify the push method.', 'HTTP_CONFLICT')));\n }\n }\n\n $this->setTopicFullName($topicName);\n $this->setSubscriptionFullName($subscriptionName);\n\n $this->_setInfo();\n\n return $this;\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" not exist, there was an error during topic creation.', 'HTTP_CONFLICT')));\n }\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n }", "public function created(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'started');\n }", "public function createTokenAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\TokenCreatedResponse';\n $request = $this->createTokenRequest($options);\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 }\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 create(Request $request)\n {\n $id = $request->id;\n\n return view('subscriber.create',compact('id'));\n }", "public function create()\n {\n return view ('subscriber::subscriber_create');\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "protected function _create_subscription ( array $values ){\n\n return new Payment_Subscription( $values );\n\n }", "public function postCreate(Request $request)\n {\n //echo \"dfadsf\";exit;\n \n // // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription= new Subscription();\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data inserted successfully'));\n\n }", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "protected function createSubscriptionResponse(ApiResource $resource): SubscriptionResponseInterface\n {\n $this->configureStripeClient();\n $data = $resource->toArray();\n\n return new SubscriptionResponse($data);\n }", "protected function createBasicSubscriptionAndOrder() {\n $subscription = Subscription::create([\n 'type' => 'product_variation',\n 'store_id' => $this->store->id(),\n 'billing_schedule' => $this->billingSchedule,\n 'uid' => $this->user,\n 'payment_method' => $this->paymentMethod,\n 'purchased_entity' => $this->variation,\n 'title' => $this->variation->getOrderItemTitle(),\n 'unit_price' => new Price('2', 'USD'),\n 'state' => 'pending',\n 'starts' => \\Drupal::time()->getRequestTime() - 5,\n 'ends' => \\Drupal::time()->getRequestTime() + 1000,\n ]);\n $subscription->save();\n\n $order_storage = \\Drupal::entityTypeManager()->getStorage('commerce_order');\n $result = $order_storage->getQuery()\n ->condition('type', 'recurring')\n ->pager(1)\n ->execute();\n $this->assertEmpty($result);\n\n $subscription->getState()->applyTransition($subscription->getState()->getTransitions()['activate']);\n $subscription->save();\n\n $orders = $order_storage->loadMultiple($order_storage->getQuery()\n ->condition('type', 'recurring')\n ->execute());\n $this->assertCount(1, $orders);\n $order = reset($orders);\n\n return [$subscription, $order];\n }", "public function create()\n {\n \n return view('backend.subscriber.create');\n \n }", "public function create($params = []) {\n\t\tif(is_null($this->create_endpoint)) {\n\t\t\tthrow new BadMethodCallException('method not supported on this resource');\n\t\t}\n\n\t\t$params = array_merge($this->data, $params);\n\t\t$uri = $this->substitute($this->create_endpoint,$params);\n\t\t$response = $this->client->request('POST', $uri, ['json' => $params]);\n\n\t\t$decoded = $this->client->decode($response);\n\n\t\t$params = (array) $decoded[$this->response_key];\n\t\t$params['client'] = $this->client;\n\n\t\treturn new static($params);\n\t}", "public function addPassTrialSubscriptionRequest()\n {\n\n $resourcePath = '/subscriptions/paas/trial';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createLicenseKeyAsync($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0', $body = null)\n {\n return $this->createLicenseKeyAsyncWithHttpInfo($id, $x_avalara_client, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function makeSubscription($subscriptionFields = [])\n {\n /** @var SubscriptionRepository $subscriptionRepo */\n $subscriptionRepo = App::make(SubscriptionRepository::class);\n $theme = $this->fakeSubscriptionData($subscriptionFields);\n return $subscriptionRepo->create($theme);\n }", "public function postAdd() {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ()) {\n $isCreated = true;\n $this->request->session ()->flash ( StringLiterals::SUCCESS, trans ( 'cms::subscription.add.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.add.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.add.error' ) );\n }", "public function create(Request $request)\n {\n $user = $request->user();\n $user->createOrGetStripeCustomer();\n if($user->subscribed()){\n return $user->redirectToBillingPortal();\n }\n\n return view('.subscription.create', [\n 'intent' => $user->createSetupIntent()\n ]);\n }", "public function create()\n {\n return new GuzzleHttp\\Client(['base_uri' => 'https://sisa.msal.gov.ar/sisa/services/rest/cmdb/obtener']);\n }", "function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }", "public function create(array $resource);", "public function create_or_update_subscriber( $params ) {\n\t\tif ( empty( $params['account_id'] ) ) {\n\t\t\tthrow new Exception( 'Account ID not specified' );\n\t\t}\n\n\t\t$account_id = $params['account_id'];\n\t\tunset( $params['account_id'] ); // clear it from the params\n\n\t\t$api_action = \"/$account_id/subscribers\";\n\t\t$url = $this->api_end_point . $api_action;\n\n\t\t// The API wants the params to be JSON encoded\n\t\t$req_params = array( 'subscribers' => array( $params ) );\n\n\t\t$res = $this->make_request( $url, $req_params, static::POST );\n\n\t\treturn empty( $res ) ? false : $res;\n\t}", "public function create()\n {\n $title = 'Create Subscriber';\n $topics = Auth::user()->topics;\n return view('subscriber.create', compact('title','topics'));\n }", "protected function _processTransactionSubscriptionCreated($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'New subscription #' . $subscriptionData[0]['id'] . ' created',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_created',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function createSubscriber();", "private function _setInfo(): PubSubService\n {\n $this->_info = [\n 'info' => [\n 'code' => Response::HTTP_CREATED,\n 'message' => [\n 'topicName' => $this->getTopicFullName(),\n 'subscriptionName' => $this->getSubscriptionFullName(),\n 'projectId' => $this->_projectId,\n ],\n 'status' => 'HTTP_CREATED',\n ],\n ];\n\n return $this;\n }", "private function createCreateForm(SubscriptionBase $entity)\n {\n $form = $this->createForm(new SubscriptionBaseType(), $entity, array(\n 'action' => $this->generateUrl('admin_subscriptions_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function createOrUpdateAsync($resourceGroupName, array $parameters, array $customHeaders = [])\n {\n if ($resourceGroupName == null) {\n Validate::notNullOrEmpty($resourceGroupName, '$resourceGroupName');\n }\n if ($parameters == null) {\n Validate::notNullOrEmpty($parameters, '$parameters');\n }\n if ($this->_client->getApiVersion() == null) {\n Validate::notNullOrEmpty($this->_client->getApiVersion(), '$this->_client->getApiVersion()');\n }\n if ($this->_client->getSubscriptionId() == null) {\n Validate::notNullOrEmpty($this->_client->getSubscriptionId(), '$this->_client->getSubscriptionId()');\n }\n\n $path = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}';\n $statusCodes = [201, 200];\n $method = 'PUT';\n\n $path = strtr($path, ['{resourceGroupName}' => $resourceGroupName, '{subscriptionId}' => $this->_client->getSubscriptionId()]);\n $queryParams = ['api-version' => $this->_client->getApiVersion()];\n $headers = $customHeaders;\n if ($this->_client->getAcceptLanguage() != null) {\n $headers['accept-language'] = $this->_client->getAcceptLanguage();\n }\n if ($this->_client->getGenerateClientRequestId()) {\n $headers[Resources::X_MS_REQUEST_ID] = Utilities::getGuid();\n }\n\n $headers['Content-Type'] = 'application/json; charset=utf-8';\n $body = $this->_client->getDataSerializer()->serialize($parameters);\n\n $response = HttpClient::send(\n $method,\n $headers,\n $queryParams,\n [],\n $this->_client->getUrl($path),\n $statusCodes,\n $body,\n $this->_client->getFilters()\n );\n\n return $response;\n }", "public function create()\n {\n return view('admin.subs.subscriptiontype.create')->with('dates', self::dates());\n }", "public function create($publication, array $options = array())\n {\n $body = (isset($options['body']) ? $options['body'] : array());\n $body['publication'] = $publication;\n\n $response = $this->client->post('/api/topics/'.rawurlencode($this->topic_id).'/publications', $body, $options);\n\n return $response;\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "abstract public function add_subscription( Payment_Subscription $subscription );", "public function createPrivateKeyAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Key';\n $request = $this->createPrivateKeyRequest();\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 stripeSubscribe(Request $request)\n {\n $this->validate($request, [\n 'plan_id' => 'string|required',\n 'payment_method_id' => 'string|required',\n ]);\n\n // Create New Stripe customer\n if (is_null(auth()->user()->stripe_id) || empty(auth()->user()->stripe_id)) {\n $name = auth()->user()->fullname ? auth()->user()->email : null;\n $address = [\n 'line1' => '510 Townsend St',\n 'postal_code' => '98140',\n 'city' => 'San Francisco',\n 'state' => 'CA',\n 'country' => 'US',\n ];\n $email = (auth()->user()->email) ? auth()->user()->email : null;\n $customer = $this->stripeCustomer->createSubscriptionCustomer($name,$email,$address,$request->payment_method_id);\n }\n //stripe customer id\n $customer_id = auth()->user()->stripe_id;\n\n // Subscribe customer to a plan\n $subscription = $this->stripeCustomer->createSubscription($request->plan_id, $customer_id, $request->trial_period);\n\n $sub = Subscriptions::create([\n 'user_id' => auth()->user()->id,\n 'customer_id' => $subscription->customer,\n 'subscription_id' => $subscription->id,\n 'subscription_amount' => $subscription->plan->amount,\n 'plan_name' => $subscription->plan->nickname,\n 'subscription_start_date' => date('Y-m-d h:i:s', $subscription->current_period_start),\n 'subscription_end_date' =>date('Y-m-d h:i:s', $subscription->current_period_end),\n 'subscription_trial_period' => date('Y-m-d h:i:s', $subscription->trial_end),\n ]);\n\n if ($subscription && $sub) {\n $response = \"successful\";\n return json_encode($response);\n } else {\n $response = \"failed\";\n return json_encode($response);\n }\n }", "public function subscriptionPurchaseAllowedAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->subscriptionPurchaseAllowedRequest();\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 subscription($name)\n {\n return $this->subscriptionFactory($name);\n }", "public function create()\n {\n return \\Response::view('service.create');\n }", "public function postCreateSubscription(CreateSubscriptionRequest $request)\n {\n try {\n DB::beginTransaction();\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($request->cardExist === \"true\") {\n $this->addUserTOSubscription($recruiter['customer_id'], $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n if ($recruiter['customer_id'] == null) {\n $createCustomer = $this->createCustomer();\n if ($createCustomer['success'] == true) {\n $customer = $createCustomer['data']['id'];\n } else {\n $customer = null;\n $this->response['success'] = false;\n $this->response['message'] = $createCustomer['message'];\n $this->response['data'] = null;\n }\n } else {\n $customer = $recruiter['customer_id'];\n }\n if ($customer != null) {\n $addCard = $this->addCardForSubscription($request->all(), $customer);\n if ($addCard['success'] == true) {\n $this->addUserTOSubscription($customer, $request->subscriptionType, $request->trailPeriod);\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue'), 'free_period' => $request->trailPeriod]);\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.user_subscribed');\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $addCard['message'];\n }\n } else {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = trans('messages.cannot_subscribe');\n }\n }\n DB::commit();\n } catch (\\Exception $e) {\n DB::rollback();\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function createScheduled(int $id, array $attributes): ResponseInterface;", "public function create($data)\n {\n $endpoint = $this->endpoint;\n return $this->call('POST', $endpoint, $data);\n }", "function createSubscriptionFromCustomerProfile($intervalLength, $customerProfileId,\n $customerPaymentProfileId, $customerAddressId\n ) {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(config('services.authorize.login'));\n $merchantAuthentication->setTransactionKey(config('services.authorize.key'));\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Sample Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime('2020-08-30'));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"1\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount(rand(1,99999)/12.0*12);\n $subscription->setTrialAmount(\"0.00\");\n\n $profile = new AnetAPI\\CustomerProfileIdType();\n $profile->setCustomerProfileId($customerProfileId);\n $profile->setCustomerPaymentProfileId($customerPaymentProfileId);\n $profile->setCustomerAddressId($customerAddressId);\n\n $subscription->setProfile($profile);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n echo \"SUCCESS: Subscription ID : \" . $response->getSubscriptionId() . \"\\n\";\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n }\n\n return $response;\n }", "public function store(CreateSubcategoryAPIRequest $request)\n {\n $input = $request->all();\n\n $subcategories = $this->subcategoryRepository->create($input);\n\n return $this->sendResponse($subcategories->toArray(), 'Subcategory saved successfully');\n }", "protected function getCreateResponse()\n\t{\n\t\treturn new Api\\Response\\Create();\t\n\t}", "public function createDocumentLinkAsyncWithHttpInfo($id, $documentCreateLinkRequest)\n {\n $returnType = '\\PandaDoc\\Client\\Model\\DocumentCreateLinkResponse';\n $request = $this->createDocumentLinkRequest($id, $documentCreateLinkRequest);\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 }\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 create($name, $type = null, array $options = array());", "public function subscribeToTopic(Request $request, $topic)\n {\n\n $validator = Validator::make($request->all(), [\n \"url\" => [\"required\", \"url\"]\n ]);\n\n if ($validator->fails()) {\n return response()->json(['errors' => $validator->errors()]);\n }\n\n $subscription = $this->subscriptionService->createSubscription($request->url, $topic);\n\n if($subscription[\"success\"])\n return response()->json(new CreateSubscriptionResource($subscription[\"data\"]));\n\n return response()->json($subscription, 201);\n }", "public function create(): JsonResponse;", "public function create()\n {\n // Define objet to be returned as a json string\n $data = new \\stdClass();\n $data->success = false;\n $data->error = \"Not allowed\";\n\n return \\Response::json($data);\n }", "public function create()\n {\n return view('backend.vendor-subscription-plan.create');\n }", "public function getRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling get'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create(Request $request)\n {\n $data = $this->report->call($request);\n\n return apiResponseBuilder(200, $data, 'Success');\n }", "function create_subscription_token($data){\n // $n = convert_timezone(strtotime(\"now\"), true, true,false,\"m/d/Y h:i:sP\");\n // $now = new DateTime($n);\n // $now->format(\"m/d/Y h:i:sP\");\n $plandata = $this->get_plan_name($data->planId);\n if($data->addOnId != ''){\n $result = Braintree_Subscription::create([\n 'paymentMethodToken' => $data->paymentMethodToken,\n 'planId' => $data->planId,\n 'addOns' => [\n 'add' => [\n [\n 'inheritedFromId' => $data->addOnId,\n 'neverExpires' => true,\n 'quantity' => $data->quantity\n ] \n ] \n ],\n 'descriptor' => [\n //'name' => \"TRACKER*\".$plandata['description']\n 'name' => \"TRCKRTR*PLAN\"\n ]\n // 'firstBillingDate' => $now,\n // 'options' => ['startImmediately' => true]\n ]);\n // if($result){\n // return $result;\n // }else{\n // // $error = \"\";\n // // // foreach($result->errors->deepAll() AS $error) {\n // // // $error .= $error->code . \": \" . $error->message . \"\\n\";\n // // // //echo($error->code . \": \" . $error->message . \"\\n\");\n // // // }\n // return $error;\n // }\n }else{\n $result = Braintree_Subscription::create([\n 'paymentMethodToken' => $data->paymentMethodToken,\n 'planId' => $data->planId,\n 'descriptor' => [\n //'name' => \"TRACKER*\".$plandata['description']\n\n 'name' => \"TRCKRTR*PLAN\"\n ]\n // 'firstBillingDate' => $now,\n // 'options' => ['startImmediately' => true]\n ]);\n }\n\n return $result;\n }", "public function createSubscription($plan=null,$customer=null,$trial_period=null)\n {\n $subscription = \\Stripe\\Subscription::create([\n 'customer' => $customer,\n 'items' => [\n [\n 'plan' => $plan,\n ],\n ],\n 'expand' => ['latest_invoice.payment_intent'],\n 'trial_end' => ($trial_period > 0)? Carbon::now()->addDays($trial_period)->timestamp:null,\n ]);\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_subscriptionId = $subscription->id;\n $user->save();\n\n return $subscription;\n }", "public function quoteDraftsV2PostAsyncWithHttpInfo($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->quoteDraftsV2PostRequest($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 function createTopic(Topic $topic, TopicBind ...$binds): Promise\n {\n return $this->transport->createTopic($topic, ...$binds);\n }", "public function Create()\n {\n \t// CREATE RETAILER TYPE ////////////////////////////////////////////\n \t$rs = mysql_query(\"INSERT INTO subscriptions (subscription_name_fr,\n\t subscription_name_en,\n \t\t\t\t\t\t\t\t\t\t\t\t subscription_desc_fr,\n\t subscription_desc_en,\n\t created_by_id,\n\t created_date,\n\t modified_by_id,\n\t modified_date,\n\t \t\t\t\t\t\t\t\t rowguid) VALUES\n ('\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"','\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->created_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t\"','\" . create_guid() .\"')\");\n \t\t \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\t \n \t\t \n \t$this->subscription_id = mysql_insert_id();\n \t\t \n \treturn mysql_insert_id();\n \t\t \n \t\n }", "public function createRequest();", "public function createRequest();" ]
[ "0.67132217", "0.6611952", "0.64535356", "0.6451743", "0.600399", "0.59556895", "0.58881277", "0.5735445", "0.571406", "0.5318157", "0.53125125", "0.528297", "0.524467", "0.52340466", "0.5222019", "0.52152634", "0.5180291", "0.5180248", "0.51773584", "0.51756066", "0.5151299", "0.51426417", "0.5142399", "0.50951385", "0.5081441", "0.5072552", "0.5065387", "0.505066", "0.50496924", "0.50481164", "0.5040931", "0.5034129", "0.5029391", "0.50260746", "0.49962768", "0.49169245", "0.4913123", "0.49100134", "0.49012443", "0.48989132", "0.48797444", "0.48736912", "0.48697028", "0.4868649", "0.48674002", "0.4864206", "0.48343503", "0.48181328", "0.48172617", "0.48096675", "0.4794966", "0.47901425", "0.47855976", "0.47753313", "0.47668806", "0.47486326", "0.47463128", "0.47416422", "0.47268736", "0.47242945", "0.47234926", "0.47180364", "0.4701098", "0.469916", "0.46817777", "0.46789595", "0.46782923", "0.4678261", "0.466613", "0.4658788", "0.46570453", "0.46490082", "0.46399713", "0.46389848", "0.46304822", "0.46210682", "0.46204633", "0.4618701", "0.4613782", "0.46023875", "0.45995018", "0.45986772", "0.45939928", "0.45927757", "0.45887843", "0.45782378", "0.45600742", "0.45570204", "0.45563576", "0.45512408", "0.45452794", "0.45279044", "0.45173186", "0.45172942", "0.45166415", "0.45132646", "0.45121896", "0.45073572", "0.45067865", "0.45067865" ]
0.6947793
0
Create request for operation 'create'
public function createRequest($create_subscription_request) { // verify the required parameter 'create_subscription_request' is set if ($create_subscription_request === null || (is_array($create_subscription_request) && count($create_subscription_request) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $create_subscription_request when calling create' ); } $resourcePath = '/subscriptions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($create_subscription_request)) { if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($create_subscription_request)); } else { $httpBody = $create_subscription_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create() {\n $this->operationsModel->create($_POST);\n $this->response('',200,'Success');\n }", "public function createRequest();", "public function createRequest();", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function create(Request $request);", "public function create()\n {\n \n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create() {\n //\n }", "public function actionCreate() {}", "public function actionCreate() {}", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create(){}", "public function create($request) {\n\n\n\n }", "public function create()\n {\n // handled by client\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function createAction()\n {\n $data = $this->getRequest()->getBody();\n $model = $this->getBinding()->create($data);\n $responseClass = $this->container->getParameter('response.class');\n $response = new $responseClass($model, 201);\n\n return $response;\n }", "public function create($request)\n {\n }", "public function create($request)\n {\n }", "public function create($request)\n {\n }", "public function create($request)\n {\n }", "public function create() {\r\n //\r\n }", "public function create()\n {\n //TODO\n }", "public function create()\n {\n // \n }", "public function create()\n {\n\n \n \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.795575", "0.78607875", "0.78607875", "0.7826036", "0.7748363", "0.75838524", "0.75524616", "0.75524616", "0.75524616", "0.75524616", "0.752614", "0.751494", "0.751494", "0.74968624", "0.7489317", "0.7489317", "0.7489317", "0.74852437", "0.74852437", "0.74780756", "0.74760544", "0.746176", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.74551576", "0.7452234", "0.74507916", "0.74507916", "0.74507916", "0.74507916", "0.744316", "0.7439745", "0.7437424", "0.743612", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285", "0.74354285" ]
0.0
-1
Operation get Get Subscription
public function get($id) { list($response) = $this->getWithHttpInfo($id); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getSubscription($request);", "public function getSubscriptions();", "public function getSubscriptionWithId(int $subscriptionId);", "public function getSubscription()\n {\n return $this->subscription;\n }", "public function retrieveSubscription() {\n // Adrian: Get user subscription details from the database\n /**$subscription = Subscription::where('user_id', $this->model->id)\n ->where('plan_id', $this->plan)\n ->first();**/\n\n $result = ChargeBee_Subscription::retrieve($this->user->subscription_id);\n\n return $result;\n }", "public function GetSubscription()\n {\n \t$this->SetCulture();\n \t \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions WHERE subscription_id=\" . $this->subscription_id);\n \t \n \t$row = mysql_fetch_array($rs);\n \n \t$this->subscription_id\t\t= $row['subscription_id'];\n \t$this->subscription_name\t= $row[$this->lang_name_field];\n \t\n \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n }", "public function listSubscriptions($request);", "public function getSubscriptionDetails()\n {\n try {\n $subscriptions = $this->fetchSubscription(Auth::user()->id);\n $this->response['success'] = true;\n $this->response['data'] = $subscriptions;\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function getSubscription($subscriptionId)\n {\n $url = $this->host . '/v1/billing/subscriptions/' . $subscriptionId;\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPGET, 1);\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n\n $this->cUrl = $curl;\n\n return $this->sendRequest();\n //===\n }", "public function getSubscriptions() {\n\t\t$urlSubscriptions = \"http://www.reddit.com/reddits/mine.json\";\n\t\treturn $this->runCurl ( $urlSubscriptions );\n\t}", "public function getSubscription(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n $result = $this->validateAuthenticator($data);\n if (empty($result['error'])) {\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n unset($result['secret']);\n return new JsonResponse($result);\n }\n unset($result['secret']);\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }", "public function subscription($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Subscription::find_with_client($this, $id);\n\n }", "public function getSubscriptionById($id_subscription) {\n $this->db->where('ID_SUBSCRIPTION', $id_subscription);\n $query = $this->db->get($this->table);\n return $query->row();\n}", "public function getSubscriptionId();", "public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }", "public function subscriptions()\n {\n return Subscription::byCustomer($this->id);\n }", "public function getSubscriptionDetails($request);", "public function GetSubscriptionsList()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" => $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name\"\t=> $row[$this->lang_name_field]\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function getSubscriptions($options = NULL, $customClient = NULL) {\n\t\treturn Bf_Subscription::getByRatePlanID($this->id, $options, $customClient);\n\t}", "public function getSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription had proberties\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n\n // init subscriber data array an save the proberties plain\n $data = array();\n $data['resourceProperties'] = $subscriptionResourceProperties;\n // fill the subscriber data array with the subscription resource content\n foreach ($this->_propertyMatching as $dataKey => $propertyKey) {\n // get property content\n $propertyUri = $this->_subscriptionConfig->get($propertyKey);\n $propertyArray = isset($subscriptionResourceProperties[$propertyUri]) ?\n $subscriptionResourceProperties[$propertyUri] :\n null;\n\n // if property content exists write it to the subscriber data array\n if (isset($propertyArray) && \"\" != $propertyArray[0]['content']) {\n $data[$dataKey] = $propertyArray[0]['content'];\n } else {\n $data[$dataKey] = null;\n }\n }\n return $data;\n }\n return false;\n }", "public function subscription($subscription = 'default')\n {\n return $this->subscriptions->sortByDesc(function ($value) {\n return $value->created_at->getTimestamp();\n })->first(function ($value) use ($subscription) {\n return $value->name === $subscription;\n });\n }", "public function index()\n {\n $user = User::with(\"subscriptions\")->find(Auth::user()->id);\n $subscriptions = $user->subscriptions->toArray();\n\n return ResponseHelper::success($subscriptions, __(\"Retornando assinatura\"));\n }", "public function index()\n {\n $user_id = Auth::id();\n $subscribes = User::findOrFail($user_id)->subscriptions;\n // return $subscribes;\n return view('profile.subscription')->with('subscribes', $subscribes);\n }", "function obtainReportForSubscription(string $id){\nreturn $this->get(\"/subscription/report/{$id}\");\n}", "public function getSubscription()\n {\n /** @var \\ParadoxLabs\\Subscriptions\\Api\\Data\\SubscriptionInterface $subscription */\n $subscription = $this->registry->registry('current_subscription');\n\n return $subscription;\n }", "public function getSubscription( $subscriptionId )\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT subscription_id, issue_id, user_id, stamp_id'\n . ' FROM {subscriptions}'\n . ' WHERE subscription_id = %d AND user_id = %d';\n\n if ( !( $subscription = $this->connection->queryRow( $query, $subscriptionId, $principal->getUserId() ) ) )\n throw new System_Api_Error( System_Api_Error::UnknownSubscription );\n\n return $subscription;\n }", "public function get(string $id): Subscription\n {\n $response = $this->performApiCall(\n 'GET',\n \"subscriptions/{$id}\"\n );\n\n return new Subscription(collect($response));\n }", "public function getSubscriptionKey() { return $this->subscriptionKey; }", "function &getSubscription($subscriptionId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tAND s.subscription_id = ?',\n\t\t\t$subscriptionId\n\t\t);\n\n\t\t$returner = null;\n\t\tif ($result->RecordCount() != 0) {\n\t\t\t$returner =& $this->_returnSubscriptionFromRow($result->GetRowAssoc(false));\n\t\t}\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function find(string $subscriptionId): ApiResponse\n {\n return $this->_get(\"subscriptions/{$subscriptionId}\");\n }", "public function getIndex() {\n $data = $this->repository->getAllsubscriptions ();\n if (auth ()->user ()) {\n $data ['subscribed_plan'] = auth ()->user ()->activeSubscriber ()->first ();\n $data ['plan_duration_left'] = '';\n if ($data ['subscribed_plan']) {\n $end = Carbon::parse ( $data ['subscribed_plan']->pivot->end_date );\n $now = Carbon::now ();\n $length = $end->diffInDays ( $now );\n $data ['plan_duration_left'] = $length . ' days left';\n }\n } else {\n $data ['subscribed_plan'] = null;\n $data ['plan_duration_left'] = '';\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'response' => [ 'allSubscriptions' => $data,'allSubscriptions' => $data ] ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showError' ) );\n }", "public function index()\n {\n $subscription = Subscription::all();\n return view('admin.subscription.subsription',compact('subscription'));\n\n }", "function wcs_get_subscription( $the_subscription ) {\n\n\tif ( is_object( $the_subscription ) && wcs_is_subscription( $the_subscription ) ) {\n\t\t$the_subscription = $the_subscription->get_id();\n\t}\n\n\t$subscription = WC()->order_factory->get_order( $the_subscription );\n\n\tif ( ! wcs_is_subscription( $subscription ) ) {\n\t\t$subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_get_subscription', $subscription );\n}", "public function getSubscriptionByReference(string $subscription_reference): SubscriptionInterface;", "public function getSubscriptionId()\n\t{\n\t\treturn $this->_subscriptionId;\n\t}", "public function getSubscriptionsToEmail()\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT s.subscription_id, s.issue_id, s.user_id, s.stamp_id'\n . ' FROM {subscriptions} AS s'\n . ' JOIN {issues} AS i ON i.issue_id = s.issue_id'\n . ' JOIN {folders} AS f ON f.folder_id = i.folder_id'\n . ' JOIN {projects} AS p ON p.project_id = f.project_id';\n if ( !$principal->isAdministrator() )\n $query .= ' JOIN {effective_rights} AS r ON r.project_id = f.project_id AND r.user_id = %1d';\n $query .= ' WHERE s.user_id = %1d AND i.stamp_id > s.stamp_id AND p.is_archived = 0';\n\n return $this->connection->queryTable( $query, $principal->getUserId() );\n }", "public static function getSubscriptionProductsList() {\n $sku = array();\n $query = db_select('commerce_product', 'cp');\n $query->fields('cp', array('sku'));\n $query->leftJoin('field_data_field_product', 'pr', 'cp.product_id = pr.entity_id');\n $query->condition('pr.bundle', 'subscription', '=');\n $result = $query->execute();\n while ($product = $result->fetchAssoc()) {\n $sku[] = $product['sku'];\n }\n return new Response(TRUE, $sku, NULL);\n }", "public function subscribeService()\n\t{\n\t\t$serviceid = $this->db->select('*')\n\t\t\t\t\t\t\t->get('subscriber');\n\t\treturn $serviceid->result();\n\t}", "function subscriptions ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n }", "function listActiveSubscriptions(int $pageSize = 50, int $offset = 0){\nreturn $this->get(\"/subscription?pageSize={$pageSize}&offset={$offset}\");\n}", "public function subscription()\n {\n return $this->hasOne('App\\Subscription');\n }", "public function subscription($name = 'default')\n {\n return $this->subscriptions->sortByDesc(function (Subscription $subscription) {\n return $subscription->created_at->getTimestamp();\n })->first(function (Subscription $subscription) use ($name) {\n return $subscription->name === $name;\n });\n }", "public function show(Subscription $subscription)\n {\n //\n }", "public function get_active_subscriptions() {\r\n return $this->get_all_subscriptions( true );\r\n }", "public function getCurrentSubscription($companyId);", "public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }", "public function show(Request $request)\n {\n return new GenericResource(Subscription::find($request->id), [\n 'id',\n 'title',\n 'description',\n 'price',\n 'active',\n 'type',\n ['role' => ['id']],\n 'duration',\n ]);\n }", "public static function subscriptions($body = null)\n\t{\n\t\t$returned = \\QuickFile\\Request::_sendData([], '/report/subscriptions');\n\t\treturn $returned->Report_Subscriptions->Body;\n\t}", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class, $this->getForeignKey())->orderBy('created_at', 'desc');\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class);\n }", "public function subscriptions()\n {\n return $this->hasMany(Subscription::class);\n }", "function list(Request $request) {\n $query = Subscription::query();\n\n if ($search = $request->search) {\n $this->searchTerm($query, $search, ['title', 'description']);\n }\n return SubscriptionListResource::collection($query->paginate($request->get('perPage')));\n }", "function &getSubscriptions($rangeInfo = null) {\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tORDER BY\n\t\t\tiss.institution_name ASC,\n\t\t\ts.subscription_id',\n\t\t\tfalse,\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnSubscriptionFromRow');\n\n\t\treturn $returner;\n\t}", "public function getTopicSubscriptions()\n {\n return $this->topicSubscriptions;\n }", "public function getUserSubscriptionWithId(int $userSubscriptionId);", "function getSubscriptionId(){\n\n $isSubsId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n\n return !empty($isSubsId) ? $isSubsId->bizSubscriptionId : FALSE;\n \n }", "public function getSubscriptions($date) {\n $start = $date . ' 00:00:00';\n $end = $date . ' 23:59:59';\n return $this->countByDate($start, $end, 'subscribe');\n }", "public function fetchSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest', $parameters);\n }", "function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public function GetSubscriptionRecord()\n {\n \t$output = array();\n \t \n \t$rs = mysql_query(\"SELECT * FROM subscriptions WHERE subscription_id = \" . $this->subscription_id);\n \t \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" \t=> $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name_fr\"\t=> $row['subscription_name_fr'],\n\t \t\t\t\t\t\"subscription_name_en\"\t=> $row['subscription_name_en'],\n\t \t\t\t\t\t\"subscription_desc_fr\"\t=> $row['subscription_desc_fr'],\n\t \t\t\t\t\t\"subscription_desc_en\"\t=> $row['subscription_desc_en'],\n\t \t\t\t\t\t\"created_by_id\" \t\t=> $row['created_by_id'],\n\t \t\t\t\t\t\"created_date\" \t\t=> $row['created_date'],\n\t \t\t\t\t\t\"modified_by_id\" \t\t=> $row['modified_by_id'],\n\t \t\t\t\t\t\"modified_date\" \t\t=> $row['modified_date']\n \t\t\t);\n \t\t}\n \t}\n \t \n \t \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$output\\n<br>\";\n \t}\n \t \n \treturn $output;\n }", "public function getSubscriptionId() {\n\t\treturn $this->container['subscription_id'];\n\t}", "public function getSubscriptionDetails($request)\n {\n //require_once (dirname(__FILE__) . '/Model/GetSubscriptionDetailsResponse.php');\n return MarketplaceWebServiceWebstore_Model_GetSubscriptionDetailsResponse::fromXML($this->_invoke('GetSubscriptionDetails'));\n }", "public function listsubscriptions() {\n\t\t//load Topicmodel\n\t\t$this->load->model('Topicmodel');\n\t\t\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Topicmodel->countAllSubscriptionsByUser($this->userID);\n\t\t$jTableResult['Records'] = $this->Topicmodel->ListAllSubscriptionsByUser($this->userID,$this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function subscription(): SubscriptionReceiptInterface;", "public function get_all_subscription_products(){\n\t\t\n\t\t$args = array(\n\t\t\t'type' => 'subscription',\n\t\t);\n\t\t$products = wc_get_products( $args );\n\t\treturn $products;\n \n\t}", "public function subscribe()\n {\n return $this->gate->request(Gate::URL_SUBSCRIBED_APPS);\n }", "public function subscriptions()\n {\n return $this->hasMany('DragonLancers\\Subscription');\n }", "public function getSubscriptions()\n {\n return [\n self::NAME.'.command.message',\n self::NAME.'.command.part',\n self::NAME.'.command.join',\n self::NAME.'.command.quit',\n self::NAME.'.command.kick',\n self::NAME.'.command.invite',\n ];\n }", "public function subscriptions(Request $request) {\n\n try {\n\n $base_query = Subscription::BaseResponse()->where('subscriptions.status' , APPROVED);\n\n if ($request->id) {\n\n $user_details = User::find($request->id);\n\n if ($user_details) {\n\n if ($user_details->one_time_subscription == DEFAULT_TRUE) {\n\n $base_query->where('subscriptions.amount','>', 0);\n\n }\n\n } \n\n }\n\n $subscriptions = $base_query->orderBy('amount' , 'asc')->get();\n\n if($subscriptions) {\n\n foreach ($subscriptions as $key => $subscription_details) {\n \n $subscription_details->plan = $subscription_details->plan <= 1 ? $subscription_details->plan .\" month\" : $subscription_details->plan.\" months\";\n }\n\n }\n\n $response_array = ['success' => true, 'data' => $subscriptions];\n\n return response()->json($response_array, 200);\n\n } catch (Exception $e) {\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success' => false, 'error_messages' => $message, 'error_code' => $code];\n\n return response()->json($response_array);\n\n }\n }", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public function subcriptionOffer()\n {\n $subscriptionOffer = SubscriptionOffer::first();\n if ($subscriptionOffer) {\n return new ModelResponse($subscriptionOffer, false);\n } else {\n return response(null, 204);\n }\n }", "function &getSubscription($subscriptionId) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }", "public function subscription()\n {\n return $this->belongsToMany('App\\SubscriptionList');\n }", "public function fetchSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest', $parameters);\n }", "public function fetchAll() {\n $data = $this->repository->getAllsubscriptions ();\n foreach ( $data ['data'] as $ak => $av ) {\n unset ( $data ['data'] [$ak] ['id'] );\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "public function show($id)\n {\n $user_subscription = $this->user_subscription->find($id);\n\n if($user_subscription){\n return response()->json(['success'=>$user_subscription], 200);\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function fetchApiInfoAll() {\n $data = $this->repository->getSubscriberInfo ();\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "public function getSubscriptionStatus() {\n return $this->subscription_status;\n\n }", "function get_subscriber($id){\n $query = selectRecord(TAB_SUBSCRIBERS, \"id = $id\");\n return $query;\n}", "public function getSubscriptions($idUser)\n {\n if (!$subscriptions = Subscription::getSubscriptions($idUser)) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n\n $this->send($subscriptions);\n }", "public function getSubscriber()\n {\n return $this->subscriber;\n }", "public function subscription($userId)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn $this->db->table(Config::get('throttle::tables.subscriptions'))\n\t\t\t\t->where('user_id', $userId)\n\t\t\t\t->where('is_active', '1')\n\t\t\t\t->select('id', 'user_id', 'plan_id', 'subscribed_at')\n\t\t\t\t->first();\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\tthrow new Exceptions\\InternalException;\n\t\t}\n\t}", "public function subscription(): EventSubscription;", "public function getSubscriptionList()\n {\n $recruiterOffice = RecruiterOffice::getAllOffices();\n $subscription['data'] = [];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n if ($customerId[0] == null) {\n $subscription['customer'] = [];\n } else {\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $subscription['customer'] = [$customer];\n }\n foreach ($recruiterOffice as $office) {\n if ($office['free_trial_period'] != config('constants.ZeroValue')) {\n $subscription['data'] = $office;\n break;\n }\n }\n return $subscription;\n }", "public function subscription();", "public function subscription($customer_id)\n {\n $customer = \\Stripe\\Customer::retrieve([\n 'id' => $customer_id,\n ]);\n $collection = new Collection($customer->subscriptions->data);\n return $collection->sortByDesc(function ($value) {\n return $value->created;\n })->first();\n }", "function subscribeById ( $id )\n {\n try\n {\n $result = $this->apiCall('post',\"{$this->api['cms_manager_url']}/resources/subscriptions/{$id}\",array(),'json');\n return $this->createResponse($result,'Subscribe','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getDelete($id){\n // dd($id);\n $subscription =Subscription::find($id)->delete();\n $message = ['msg' => 'success'];\n return response()->json($message, 200);\n\n }", "public function asStripeSubscription() : StripeSubscription\n {\n $entity = $this->getSubscriberEntity();\n\n return $entity->getStripeCustomerInfo()->subscriptions->retrieve($this->stripe_id);\n }", "public function findAll()\n {\n return $this->em\n ->createQueryBuilder('q')\n ->select('s')\n ->from('BackendBundle:Subscription', 's')\n ->getQuery()\n ->getResult();\n }", "public function show(Subscriber $subscriber)\n {\n// dd($subscriber);\n }", "public function show($id, Request $request)\n {\n if($request->id){\n $subscription_view = Subscription::find($request->id);\n return ['subscription_view'=>$subscription_view];\n }\n }", "public function retrieve_subscription( $subscription_id ) {\n\t\t// First check cache.\n\t\t$subscription = wp_cache_get( 'stripe_subscription_' . $subscription_id, 'membership-stripe' );\n\n\t\t// Get from API.\n\t\tif ( empty( $subscription ) ) {\n\t\t\ttry {\n\t\t\t\t$subscription = StripeCheckoutSubscription::retrieve( $subscription_id );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t$subscription = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $subscription;\n\t}", "protected function subscriber()\n {\n return Subscriber::connection(1, [\n 'id' => 1,\n 'payload' => [\n 'query' => 'subscription { onPostCreated { id } }',\n 'variables' => [],\n 'operationName' => ''\n ]\n ]);\n }", "public function all()\n {\n return $this->subscriptions;\n }", "public static function getActiveForThisApp() : Subscription\n {\n return self::getByDefaultCompany(Di::getDefault()->get('userData'));\n }", "public function subscriptions()\n {\n return $this->hasMany(TeamSubscription::class, 'team_id')->orderBy('created_at', 'desc');\n }" ]
[ "0.7889973", "0.7785849", "0.7415316", "0.72852427", "0.7201232", "0.70981944", "0.69772583", "0.6903521", "0.6816838", "0.6806219", "0.67940885", "0.6790293", "0.6764741", "0.672417", "0.6671531", "0.66638666", "0.66221416", "0.65482485", "0.65398735", "0.6537851", "0.65327656", "0.65062094", "0.64961404", "0.6475695", "0.64483356", "0.6435635", "0.64132506", "0.6408346", "0.64040875", "0.6397263", "0.6371475", "0.6337216", "0.63357294", "0.6327517", "0.63207513", "0.6305914", "0.6285018", "0.62724984", "0.6266296", "0.62551504", "0.6253095", "0.62408966", "0.6224693", "0.6219829", "0.61939335", "0.6181609", "0.6177735", "0.6171929", "0.61285394", "0.61262536", "0.61262536", "0.61124676", "0.61124676", "0.61103815", "0.6070613", "0.60704535", "0.60488695", "0.60437584", "0.60343796", "0.6025742", "0.60252345", "0.6024363", "0.60239756", "0.60178953", "0.60178614", "0.6012135", "0.60088694", "0.6001425", "0.59869254", "0.5978291", "0.5977296", "0.5974175", "0.5971505", "0.59581953", "0.5947717", "0.59431416", "0.59356993", "0.5915637", "0.5909901", "0.5871808", "0.5867187", "0.5865121", "0.5849568", "0.5840939", "0.5838661", "0.58346367", "0.5826315", "0.5814851", "0.58095205", "0.5808979", "0.5793811", "0.57843214", "0.5781414", "0.57755136", "0.5770649", "0.5760194", "0.5741392", "0.57410336", "0.5737694", "0.5728969", "0.5719226" ]
0.0
-1
Operation getWithHttpInfo Get Subscription
public function getWithHttpInfo($id) { $request = $this->getRequest($id); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Subscription' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Subscription' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Subscription', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Subscription'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getSubscription($request);", "public function getSubscription(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n $result = $this->validateAuthenticator($data);\n if (empty($result['error'])) {\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n unset($result['secret']);\n return new JsonResponse($result);\n }\n unset($result['secret']);\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }", "public function getSubscriptionDetails()\n {\n try {\n $subscriptions = $this->fetchSubscription(Auth::user()->id);\n $this->response['success'] = true;\n $this->response['data'] = $subscriptions;\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function getSubscriptionDetails($request);", "public function find(string $subscriptionId): ApiResponse\n {\n return $this->_get(\"subscriptions/{$subscriptionId}\");\n }", "public function getSubscription($subscriptionId)\n {\n $url = $this->host . '/v1/billing/subscriptions/' . $subscriptionId;\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPGET, 1);\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n\n $this->cUrl = $curl;\n\n return $this->sendRequest();\n //===\n }", "public function getSubscriptionWithId(int $subscriptionId);", "public function listSubscriptions($request);", "public function getSubscriptions();", "public function fetchApiInfoAll() {\n $data = $this->repository->getSubscriberInfo ();\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "public function subscription($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Subscription::find_with_client($this, $id);\n\n }", "public function get(string $id): Subscription\n {\n $response = $this->performApiCall(\n 'GET',\n \"subscriptions/{$id}\"\n );\n\n return new Subscription(collect($response));\n }", "public function show(Request $request)\n {\n return new GenericResource(Subscription::find($request->id), [\n 'id',\n 'title',\n 'description',\n 'price',\n 'active',\n 'type',\n ['role' => ['id']],\n 'duration',\n ]);\n }", "public function getSubscriptionDetails($request)\n {\n //require_once (dirname(__FILE__) . '/Model/GetSubscriptionDetailsResponse.php');\n return MarketplaceWebServiceWebstore_Model_GetSubscriptionDetailsResponse::fromXML($this->_invoke('GetSubscriptionDetails'));\n }", "function listActiveSubscriptions(int $pageSize = 50, int $offset = 0){\nreturn $this->get(\"/subscription?pageSize={$pageSize}&offset={$offset}\");\n}", "public function subscriptionGetWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n $returnType = '\\Maviance\\S3PApiClient\\Model\\Subscription[]';\n $request = $this->subscriptionGetRequest($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string', 'integer', 'bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders(),\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Maviance\\S3PApiClient\\Model\\Subscription[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 0:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Maviance\\S3PApiClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public static function subscriptions($body = null)\n\t{\n\t\t$returned = \\QuickFile\\Request::_sendData([], '/report/subscriptions');\n\t\treturn $returned->Report_Subscriptions->Body;\n\t}", "public function getSubscription()\n {\n return $this->subscription;\n }", "public function show(Subscription $subscription)\n {\n //\n }", "public function getIndex() {\n $data = $this->repository->getAllsubscriptions ();\n if (auth ()->user ()) {\n $data ['subscribed_plan'] = auth ()->user ()->activeSubscriber ()->first ();\n $data ['plan_duration_left'] = '';\n if ($data ['subscribed_plan']) {\n $end = Carbon::parse ( $data ['subscribed_plan']->pivot->end_date );\n $now = Carbon::now ();\n $length = $end->diffInDays ( $now );\n $data ['plan_duration_left'] = $length . ' days left';\n }\n } else {\n $data ['subscribed_plan'] = null;\n $data ['plan_duration_left'] = '';\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'response' => [ 'allSubscriptions' => $data,'allSubscriptions' => $data ] ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showError' ) );\n }", "public function getRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling get'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function obtainReportForSubscription(string $id){\nreturn $this->get(\"/subscription/report/{$id}\");\n}", "public function getSubscriptions($options = NULL, $customClient = NULL) {\n\t\treturn Bf_Subscription::getByRatePlanID($this->id, $options, $customClient);\n\t}", "public function createWithHttpInfo($create_subscription_request)\n {\n $request = $this->createRequest($create_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}", "function list(Request $request) {\n $query = Subscription::query();\n\n if ($search = $request->search) {\n $this->searchTerm($query, $search, ['title', 'description']);\n }\n return SubscriptionListResource::collection($query->paginate($request->get('perPage')));\n }", "public function GetSubscription()\n {\n \t$this->SetCulture();\n \t \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions WHERE subscription_id=\" . $this->subscription_id);\n \t \n \t$row = mysql_fetch_array($rs);\n \n \t$this->subscription_id\t\t= $row['subscription_id'];\n \t$this->subscription_name\t= $row[$this->lang_name_field];\n \t\n \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n }", "function &getSubscriptions($rangeInfo = null) {\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tORDER BY\n\t\t\tiss.institution_name ASC,\n\t\t\ts.subscription_id',\n\t\t\tfalse,\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnSubscriptionFromRow');\n\n\t\treturn $returner;\n\t}", "public function show($id, Request $request)\n {\n if($request->id){\n $subscription_view = Subscription::find($request->id);\n return ['subscription_view'=>$subscription_view];\n }\n }", "public function getSubscriptions() {\n\t\t$urlSubscriptions = \"http://www.reddit.com/reddits/mine.json\";\n\t\treturn $this->runCurl ( $urlSubscriptions );\n\t}", "public function getInfo()\n\t{\n\t\treturn $this->clientSoap->__soapCall(\"getInfo\", $this->params);\n\t}", "public function subscription($subscription = 'default')\n {\n return $this->subscriptions->sortByDesc(function ($value) {\n return $value->created_at->getTimestamp();\n })->first(function ($value) use ($subscription) {\n return $value->name === $subscription;\n });\n }", "public function getInfo() {\n return $this->getSuccessJsonResponse ( [ 'info' => [ 'rules' => $this->repository->getRules (),'allSubscriptions' => $this->repository->getAllsubscriptions () ] ] );\n }", "public function getUserSubscriptionWithId(int $userSubscriptionId);", "public function getSubscriptions($idUser)\n {\n if (!$subscriptions = Subscription::getSubscriptions($idUser)) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n\n $this->send($subscriptions);\n }", "public function fetchSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest', $parameters);\n }", "public function getSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription had proberties\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n\n // init subscriber data array an save the proberties plain\n $data = array();\n $data['resourceProperties'] = $subscriptionResourceProperties;\n // fill the subscriber data array with the subscription resource content\n foreach ($this->_propertyMatching as $dataKey => $propertyKey) {\n // get property content\n $propertyUri = $this->_subscriptionConfig->get($propertyKey);\n $propertyArray = isset($subscriptionResourceProperties[$propertyUri]) ?\n $subscriptionResourceProperties[$propertyUri] :\n null;\n\n // if property content exists write it to the subscriber data array\n if (isset($propertyArray) && \"\" != $propertyArray[0]['content']) {\n $data[$dataKey] = $propertyArray[0]['content'];\n } else {\n $data[$dataKey] = null;\n }\n }\n return $data;\n }\n return false;\n }", "public function getAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->getRequest($id);\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 fetchSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest', $parameters);\n }", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function subscribeById ( $id )\n {\n try\n {\n $result = $this->apiCall('post',\"{$this->api['cms_manager_url']}/resources/subscriptions/{$id}\",array(),'json');\n return $this->createResponse($result,'Subscribe','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function GetSubscriptionsList()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" => $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name\"\t=> $row[$this->lang_name_field]\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function getSubscriptionKey() { return $this->subscriptionKey; }", "public function get()\n\t{\n\t\t$response = $this->builder->get( $this->buildParameters(), $this->buildUrlAdditions() );\n\n\t\treturn $response;\n\t}", "public function cancelWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $request = $this->cancelRequest($id, $cancel_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }", "public function subscriptions(Request $request) {\n\n try {\n\n $base_query = Subscription::BaseResponse()->where('subscriptions.status' , APPROVED);\n\n if ($request->id) {\n\n $user_details = User::find($request->id);\n\n if ($user_details) {\n\n if ($user_details->one_time_subscription == DEFAULT_TRUE) {\n\n $base_query->where('subscriptions.amount','>', 0);\n\n }\n\n } \n\n }\n\n $subscriptions = $base_query->orderBy('amount' , 'asc')->get();\n\n if($subscriptions) {\n\n foreach ($subscriptions as $key => $subscription_details) {\n \n $subscription_details->plan = $subscription_details->plan <= 1 ? $subscription_details->plan .\" month\" : $subscription_details->plan.\" months\";\n }\n\n }\n\n $response_array = ['success' => true, 'data' => $subscriptions];\n\n return response()->json($response_array, 200);\n\n } catch (Exception $e) {\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success' => false, 'error_messages' => $message, 'error_code' => $code];\n\n return response()->json($response_array);\n\n }\n }", "public function updateWithHttpInfo($id, $update_subscription_request)\n {\n $request = $this->updateRequest($id, $update_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function listsubscriptions() {\n\t\t//load Topicmodel\n\t\t$this->load->model('Topicmodel');\n\t\t\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Topicmodel->countAllSubscriptionsByUser($this->userID);\n\t\t$jTableResult['Records'] = $this->Topicmodel->ListAllSubscriptionsByUser($this->userID,$this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function index()\n {\n $user = User::with(\"subscriptions\")->find(Auth::user()->id);\n $subscriptions = $user->subscriptions->toArray();\n\n return ResponseHelper::success($subscriptions, __(\"Retornando assinatura\"));\n }", "protected function subscriptionGetRequest($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n // verify the required parameter 'xApiVersion' is set\n if ($xApiVersion === null || (is_array($xApiVersion) && count($xApiVersion) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $xApiVersion when calling subscriptionGet'\n );\n }\n // verify the required parameter 'merchant' is set\n if ($merchant === null || (is_array($merchant) && count($merchant) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $merchant when calling subscriptionGet'\n );\n }\n // verify the required parameter 'serviceid' is set\n if ($serviceid === null || (is_array($serviceid) && count($serviceid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $serviceid when calling subscriptionGet'\n );\n }\n\n $resourcePath = '/subscription';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($merchant !== null) {\n $queryParams['merchant'] = ObjectSerializer::toQueryValue($merchant, null);\n }\n // query params\n if ($serviceid !== null) {\n $queryParams['serviceid'] = ObjectSerializer::toQueryValue($serviceid, null);\n }\n // query params\n if ($serviceNumber !== null) {\n $queryParams['serviceNumber'] = ObjectSerializer::toQueryValue($serviceNumber, null);\n }\n // query params\n if ($customerNumber !== null) {\n $queryParams['customerNumber'] = ObjectSerializer::toQueryValue($customerNumber, null);\n }\n // header params\n if ($xApiVersion !== null) {\n $headerParams['x-api-version'] = ObjectSerializer::toHeaderValue($xApiVersion);\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils\\jsonEncode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue,\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils\\jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = http_build_query($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getSubscriptionById($id_subscription) {\n $this->db->where('ID_SUBSCRIPTION', $id_subscription);\n $query = $this->db->get($this->table);\n return $query->row();\n}", "public function Info_Get()\n\t{\n\t\t$Data = $this -> HTTPRequest($this -> APIURL.'Info:Get');\n\t\treturn $this -> ParseResponse($Data);\n\t}", "public function index()\n {\n $user_id = Auth::id();\n $subscribes = User::findOrFail($user_id)->subscriptions;\n // return $subscribes;\n return view('profile.subscription')->with('subscribes', $subscribes);\n }", "function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }", "public function getSubscriptionId();", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public static function getSubscriptionProductsList() {\n $sku = array();\n $query = db_select('commerce_product', 'cp');\n $query->fields('cp', array('sku'));\n $query->leftJoin('field_data_field_product', 'pr', 'cp.product_id = pr.entity_id');\n $query->condition('pr.bundle', 'subscription', '=');\n $result = $query->execute();\n while ($product = $result->fetchAssoc()) {\n $sku[] = $product['sku'];\n }\n return new Response(TRUE, $sku, NULL);\n }", "function j2_get_yt_subs() {\n $api_key = get_option('youtube_api_key');\n $channel_id = get_option('youtube_api_channel_id');\n\n // Return if the option fields do not exist\n if(!$api_key || !$channel_id)\n return false;\n\n $youtube_url = 'https://www.googleapis.com/youtube/v3/channels?part=statistics&id='.$channel_id.'&key='.$api_key;\n $data = @file_get_contents($youtube_url);\n $json_data = json_decode($data);\n\n if(!$json_data)\n return false;\n\n $subs = $json_data->items\n }", "public function show($id)\n {\n $user_subscription = $this->user_subscription->find($id);\n\n if($user_subscription){\n return response()->json(['success'=>$user_subscription], 200);\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function getsubscribers() {\r\n if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']==\"XMLHttpRequest\") {\r\n $this->db->select()\r\n ->from('ci_subscribers sub')\r\n ->where('sub.status', 1)\r\n ->order_by('sid', 'ASC');\r\n $query = $this->db->get();\r\n $query = $query->result_array();\r\n print json_encode($query);\r\n }else{\r\n header(\"Location: \" . base_url());\r\n }\r\n }", "public function getSubscription( $subscriptionId )\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT subscription_id, issue_id, user_id, stamp_id'\n . ' FROM {subscriptions}'\n . ' WHERE subscription_id = %d AND user_id = %d';\n\n if ( !( $subscription = $this->connection->queryRow( $query, $subscriptionId, $principal->getUserId() ) ) )\n throw new System_Api_Error( System_Api_Error::UnknownSubscription );\n\n return $subscription;\n }", "public function subscriptions()\n {\n return Subscription::byCustomer($this->id);\n }", "public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }", "public function getCurrentSubscription($companyId);", "public function get_active_subscriptions() {\r\n return $this->get_all_subscriptions( true );\r\n }", "function wcs_get_subscription( $the_subscription ) {\n\n\tif ( is_object( $the_subscription ) && wcs_is_subscription( $the_subscription ) ) {\n\t\t$the_subscription = $the_subscription->get_id();\n\t}\n\n\t$subscription = WC()->order_factory->get_order( $the_subscription );\n\n\tif ( ! wcs_is_subscription( $subscription ) ) {\n\t\t$subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_get_subscription', $subscription );\n}", "public function getSubscription()\n {\n /** @var \\ParadoxLabs\\Subscriptions\\Api\\Data\\SubscriptionInterface $subscription */\n $subscription = $this->registry->registry('current_subscription');\n\n return $subscription;\n }", "public function getSubscriptions($date) {\n $start = $date . ' 00:00:00';\n $end = $date . ' 23:59:59';\n return $this->countByDate($start, $end, 'subscribe');\n }", "public function subscription($name = 'default')\n {\n return $this->subscriptions->sortByDesc(function (Subscription $subscription) {\n return $subscription->created_at->getTimestamp();\n })->first(function (Subscription $subscription) use ($name) {\n return $subscription->name === $name;\n });\n }", "public function subscriptionPurchaseAllowedWithHttpInfo()\n {\n $returnType = '';\n $request = $this->subscriptionPurchaseAllowedRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "function getSkus() {\n\techo \"Getting Skus </br>\";\n\t$response = getRequest('/api/sku');\n\tprintInfo($response);\n}", "public function read($id)\n {\n // check the cache and return the result if in cache\n $cacheKey = \"subscriber-{$id}\";\n $data = RedisCache::instance()->get($cacheKey);\n if (!empty($data)) {\n return new Response(200, null, unserialize($data));\n }\n\n // find the subscriber include the fields\n $found = Subscriber::with('fields')\n ->where('id', $id)\n ->get()\n ->first();\n\n // response\n if (!empty($found) && $found->count()) {\n // save to cache\n RedisCache::instance()->set($cacheKey, serialize($found));\n return new Response(200, null, $found);\n } else {\n return new Response(404, 'Subscriber not found');\n }\n }", "public function get($path, array $parameters = array(), ApiInterface $api);", "public function index()\n {\n $search = [];\n $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;\n $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;\n\n //if(isset($_GET['all'])){\n $search['all'] = true;\n //}\n\n if(isset($_GET['user_id'])){\n $search['user_id'] = $_GET['user_id'];\n }\n\n $data = $this->user_subscription->getAll($offset, $limit, $search);\n $data['offset'] = isset($_GET['all']) ? 'all' :$offset;\n $data['limit'] = isset($_GET['all']) ? 'all' : $limit;\n $data['total'] = 0;\n \n $data['total'] = $this->user_subscription->count();\n\n return response()->json(['success'=> $data ], 200);\n }", "public function resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getSubscriptionId()\n\t{\n\t\treturn $this->_subscriptionId;\n\t}", "public function index()\n {\n $subscription = Subscription::all();\n return view('admin.subscription.subsription',compact('subscription'));\n\n }", "public function getTopicSubscriptions()\n {\n return $this->topicSubscriptions;\n }", "public function subscriptionGet($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n [$response] = $this->subscriptionGetWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber);\n\n return $response;\n }", "function subscriptions ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n }", "public function get_all_subscription_products(){\n\t\t\n\t\t$args = array(\n\t\t\t'type' => 'subscription',\n\t\t);\n\t\t$products = wc_get_products( $args );\n\t\treturn $products;\n \n\t}", "public function getSubscriptionStatus(SubscriptionRequestEntity $requestEntity);", "public function listSubscriptionsCount($request);", "public function get(int $serviceId, GetParameters $parameters = null): Response\n {\n $url = $this->prepareGetUrl(static::ENDPOINT_CATALOG_SERVICES_GET, $parameters);\n $url = $this->replaceId($serviceId, $url);\n\n return $this->callApi(self::METHOD_GET, $url);\n }", "public function servicessub_get($id)\n {\n $em = $this->doctrine->em;\n// $subcategory = $em->find('Entities\\Sub',$id);\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n\n $subcategory = $subcategoriesRepo->find($id);\n// $subcategory->services->doInitialize();\n if ($subcategory) {\n $response[\"desc\"] = \"Servicios pertenecientes a la subcategoria: $subcategory->title\";\n $services = $subcategory->getServices()->toArray();\n $user = $this->getCurrentUser();\n foreach ($services as $service) {\n $service->loadRelatedData(null, null, site_url());\n if ($user) {\n $service->loadRelatedUserData($user);\n }\n }\n $category = $subcategory->getCategory();\n $response[\"category\"] = array();\n $response[\"category\"][] = $category->getTitle();\n $response[\"subcategory\"] = array();\n $response[\"subcategory\"][] = $subcategory->getTitle();\n $response[\"data\"] = $services;\n } else {\n $response[\"desc\"] = \"Subcategoria no encontrada\";\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public function getDelete($id){\n // dd($id);\n $subscription =Subscription::find($id)->delete();\n $message = ['msg' => 'success'];\n return response()->json($message, 200);\n\n }", "public function subscriptionGetAsyncWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n $returnType = '\\Maviance\\S3PApiClient\\Model\\Subscription[]';\n $request = $this->subscriptionGetRequest($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber);\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($parameters = array())\n {\n return $this->callItemEndpoint(__METHOD__);\n }", "public function getSubscriptionByReference(string $subscription_reference): SubscriptionInterface;", "public function get($resource, array $params = array(), array $options = array())\n {\n return $this->makeApiRequest($resource, $params, HttpClient::GET, $options);\n }", "public function get($apiPath, array $parameters = array(), array $options = array())\n {\n return $this->send($apiPath, $parameters, 'GET', $options);\n }", "public function show($id)\n {\n return response(\n [\n 'error'=> false,\n 'data'=> SubscriptionAppointment::find($id)\n ]\n ,201);\n }", "public function subscription($userId)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn $this->db->table(Config::get('throttle::tables.subscriptions'))\n\t\t\t\t->where('user_id', $userId)\n\t\t\t\t->where('is_active', '1')\n\t\t\t\t->select('id', 'user_id', 'plan_id', 'subscribed_at')\n\t\t\t\t->first();\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\tthrow new Exceptions\\InternalException;\n\t\t}\n\t}", "public function get( ServerRequestInterface $request, ResponseInterface $response )\n\t{\n\t\treturn $this->client->get( $request, $response );\n\t}", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public function getUsersSubscriptionDetailsWithHttpInfo($user_id)\n {\n $returnType = '\\KnetikCloud\\Model\\InventorySubscriptionResource[]';\n $request = $this->getUsersSubscriptionDetailsRequest($user_id);\n\n try {\n\n try {\n $response = $this->client->send($request);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n \"[$statusCode] Error connecting to the API ({$request->getUri()})\",\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\InventorySubscriptionResource[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize($e->getResponseBody(), '\\KnetikCloud\\Model\\Result', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function show($id)\n {\n return view('subscription::show');\n }", "public function show(Subscriber $subscriber)\n {\n// dd($subscriber);\n }" ]
[ "0.69722444", "0.68073857", "0.6535579", "0.63793206", "0.6360821", "0.6296219", "0.6172185", "0.6148372", "0.60534084", "0.6021172", "0.600231", "0.5975868", "0.5935178", "0.58376276", "0.5791245", "0.57028234", "0.56765276", "0.56465465", "0.557484", "0.5551144", "0.5543568", "0.5542637", "0.5532361", "0.55076176", "0.54861057", "0.5481044", "0.54550624", "0.5436232", "0.5432075", "0.5418341", "0.54093564", "0.5406111", "0.5397389", "0.5379457", "0.53494936", "0.53314334", "0.53131914", "0.5285782", "0.5269721", "0.5266739", "0.52566487", "0.5250091", "0.52413213", "0.5236928", "0.52138835", "0.51918495", "0.5189553", "0.5179074", "0.51708215", "0.51658535", "0.51618695", "0.5160632", "0.5157348", "0.51500297", "0.5142671", "0.5140697", "0.5139385", "0.51280075", "0.5124982", "0.5115217", "0.51110953", "0.51106566", "0.5105267", "0.51030827", "0.50846446", "0.5078592", "0.5055171", "0.5030193", "0.50267124", "0.5025758", "0.50236046", "0.5022451", "0.50198656", "0.5016826", "0.50056654", "0.5000737", "0.49924302", "0.49872372", "0.49773106", "0.49703753", "0.49680966", "0.49312273", "0.49234217", "0.49214378", "0.49184948", "0.4911126", "0.49076638", "0.49041295", "0.49039793", "0.48776525", "0.48736563", "0.48730248", "0.48628783", "0.48555988", "0.48179698", "0.4816329", "0.48033872", "0.4792572", "0.47916394", "0.4787555" ]
0.68090624
1
Operation getAsync Get Subscription
public function getAsync($id) { return $this->getAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getSubscription($request);", "public function getSubscriptions();", "public function getSubscription(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n $result = $this->validateAuthenticator($data);\n if (empty($result['error'])) {\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n unset($result['secret']);\n return new JsonResponse($result);\n }\n unset($result['secret']);\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }", "public function getSubscription($subscriptionId)\n {\n $url = $this->host . '/v1/billing/subscriptions/' . $subscriptionId;\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPGET, 1);\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n\n $this->cUrl = $curl;\n\n return $this->sendRequest();\n //===\n }", "public function getSubscriptionWithId(int $subscriptionId);", "public function retrieveSubscription() {\n // Adrian: Get user subscription details from the database\n /**$subscription = Subscription::where('user_id', $this->model->id)\n ->where('plan_id', $this->plan)\n ->first();**/\n\n $result = ChargeBee_Subscription::retrieve($this->user->subscription_id);\n\n return $result;\n }", "public function GetSubscription()\n {\n \t$this->SetCulture();\n \t \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions WHERE subscription_id=\" . $this->subscription_id);\n \t \n \t$row = mysql_fetch_array($rs);\n \n \t$this->subscription_id\t\t= $row['subscription_id'];\n \t$this->subscription_name\t= $row[$this->lang_name_field];\n \t\n \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n }", "public function getSubscription()\n {\n return $this->subscription;\n }", "public function getSubscriptionDetails()\n {\n try {\n $subscriptions = $this->fetchSubscription(Auth::user()->id);\n $this->response['success'] = true;\n $this->response['data'] = $subscriptions;\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function getSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription had proberties\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n\n // init subscriber data array an save the proberties plain\n $data = array();\n $data['resourceProperties'] = $subscriptionResourceProperties;\n // fill the subscriber data array with the subscription resource content\n foreach ($this->_propertyMatching as $dataKey => $propertyKey) {\n // get property content\n $propertyUri = $this->_subscriptionConfig->get($propertyKey);\n $propertyArray = isset($subscriptionResourceProperties[$propertyUri]) ?\n $subscriptionResourceProperties[$propertyUri] :\n null;\n\n // if property content exists write it to the subscriber data array\n if (isset($propertyArray) && \"\" != $propertyArray[0]['content']) {\n $data[$dataKey] = $propertyArray[0]['content'];\n } else {\n $data[$dataKey] = null;\n }\n }\n return $data;\n }\n return false;\n }", "public function subscription($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Subscription::find_with_client($this, $id);\n\n }", "public function listSubscriptions($request);", "public function getSubscriptions() {\n\t\t$urlSubscriptions = \"http://www.reddit.com/reddits/mine.json\";\n\t\treturn $this->runCurl ( $urlSubscriptions );\n\t}", "public function find(string $subscriptionId): ApiResponse\n {\n return $this->_get(\"subscriptions/{$subscriptionId}\");\n }", "public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }", "function &getSubscription($subscriptionId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tAND s.subscription_id = ?',\n\t\t\t$subscriptionId\n\t\t);\n\n\t\t$returner = null;\n\t\tif ($result->RecordCount() != 0) {\n\t\t\t$returner =& $this->_returnSubscriptionFromRow($result->GetRowAssoc(false));\n\t\t}\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get(string $id): Subscription\n {\n $response = $this->performApiCall(\n 'GET',\n \"subscriptions/{$id}\"\n );\n\n return new Subscription(collect($response));\n }", "function obtainReportForSubscription(string $id){\nreturn $this->get(\"/subscription/report/{$id}\");\n}", "public function index()\n {\n $user = User::with(\"subscriptions\")->find(Auth::user()->id);\n $subscriptions = $user->subscriptions->toArray();\n\n return ResponseHelper::success($subscriptions, __(\"Retornando assinatura\"));\n }", "public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }", "public function getAsync(): string;", "function j2_get_yt_subs() {\n $api_key = get_option('youtube_api_key');\n $channel_id = get_option('youtube_api_channel_id');\n\n // Return if the option fields do not exist\n if(!$api_key || !$channel_id)\n return false;\n\n $youtube_url = 'https://www.googleapis.com/youtube/v3/channels?part=statistics&id='.$channel_id.'&key='.$api_key;\n $data = @file_get_contents($youtube_url);\n $json_data = json_decode($data);\n\n if(!$json_data)\n return false;\n\n $subs = $json_data->items\n }", "public function getSubscriptionById($id_subscription) {\n $this->db->where('ID_SUBSCRIPTION', $id_subscription);\n $query = $this->db->get($this->table);\n return $query->row();\n}", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public function GetSubscriptionsList()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" => $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name\"\t=> $row[$this->lang_name_field]\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function fetchAll() {\n $data = $this->repository->getAllsubscriptions ();\n foreach ( $data ['data'] as $ak => $av ) {\n unset ( $data ['data'] [$ak] ['id'] );\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "public function getSubscription( $subscriptionId )\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT subscription_id, issue_id, user_id, stamp_id'\n . ' FROM {subscriptions}'\n . ' WHERE subscription_id = %d AND user_id = %d';\n\n if ( !( $subscription = $this->connection->queryRow( $query, $subscriptionId, $principal->getUserId() ) ) )\n throw new System_Api_Error( System_Api_Error::UnknownSubscription );\n\n return $subscription;\n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public static function get() {\n return self::call(\"GET\");\n }", "protected function get() {\n $subc = \"get_\".$this->sub_collection;\n if ($subc !== null && method_exists($this, $subc)) {\n $this->im_here();\n if ($this->sub_collection == \"users\") {\n $current_users = intval($this->params->number);\n while (1) {\n $this->clear_inactive_users();\n $users = $this->get_users();\n if (sizeof($users) !== $current_users) {\n return $users;\n }else {\n sleep(1);\n }\n }\n }\n return $this->$subc();\n }else {\n $this->write_error(\"Request error!\");\n }\n }", "public function fetchApiInfoAll() {\n $data = $this->repository->getSubscriberInfo ();\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "public function getSubscriptionId();", "function wcs_get_subscription( $the_subscription ) {\n\n\tif ( is_object( $the_subscription ) && wcs_is_subscription( $the_subscription ) ) {\n\t\t$the_subscription = $the_subscription->get_id();\n\t}\n\n\t$subscription = WC()->order_factory->get_order( $the_subscription );\n\n\tif ( ! wcs_is_subscription( $subscription ) ) {\n\t\t$subscription = false;\n\t}\n\n\treturn apply_filters( 'wcs_get_subscription', $subscription );\n}", "public function get()\n\t{\n\t\t$response = $this->builder->get( $this->buildParameters(), $this->buildUrlAdditions() );\n\n\t\treturn $response;\n\t}", "public function getIndex() {\n $data = $this->repository->getAllsubscriptions ();\n if (auth ()->user ()) {\n $data ['subscribed_plan'] = auth ()->user ()->activeSubscriber ()->first ();\n $data ['plan_duration_left'] = '';\n if ($data ['subscribed_plan']) {\n $end = Carbon::parse ( $data ['subscribed_plan']->pivot->end_date );\n $now = Carbon::now ();\n $length = $end->diffInDays ( $now );\n $data ['plan_duration_left'] = $length . ' days left';\n }\n } else {\n $data ['subscribed_plan'] = null;\n $data ['plan_duration_left'] = '';\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'response' => [ 'allSubscriptions' => $data,'allSubscriptions' => $data ] ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showError' ) );\n }", "public function getSubscriptionDetails($request);", "function listActiveSubscriptions(int $pageSize = 50, int $offset = 0){\nreturn $this->get(\"/subscription?pageSize={$pageSize}&offset={$offset}\");\n}", "public function subscription(): EventSubscription;", "function subscriptions ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n }", "public function index()\n {\n $user_id = Auth::id();\n $subscribes = User::findOrFail($user_id)->subscriptions;\n // return $subscribes;\n return view('profile.subscription')->with('subscribes', $subscribes);\n }", "public function getSubscriptions($options = NULL, $customClient = NULL) {\n\t\treturn Bf_Subscription::getByRatePlanID($this->id, $options, $customClient);\n\t}", "public function subcriptionOffer()\n {\n $subscriptionOffer = SubscriptionOffer::first();\n if ($subscriptionOffer) {\n return new ModelResponse($subscriptionOffer, false);\n } else {\n return response(null, 204);\n }\n }", "function &getSubscription($subscriptionId) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "public function subscriptions()\n {\n return Subscription::byCustomer($this->id);\n }", "public function subscription();", "public function subscription($name = 'default')\n {\n return $this->subscriptions->sortByDesc(function (Subscription $subscription) {\n return $subscription->created_at->getTimestamp();\n })->first(function (Subscription $subscription) use ($name) {\n return $subscription->name === $name;\n });\n }", "public function getSubscription()\n {\n /** @var \\ParadoxLabs\\Subscriptions\\Api\\Data\\SubscriptionInterface $subscription */\n $subscription = $this->registry->registry('current_subscription');\n\n return $subscription;\n }", "public function show(Request $request)\n {\n return new GenericResource(Subscription::find($request->id), [\n 'id',\n 'title',\n 'description',\n 'price',\n 'active',\n 'type',\n ['role' => ['id']],\n 'duration',\n ]);\n }", "function &getSubscriptions($rangeInfo = null) {\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tORDER BY\n\t\t\tiss.institution_name ASC,\n\t\t\ts.subscription_id',\n\t\t\tfalse,\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnSubscriptionFromRow');\n\n\t\treturn $returner;\n\t}", "public function get_active_subscriptions() {\r\n return $this->get_all_subscriptions( true );\r\n }", "public function read($id)\n {\n // check the cache and return the result if in cache\n $cacheKey = \"subscriber-{$id}\";\n $data = RedisCache::instance()->get($cacheKey);\n if (!empty($data)) {\n return new Response(200, null, unserialize($data));\n }\n\n // find the subscriber include the fields\n $found = Subscriber::with('fields')\n ->where('id', $id)\n ->get()\n ->first();\n\n // response\n if (!empty($found) && $found->count()) {\n // save to cache\n RedisCache::instance()->set($cacheKey, serialize($found));\n return new Response(200, null, $found);\n } else {\n return new Response(404, 'Subscriber not found');\n }\n }", "public function getSubscriptionKey() { return $this->subscriptionKey; }", "public static function getSubscriptionProductsList() {\n $sku = array();\n $query = db_select('commerce_product', 'cp');\n $query->fields('cp', array('sku'));\n $query->leftJoin('field_data_field_product', 'pr', 'cp.product_id = pr.entity_id');\n $query->condition('pr.bundle', 'subscription', '=');\n $result = $query->execute();\n while ($product = $result->fetchAssoc()) {\n $sku[] = $product['sku'];\n }\n return new Response(TRUE, $sku, NULL);\n }", "public function subscribeService()\n\t{\n\t\t$serviceid = $this->db->select('*')\n\t\t\t\t\t\t\t->get('subscriber');\n\t\treturn $serviceid->result();\n\t}", "public function getSubscriptionByReference(string $subscription_reference): SubscriptionInterface;", "function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}", "public function getRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling get'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getCurrentSubscription($companyId);", "public function fetchSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest', $parameters);\n }", "public function servicessub_get($id)\n {\n $em = $this->doctrine->em;\n// $subcategory = $em->find('Entities\\Sub',$id);\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n\n $subcategory = $subcategoriesRepo->find($id);\n// $subcategory->services->doInitialize();\n if ($subcategory) {\n $response[\"desc\"] = \"Servicios pertenecientes a la subcategoria: $subcategory->title\";\n $services = $subcategory->getServices()->toArray();\n $user = $this->getCurrentUser();\n foreach ($services as $service) {\n $service->loadRelatedData(null, null, site_url());\n if ($user) {\n $service->loadRelatedUserData($user);\n }\n }\n $category = $subcategory->getCategory();\n $response[\"category\"] = array();\n $response[\"category\"][] = $category->getTitle();\n $response[\"subcategory\"] = array();\n $response[\"subcategory\"][] = $subcategory->getTitle();\n $response[\"data\"] = $services;\n } else {\n $response[\"desc\"] = \"Subcategoria no encontrada\";\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "protected function subscriber()\n {\n return Subscriber::connection(1, [\n 'id' => 1,\n 'payload' => [\n 'query' => 'subscription { onPostCreated { id } }',\n 'variables' => [],\n 'operationName' => ''\n ]\n ]);\n }", "public static function subscriptions($body = null)\n\t{\n\t\t$returned = \\QuickFile\\Request::_sendData([], '/report/subscriptions');\n\t\treturn $returned->Report_Subscriptions->Body;\n\t}", "public function index()\n {\n $subscription = Subscription::all();\n return view('admin.subscription.subsription',compact('subscription'));\n\n }", "public function getSubscriptionsToEmail()\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT s.subscription_id, s.issue_id, s.user_id, s.stamp_id'\n . ' FROM {subscriptions} AS s'\n . ' JOIN {issues} AS i ON i.issue_id = s.issue_id'\n . ' JOIN {folders} AS f ON f.folder_id = i.folder_id'\n . ' JOIN {projects} AS p ON p.project_id = f.project_id';\n if ( !$principal->isAdministrator() )\n $query .= ' JOIN {effective_rights} AS r ON r.project_id = f.project_id AND r.user_id = %1d';\n $query .= ' WHERE s.user_id = %1d AND i.stamp_id > s.stamp_id AND p.is_archived = 0';\n\n return $this->connection->queryTable( $query, $principal->getUserId() );\n }", "function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }", "public function subscriptions(Request $request) {\n\n try {\n\n $base_query = Subscription::BaseResponse()->where('subscriptions.status' , APPROVED);\n\n if ($request->id) {\n\n $user_details = User::find($request->id);\n\n if ($user_details) {\n\n if ($user_details->one_time_subscription == DEFAULT_TRUE) {\n\n $base_query->where('subscriptions.amount','>', 0);\n\n }\n\n } \n\n }\n\n $subscriptions = $base_query->orderBy('amount' , 'asc')->get();\n\n if($subscriptions) {\n\n foreach ($subscriptions as $key => $subscription_details) {\n \n $subscription_details->plan = $subscription_details->plan <= 1 ? $subscription_details->plan .\" month\" : $subscription_details->plan.\" months\";\n }\n\n }\n\n $response_array = ['success' => true, 'data' => $subscriptions];\n\n return response()->json($response_array, 200);\n\n } catch (Exception $e) {\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success' => false, 'error_messages' => $message, 'error_code' => $code];\n\n return response()->json($response_array);\n\n }\n }", "public function subscription($subscription = 'default')\n {\n return $this->subscriptions->sortByDesc(function ($value) {\n return $value->created_at->getTimestamp();\n })->first(function ($value) use ($subscription) {\n return $value->name === $subscription;\n });\n }", "public function get()\n\t{\n\t\t$response = $this->client->sendRequest(sprintf(self::ENDPOINT_PATH, null, null), Client::METHOD_GET);\n\t\t$dataCollector = new DataCollector($this->client, $response);\n\t\treturn $dataCollector->getData();\n\t}", "public function subscribe()\n {\n return $this->gate->request(Gate::URL_SUBSCRIBED_APPS);\n }", "public function getSubscriptions($idUser)\n {\n if (!$subscriptions = Subscription::getSubscriptions($idUser)) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n\n $this->send($subscriptions);\n }", "public function getGet ();", "function get_subscriber($id){\n $query = selectRecord(TAB_SUBSCRIBERS, \"id = $id\");\n return $query;\n}", "public function subscription(): SubscriptionReceiptInterface;", "function subscribeById ( $id )\n {\n try\n {\n $result = $this->apiCall('post',\"{$this->api['cms_manager_url']}/resources/subscriptions/{$id}\",array(),'json');\n return $this->createResponse($result,'Subscribe','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function get_all_subscription_products(){\n\t\t\n\t\t$args = array(\n\t\t\t'type' => 'subscription',\n\t\t);\n\t\t$products = wc_get_products( $args );\n\t\treturn $products;\n \n\t}", "public function get_subscriber( $email ) {\n\n\t\t$args = array(\n\t\t\t'function' => 'getSubscribers',\n\t\t\t'email' => $email,\n\t\t);\n\n\t\treturn $this->call( $args, 'GET' );\n\t}", "function list(Request $request) {\n $query = Subscription::query();\n\n if ($search = $request->search) {\n $this->searchTerm($query, $search, ['title', 'description']);\n }\n return SubscriptionListResource::collection($query->paginate($request->get('perPage')));\n }", "public function getDelete($id){\n // dd($id);\n $subscription =Subscription::find($id)->delete();\n $message = ['msg' => 'success'];\n return response()->json($message, 200);\n\n }", "public function listsubscriptions() {\n\t\t//load Topicmodel\n\t\t$this->load->model('Topicmodel');\n\t\t\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Topicmodel->countAllSubscriptionsByUser($this->userID);\n\t\t$jTableResult['Records'] = $this->Topicmodel->ListAllSubscriptionsByUser($this->userID,$this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function show($id)\n {\n $user_subscription = $this->user_subscription->find($id);\n\n if($user_subscription){\n return response()->json(['success'=>$user_subscription], 200);\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function get()\n {\n return $this->client->post($this->endPoint, $this->params);\n }", "public function index()\n {\n $search = [];\n $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;\n $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;\n\n //if(isset($_GET['all'])){\n $search['all'] = true;\n //}\n\n if(isset($_GET['user_id'])){\n $search['user_id'] = $_GET['user_id'];\n }\n\n $data = $this->user_subscription->getAll($offset, $limit, $search);\n $data['offset'] = isset($_GET['all']) ? 'all' :$offset;\n $data['limit'] = isset($_GET['all']) ? 'all' : $limit;\n $data['total'] = 0;\n \n $data['total'] = $this->user_subscription->count();\n\n return response()->json(['success'=> $data ], 200);\n }", "public function fetchSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest', $parameters);\n }", "public function show(Subscription $subscription)\n {\n //\n }", "public function getSubscriber()\n {\n return $this->subscriber;\n }", "public function get(Resource $resource);", "public function getEventSubscriber();", "public function all()\n {\n return $this->subscriptions;\n }", "public function getTopicSubscriptions()\n {\n return $this->topicSubscriptions;\n }", "public function index($website)\n {\n $website = Website::where('id', $website)->first();\n return response([ 'subscribers' => SubscribeResource::collection($website->subscribers), 'message' => 'Retrieved successfully'], 200);\n }", "public function getSubscriptions($date) {\n $start = $date . ' 00:00:00';\n $end = $date . ' 23:59:59';\n return $this->countByDate($start, $end, 'subscribe');\n }", "function get_subscriberList(){\n return selectQuery(TAB_SUBSCRIBERS, \"\", \"id DESC\");\n}", "public function all()\n {\n return response()->json(\n Subscriber::all()\n );\n }", "public function subscribe();", "public function getUserSubscriptionWithId(int $userSubscriptionId);", "public function get()\n {\n $result = $this->sqs_client->ReceiveMessage([\n 'QueueUrl' => 'https://sqs.us-east-1.amazonaws.com/947603853016/rs-video-harvester.fifo'\n ]);\n\n return TRUE;\n }", "public function get($emailAddress, $listID)\n\t{\n\n\t\t$command = \"Command=Subscriber.Get\";\n\t\t$emailAddress = \"EmailAddress=\".$emailAddress;\n\t\t$listID = \"ListID=\".$listID;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$emailAddress\n\t\t\t\t\t\t.'&'.$listID\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}" ]
[ "0.7294289", "0.7208322", "0.6795358", "0.6730075", "0.66719186", "0.6574896", "0.6501247", "0.63747835", "0.63381654", "0.62213963", "0.62138355", "0.61616606", "0.60817415", "0.607804", "0.5999081", "0.5984607", "0.597904", "0.5940004", "0.5940004", "0.5940004", "0.5919047", "0.591045", "0.59075654", "0.58829725", "0.5856638", "0.58415055", "0.5839959", "0.5819561", "0.57885563", "0.57878834", "0.5786788", "0.5775724", "0.5766797", "0.57547814", "0.57516325", "0.5718852", "0.571843", "0.57102966", "0.56988937", "0.5698329", "0.5690362", "0.5686797", "0.56853783", "0.5643356", "0.56425893", "0.5638225", "0.56371814", "0.56222355", "0.5611987", "0.55975676", "0.5594726", "0.5583956", "0.5581809", "0.5578442", "0.55742013", "0.5569316", "0.556707", "0.5556536", "0.5551321", "0.55376476", "0.5505502", "0.55019003", "0.55018944", "0.5500756", "0.5496392", "0.5471001", "0.5465658", "0.5455212", "0.54546857", "0.54508775", "0.5447458", "0.54428446", "0.5435062", "0.5424432", "0.54230565", "0.5412528", "0.5404984", "0.54042953", "0.5395546", "0.539538", "0.53734374", "0.5370088", "0.5365999", "0.53645563", "0.53588027", "0.53531504", "0.5334958", "0.53339857", "0.5331364", "0.5327587", "0.5327419", "0.5322351", "0.53206646", "0.5309045", "0.530696", "0.53066766", "0.5298828", "0.5298398", "0.52831537", "0.5272774", "0.5265719" ]
0.0
-1
Operation getAsyncWithHttpInfo Get Subscription
public function getAsyncWithHttpInfo($id) { $returnType = '\OpenAPI\Client\Model\Subscription'; $request = $this->getRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getSubscription($request);", "public function getSubscription(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n $result = $this->validateAuthenticator($data);\n if (empty($result['error'])) {\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n unset($result['secret']);\n return new JsonResponse($result);\n }\n unset($result['secret']);\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }", "public function getWithHttpInfo($id)\n {\n $request = $this->getRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getSubscription($subscriptionId)\n {\n $url = $this->host . '/v1/billing/subscriptions/' . $subscriptionId;\n $authorization = 'Authorization: Bearer ' . $this->clientCredentials->access_token;\n\n $curl = curl_init();\n try {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=UTF-8', $authorization));\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPGET, 1);\n } catch (\\Exception $e) {\n $this->getLogger()->log(\\TYPO3\\CMS\\Core\\Log\\LogLevel::ERROR, sprintf('An error occurred while trying to make following api call \"%s\". Please check the configuration. Error: %s', $url, $e->getMessage()));\n }\n\n\n $this->cUrl = $curl;\n\n return $this->sendRequest();\n //===\n }", "public function find(string $subscriptionId): ApiResponse\n {\n return $this->_get(\"subscriptions/{$subscriptionId}\");\n }", "public function fetchApiInfoAll() {\n $data = $this->repository->getSubscriberInfo ();\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "public function getSubscriptionDetails()\n {\n try {\n $subscriptions = $this->fetchSubscription(Auth::user()->id);\n $this->response['success'] = true;\n $this->response['data'] = $subscriptions;\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function getSubscriptionWithId(int $subscriptionId);", "public function getSubscriptions();", "public function getSubscriptionDetails($request);", "public function subscription($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Subscription::find_with_client($this, $id);\n\n }", "public function getRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling get'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get(string $id): Subscription\n {\n $response = $this->performApiCall(\n 'GET',\n \"subscriptions/{$id}\"\n );\n\n return new Subscription(collect($response));\n }", "public function subscriptionGetAsyncWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n $returnType = '\\Maviance\\S3PApiClient\\Model\\Subscription[]';\n $request = $this->subscriptionGetRequest($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber);\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 listSubscriptions($request);", "public function get()\n\t{\n\t\t$response = $this->builder->get( $this->buildParameters(), $this->buildUrlAdditions() );\n\n\t\treturn $response;\n\t}", "public function show(Request $request)\n {\n return new GenericResource(Subscription::find($request->id), [\n 'id',\n 'title',\n 'description',\n 'price',\n 'active',\n 'type',\n ['role' => ['id']],\n 'duration',\n ]);\n }", "function listActiveSubscriptions(int $pageSize = 50, int $offset = 0){\nreturn $this->get(\"/subscription?pageSize={$pageSize}&offset={$offset}\");\n}", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "public function get()\n {\n return $this->apiCall('get', '', [], ['auto-fill' => true]);\n }", "function j2_get_yt_subs() {\n $api_key = get_option('youtube_api_key');\n $channel_id = get_option('youtube_api_channel_id');\n\n // Return if the option fields do not exist\n if(!$api_key || !$channel_id)\n return false;\n\n $youtube_url = 'https://www.googleapis.com/youtube/v3/channels?part=statistics&id='.$channel_id.'&key='.$api_key;\n $data = @file_get_contents($youtube_url);\n $json_data = json_decode($data);\n\n if(!$json_data)\n return false;\n\n $subs = $json_data->items\n }", "public static function subscriptions($body = null)\n\t{\n\t\t$returned = \\QuickFile\\Request::_sendData([], '/report/subscriptions');\n\t\treturn $returned->Report_Subscriptions->Body;\n\t}", "public function get($endpoint, array $options = []);", "public function read($id)\n {\n // check the cache and return the result if in cache\n $cacheKey = \"subscriber-{$id}\";\n $data = RedisCache::instance()->get($cacheKey);\n if (!empty($data)) {\n return new Response(200, null, unserialize($data));\n }\n\n // find the subscriber include the fields\n $found = Subscriber::with('fields')\n ->where('id', $id)\n ->get()\n ->first();\n\n // response\n if (!empty($found) && $found->count()) {\n // save to cache\n RedisCache::instance()->set($cacheKey, serialize($found));\n return new Response(200, null, $found);\n } else {\n return new Response(404, 'Subscriber not found');\n }\n }", "public function getSubscription()\n {\n return $this->subscription;\n }", "public function GetSubscription()\n {\n \t$this->SetCulture();\n \t \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions WHERE subscription_id=\" . $this->subscription_id);\n \t \n \t$row = mysql_fetch_array($rs);\n \n \t$this->subscription_id\t\t= $row['subscription_id'];\n \t$this->subscription_name\t= $row[$this->lang_name_field];\n \t\n \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n }", "public function getAsync($resourceGroupName, array $customHeaders = [])\n {\n if ($resourceGroupName == null) {\n Validate::notNullOrEmpty($resourceGroupName, '$resourceGroupName');\n }\n if ($this->_client->getApiVersion() == null) {\n Validate::notNullOrEmpty($this->_client->getApiVersion(), '$this->_client->getApiVersion()');\n }\n if ($this->_client->getSubscriptionId() == null) {\n Validate::notNullOrEmpty($this->_client->getSubscriptionId(), '$this->_client->getSubscriptionId()');\n }\n\n $path = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}';\n $statusCodes = [200];\n $method = 'GET';\n\n $path = strtr($path, ['{resourceGroupName}' => $resourceGroupName, '{subscriptionId}' => $this->_client->getSubscriptionId()]);\n $queryParams = ['api-version' => $this->_client->getApiVersion()];\n $headers = $customHeaders;\n if ($this->_client->getAcceptLanguage() != null) {\n $headers['accept-language'] = $this->_client->getAcceptLanguage();\n }\n if ($this->_client->getGenerateClientRequestId()) {\n $headers[Resources::X_MS_REQUEST_ID] = Utilities::getGuid();\n }\n\n $body = '';\n\n $response = HttpClient::send(\n $method,\n $headers,\n $queryParams,\n [],\n $this->_client->getUrl($path),\n $statusCodes,\n $body,\n $this->_client->getFilters()\n );\n\n return $response;\n }", "public function getIndex() {\n $data = $this->repository->getAllsubscriptions ();\n if (auth ()->user ()) {\n $data ['subscribed_plan'] = auth ()->user ()->activeSubscriber ()->first ();\n $data ['plan_duration_left'] = '';\n if ($data ['subscribed_plan']) {\n $end = Carbon::parse ( $data ['subscribed_plan']->pivot->end_date );\n $now = Carbon::now ();\n $length = $end->diffInDays ( $now );\n $data ['plan_duration_left'] = $length . ' days left';\n }\n } else {\n $data ['subscribed_plan'] = null;\n $data ['plan_duration_left'] = '';\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'response' => [ 'allSubscriptions' => $data,'allSubscriptions' => $data ] ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showError' ) );\n }", "public function get($resource, array $params = array(), array $options = array())\n {\n return $this->makeApiRequest($resource, $params, HttpClient::GET, $options);\n }", "function &getSubscriptions($rangeInfo = null) {\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tORDER BY\n\t\t\tiss.institution_name ASC,\n\t\t\ts.subscription_id',\n\t\t\tfalse,\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnSubscriptionFromRow');\n\n\t\treturn $returner;\n\t}", "function obtainReportForSubscription(string $id){\nreturn $this->get(\"/subscription/report/{$id}\");\n}", "public function getSubscription($key)\n {\n // check if key is string and not empty\n if (empty($key) || !is_string($key)) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'Invalid parameter \"key\"' .\n ' of \"' .\n $key .\n '\" must be a non-empty string'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $key\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription had proberties\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n\n // init subscriber data array an save the proberties plain\n $data = array();\n $data['resourceProperties'] = $subscriptionResourceProperties;\n // fill the subscriber data array with the subscription resource content\n foreach ($this->_propertyMatching as $dataKey => $propertyKey) {\n // get property content\n $propertyUri = $this->_subscriptionConfig->get($propertyKey);\n $propertyArray = isset($subscriptionResourceProperties[$propertyUri]) ?\n $subscriptionResourceProperties[$propertyUri] :\n null;\n\n // if property content exists write it to the subscriber data array\n if (isset($propertyArray) && \"\" != $propertyArray[0]['content']) {\n $data[$dataKey] = $propertyArray[0]['content'];\n } else {\n $data[$dataKey] = null;\n }\n }\n return $data;\n }\n return false;\n }", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public function get($apiQuery, $options = array());", "public static function get() {\n return self::call(\"GET\");\n }", "public function subscriptionGetWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n $returnType = '\\Maviance\\S3PApiClient\\Model\\Subscription[]';\n $request = $this->subscriptionGetRequest($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if (!in_array($returnType, ['string', 'integer', 'bool'])) {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders(),\n ];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Maviance\\S3PApiClient\\Model\\Subscription[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 0:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Maviance\\S3PApiClient\\Model\\Error',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function Info_Get()\n\t{\n\t\t$Data = $this -> HTTPRequest($this -> APIURL.'Info:Get');\n\t\treturn $this -> ParseResponse($Data);\n\t}", "public function getInfo()\n\t{\n\t\treturn $this->clientSoap->__soapCall(\"getInfo\", $this->params);\n\t}", "public function getSubscriptions() {\n\t\t$urlSubscriptions = \"http://www.reddit.com/reddits/mine.json\";\n\t\treturn $this->runCurl ( $urlSubscriptions );\n\t}", "public function get($resource, array $args = [], array $options = [])\n {\n $response = $this->client->get($resource, $args, $options);\n return $response;\n }", "public function get($path, array $parameters = array(), ApiInterface $api);", "function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}", "public function getAsync(array $filter, array $customHeaders = [])\n {\n if ($this->_client->getApiVersion() == null) {\n Validate::notNullOrEmpty($this->_client->getApiVersion(), '$this->_client->getApiVersion()');\n }\n if ($this->_client->getSubscriptionId() == null) {\n Validate::notNullOrEmpty($this->_client->getSubscriptionId(), '$this->_client->getSubscriptionId()');\n }\n\n $path = '/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/RateCard';\n $statusCodes = [200];\n $method = 'GET';\n\n $path = strtr($path, ['{subscriptionId}' => $this->_client->getSubscriptionId()]);\n $queryParams = ['$filter' => $filter, 'api-version' => $this->_client->getApiVersion()];\n $headers = $customHeaders;\n if ($this->_client->getAcceptLanguage() != null) {\n $headers['accept-language'] = $this->_client->getAcceptLanguage();\n }\n if ($this->_client->getGenerateClientRequestId()) {\n $headers[Resources::X_MS_REQUEST_ID] = Utilities::getGuid();\n }\n\n $body = '';\n\n $response = HttpClient::send(\n $method,\n $headers,\n $queryParams,\n [],\n $this->_client->getUrl($path),\n $statusCodes,\n $body,\n $this->_client->getFilters()\n );\n\n return $response;\n }", "public function subscriptionGetAsync($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n return $this->subscriptionGetAsyncWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getSubscriptions($options = NULL, $customClient = NULL) {\n\t\treturn Bf_Subscription::getByRatePlanID($this->id, $options, $customClient);\n\t}", "public function getSubscriptions($idUser)\n {\n if (!$subscriptions = Subscription::getSubscriptions($idUser)) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n\n $this->send($subscriptions);\n }", "public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }", "public function fetchSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest', $parameters);\n }", "public function servicessub_get($id)\n {\n $em = $this->doctrine->em;\n// $subcategory = $em->find('Entities\\Sub',$id);\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n\n $subcategory = $subcategoriesRepo->find($id);\n// $subcategory->services->doInitialize();\n if ($subcategory) {\n $response[\"desc\"] = \"Servicios pertenecientes a la subcategoria: $subcategory->title\";\n $services = $subcategory->getServices()->toArray();\n $user = $this->getCurrentUser();\n foreach ($services as $service) {\n $service->loadRelatedData(null, null, site_url());\n if ($user) {\n $service->loadRelatedUserData($user);\n }\n }\n $category = $subcategory->getCategory();\n $response[\"category\"] = array();\n $response[\"category\"][] = $category->getTitle();\n $response[\"subcategory\"] = array();\n $response[\"subcategory\"][] = $subcategory->getTitle();\n $response[\"data\"] = $services;\n } else {\n $response[\"desc\"] = \"Subcategoria no encontrada\";\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public function fetchSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionRequest', $parameters);\n }", "public function subscriptionPurchaseAllowedAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->subscriptionPurchaseAllowedRequest();\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 get( ServerRequestInterface $request, ResponseInterface $response )\n\t{\n\t\treturn $this->client->get( $request, $response );\n\t}", "public function getInfo() {\n return $this->getSuccessJsonResponse ( [ 'info' => [ 'rules' => $this->repository->getRules (),'allSubscriptions' => $this->repository->getAllsubscriptions () ] ] );\n }", "function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }", "function subscribeById ( $id )\n {\n try\n {\n $result = $this->apiCall('post',\"{$this->api['cms_manager_url']}/resources/subscriptions/{$id}\",array(),'json');\n return $this->createResponse($result,'Subscribe','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "protected function subscriptionGetRequest($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n // verify the required parameter 'xApiVersion' is set\n if ($xApiVersion === null || (is_array($xApiVersion) && count($xApiVersion) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $xApiVersion when calling subscriptionGet'\n );\n }\n // verify the required parameter 'merchant' is set\n if ($merchant === null || (is_array($merchant) && count($merchant) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $merchant when calling subscriptionGet'\n );\n }\n // verify the required parameter 'serviceid' is set\n if ($serviceid === null || (is_array($serviceid) && count($serviceid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $serviceid when calling subscriptionGet'\n );\n }\n\n $resourcePath = '/subscription';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($merchant !== null) {\n $queryParams['merchant'] = ObjectSerializer::toQueryValue($merchant, null);\n }\n // query params\n if ($serviceid !== null) {\n $queryParams['serviceid'] = ObjectSerializer::toQueryValue($serviceid, null);\n }\n // query params\n if ($serviceNumber !== null) {\n $queryParams['serviceNumber'] = ObjectSerializer::toQueryValue($serviceNumber, null);\n }\n // query params\n if ($customerNumber !== null) {\n $queryParams['customerNumber'] = ObjectSerializer::toQueryValue($customerNumber, null);\n }\n // header params\n if ($xApiVersion !== null) {\n $headerParams['x-api-version'] = ObjectSerializer::toHeaderValue($xApiVersion);\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils\\jsonEncode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue,\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\Utils\\jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = http_build_query($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = http_build_query($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function index()\n {\n $user = User::with(\"subscriptions\")->find(Auth::user()->id);\n $subscriptions = $user->subscriptions->toArray();\n\n return ResponseHelper::success($subscriptions, __(\"Retornando assinatura\"));\n }", "public function get()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'GET';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData('');\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'GET::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'GET::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'GET::RESPONSE', $sOutput);\n\n if ($iHTTPCode !== 200) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 200');\n }\n\n return $sOutput;\n }", "public function getIntegrationSubscriptionsAsyncWithHttpInfo($integration_key)\n {\n $returnType = '\\LaunchDarklyApi\\Model\\Integration';\n $request = $this->getIntegrationSubscriptionsRequest($integration_key);\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(Resource $resource);", "public function getSubscriptionDetails($request)\n {\n //require_once (dirname(__FILE__) . '/Model/GetSubscriptionDetailsResponse.php');\n return MarketplaceWebServiceWebstore_Model_GetSubscriptionDetailsResponse::fromXML($this->_invoke('GetSubscriptionDetails'));\n }", "public function getCurrentUserSubjectAsyncWithHttpInfo()\n {\n $returnType = '\\Killbill\\Client\\Swagger\\Model\\Subject';\n $request = $this->getCurrentUserSubjectRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($request, $returnType) {\n return $this->handleResponse($request, $response, $returnType);\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 getAsync(): string;", "function list(Request $request) {\n $query = Subscription::query();\n\n if ($search = $request->search) {\n $this->searchTerm($query, $search, ['title', 'description']);\n }\n return SubscriptionListResource::collection($query->paginate($request->get('perPage')));\n }", "function getSkus() {\n\techo \"Getting Skus </br>\";\n\t$response = getRequest('/api/sku');\n\tprintInfo($response);\n}", "public function show(Subscription $subscription)\n {\n //\n }", "public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }", "public function fetchAll() {\n $data = $this->repository->getAllsubscriptions ();\n foreach ( $data ['data'] as $ak => $av ) {\n unset ( $data ['data'] [$ak] ['id'] );\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }", "function salesforceAPIGetAsync( $urlSegment, $data = array() ) {\n global $browser;\n $sfAuth = getSFAuth();\n $url = $sfAuth->instance_url . '/services/data/v44.0/' . $urlSegment . '.json?' . http_build_query( $data );\n $headers = array( 'Authorization' => 'Bearer ' . $sfAuth->access_token );\n \n addToLog( 'GET: ' . $url );\n addToLog( 'headers:', $headers );\n\n // add access token to header and make the request\n return $browser->get( $url, $headers )->then( function($response) {\n $responseBody = getJsonBodyFromResponse( $response );\n addToLog( 'response:', $responseBody );\n return $responseBody;\n });\n}", "public function index()\n {\n $search = [];\n $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;\n $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;\n\n //if(isset($_GET['all'])){\n $search['all'] = true;\n //}\n\n if(isset($_GET['user_id'])){\n $search['user_id'] = $_GET['user_id'];\n }\n\n $data = $this->user_subscription->getAll($offset, $limit, $search);\n $data['offset'] = isset($_GET['all']) ? 'all' :$offset;\n $data['limit'] = isset($_GET['all']) ? 'all' : $limit;\n $data['total'] = 0;\n \n $data['total'] = $this->user_subscription->count();\n\n return response()->json(['success'=> $data ], 200);\n }", "public function get($parameters = array())\n {\n return $this->callItemEndpoint(__METHOD__);\n }", "public function httpGet()\n {\n return $this->method(\"GET\");\n }", "public function getsubscribers() {\r\n if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']==\"XMLHttpRequest\") {\r\n $this->db->select()\r\n ->from('ci_subscribers sub')\r\n ->where('sub.status', 1)\r\n ->order_by('sid', 'ASC');\r\n $query = $this->db->get();\r\n $query = $query->result_array();\r\n print json_encode($query);\r\n }else{\r\n header(\"Location: \" . base_url());\r\n }\r\n }", "public function restNewslettersGetAsync()\n {\n return $this->restNewslettersGetAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function get($apiPath, array $parameters = array(), array $options = array())\n {\n return $this->send($apiPath, $parameters, 'GET', $options);\n }", "public function show($id)\n {\n $user_subscription = $this->user_subscription->find($id);\n\n if($user_subscription){\n return response()->json(['success'=>$user_subscription], 200);\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function getSubscription( $subscriptionId )\n {\n $principal = System_Api_Principal::getCurrent();\n\n $query = 'SELECT subscription_id, issue_id, user_id, stamp_id'\n . ' FROM {subscriptions}'\n . ' WHERE subscription_id = %d AND user_id = %d';\n\n if ( !( $subscription = $this->connection->queryRow( $query, $subscriptionId, $principal->getUserId() ) ) )\n throw new System_Api_Error( System_Api_Error::UnknownSubscription );\n\n return $subscription;\n }", "protected function get() {\n $subc = \"get_\".$this->sub_collection;\n if ($subc !== null && method_exists($this, $subc)) {\n $this->im_here();\n if ($this->sub_collection == \"users\") {\n $current_users = intval($this->params->number);\n while (1) {\n $this->clear_inactive_users();\n $users = $this->get_users();\n if (sizeof($users) !== $current_users) {\n return $users;\n }else {\n sleep(1);\n }\n }\n }\n return $this->$subc();\n }else {\n $this->write_error(\"Request error!\");\n }\n }", "public function get($params = []);", "public function subscription($name = 'default')\n {\n return $this->subscriptions->sortByDesc(function (Subscription $subscription) {\n return $subscription->created_at->getTimestamp();\n })->first(function (Subscription $subscription) use ($name) {\n return $subscription->name === $name;\n });\n }", "public function get(string $endpoint, array $options = [])\n {\n Guzzle::GET(self::ENDPOINT, $endpoint, [\n RequestOptions::QUERY => $options\n ]);\n \n return Guzzle::Response();\n }", "public function get_active_subscriptions() {\r\n return $this->get_all_subscriptions( true );\r\n }", "public function getUserSubscriptionWithId(int $userSubscriptionId);", "public function get(\n string $id,\n ?RequestOptions $options = null,\n ): ResponseInterface;", "public function queryServiceSubscriber($request)\n {\n $runtime = new RuntimeOptions([]);\n $headers = [];\n\n return $this->queryServiceSubscriberEx($request, $headers, $runtime);\n }", "public function GetSubscriptionsList()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" => $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name\"\t=> $row[$this->lang_name_field]\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function show($id, Request $request)\n {\n if($request->id){\n $subscription_view = Subscription::find($request->id);\n return ['subscription_view'=>$subscription_view];\n }\n }", "public function get($endpoint = '', $query=[], $body='');", "public function listsubscriptions() {\n\t\t//load Topicmodel\n\t\t$this->load->model('Topicmodel');\n\t\t\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Topicmodel->countAllSubscriptionsByUser($this->userID);\n\t\t$jTableResult['Records'] = $this->Topicmodel->ListAllSubscriptionsByUser($this->userID,$this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function get($selector)\n {\n $arg = new ServicedAccountServiceGet($selector);\n $result = $this->__soapCall(\"get\", array($arg));\n return $result->rval;\n }", "public function get(string $serviceId, array $arguments = []): mixed;", "public function restNewslettersGetAsyncWithHttpInfo()\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Entry[]';\n $request = $this->restNewslettersGetRequest();\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 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 getCurrentSubscription($companyId);", "public function get($endpoint, $data=null, $extra_headers=array())\n {\n return $this->_request($endpoint, 'get', $data, $extra_headers);\n }", "public function subscriptionGet($xApiVersion, $merchant, $serviceid, $serviceNumber = null, $customerNumber = null)\n {\n [$response] = $this->subscriptionGetWithHttpInfo($xApiVersion, $merchant, $serviceid, $serviceNumber, $customerNumber);\n\n return $response;\n }", "final public function get($resource, $id)\n {\n Util::throwIfNotType(['string' => [$resource], 'int' => [$id]], true);\n\n $timestamp = time();\n $query = [\n 'apikey' => $this->publicApiKey,\n 'ts' => $timestamp,\n 'hash' => md5($timestamp . $this->privateApiKey . $this->publicApiKey),\n ];\n\n $url = self::BASE_URL . urlencode($resource) . \"/{$id}?\" . http_build_query($query);\n\n return $this->send(new Request($url, 'GET', ['Accept' => 'application/json']));\n }", "public function get(...$args)\n {\n return $this->curl('get', ...$args);\n }" ]
[ "0.66120684", "0.6430841", "0.64088047", "0.6312208", "0.60517657", "0.5971194", "0.5970343", "0.5928071", "0.5783426", "0.57409406", "0.56164896", "0.56123966", "0.5522304", "0.551403", "0.5507932", "0.5494891", "0.54647666", "0.541186", "0.53250504", "0.52590114", "0.52590114", "0.52590114", "0.52543443", "0.52393556", "0.52250576", "0.52232915", "0.51870614", "0.518637", "0.5175761", "0.5174768", "0.51671946", "0.51644933", "0.51417154", "0.51275873", "0.5123751", "0.512102", "0.51148874", "0.5113342", "0.51016974", "0.50990176", "0.50804186", "0.5066722", "0.5061288", "0.50606257", "0.50568205", "0.50502646", "0.5049913", "0.5044258", "0.5035951", "0.500949", "0.5005262", "0.49994123", "0.49887747", "0.49880025", "0.49864995", "0.4952812", "0.49523827", "0.49508297", "0.49360242", "0.49337423", "0.49271482", "0.49203724", "0.49058375", "0.49043655", "0.49037376", "0.49032265", "0.48885173", "0.4884723", "0.4876869", "0.4875616", "0.48711637", "0.48710033", "0.48694074", "0.48642313", "0.48571834", "0.48550653", "0.4852583", "0.4847764", "0.48473582", "0.48337334", "0.4826797", "0.48119566", "0.4805961", "0.4799739", "0.47985396", "0.47981527", "0.479548", "0.4793865", "0.47858956", "0.47858557", "0.47815737", "0.4773757", "0.47724313", "0.4769389", "0.47692263", "0.47667354", "0.4766377", "0.47653034", "0.4765079", "0.47618344" ]
0.5880019
8
Create request for operation 'get'
public function getRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling get' ); } $resourcePath = '/subscriptions/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); } // for model (json/xml) if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGetRequest(): ParameterBag { return $this->get; }", "public function & GetRequest ();", "abstract public function get(Request $request);", "function get(Request &$request, Response &$response);", "public function get()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "public function getRequest() {}", "public function getRequest() {}", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function request()\n {\n return new GuzzleHttp\\Psr7\\Request('GET', 'Persons/'.$this->id);\n }", "protected function getReadRequest()\n\t{\n\t\t$url = $this->url();\n\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\":1, \"foo\":\"bar\"}');\n\t\t\n\t\treturn new Api\\Request\\Read((string) $url);\n\t}", "public static function get() {\n return self::call(\"GET\");\n }", "protected function getRequest() {}", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function get($params = []);", "public function request()\n {\n $request = new GuzzleHttp\\Psr7\\Request('GET', 'ProductsSimple');\n\n return $request->withUri($request->getUri()->withQuery(http_build_query([\n 'startRow' => $this->skip ? $this->skip + 1 : null,\n 'pageRows' => $this->take,\n 'updatedAfter' => $this->updatedAfter ? $this->updatedAfter->format('Y-m-d\\TH:i:s') : null\n ])));\n }", "public function testAddGetParam()\n\t{\n\t\t$URL = new URL('http://' . self::TESTHOST . \"/requestInfos.php?getA=hallo\");\n\t\t$Payload = new Payload(new DataAsGET('getB', 'halloB'));\n\n\t\t$Request = new Request($URL, new PUT(), $Payload);\n\t\t$this->assertTrue(\n\t\t\t$Request->getResponseAs(\n\t\t\t\tnew class extends AbstractResponse\n\t\t\t\t{\n\t\t\t\t\tpublic function createByRequest($body, Headerlist $Headers, HTTPStatusCode $Status, \\DateInterval $RequestTime)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bodyArr = json_decode($body, true);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t$bodyArr['_GET']['getA'] == 'hallo'\n\t\t\t\t\t\t\t&& $bodyArr['_GET']['getB'] == 'halloB'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}", "public function get() {\n try {\n\n /**\n * Set up request method\n */\n $this->method = 'GET';\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function httpGet()\n {\n return $this->method(\"GET\");\n }", "function getRequest();", "public function request();", "public function createRequest();", "public function createRequest();", "public function get()\n\t{\n\t\t$response = $this->builder->get( $this->buildParameters(), $this->buildUrlAdditions() );\n\n\t\treturn $response;\n\t}", "public function test_happy_flow_get()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_GET['sp-entity-id'] = 'http://mock-sp';\n\n $request = new Request($_GET, $_POST, [], [], [], $_SERVER);\n\n $this->assertTrue($this->validator->isValid($request));\n }", "protected function getIndexRequest()\n\t{\n\t\t$url = $this->url();\n\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter(\n\t\t\t\t\t'output', \n\t\t\t\t\t'{\"entities\":[{\"id\":1,\"foo\":\"bar\"},{\"id\":2,\"foo\":\"baz\"}]}'\n\t\t\t\t);\n\t\t\t\t\n\t\treturn new Api\\Request\\Index((string) $url);\n\t}", "public function request_get($uri, array $options = array()) {\n $options['method'] = 'GET';\n return $this->request($uri, $options);\n }", "public function doGet($path = '', array $query = array());", "private function GET() {\n global $_GET;\n $getData = array();\n foreach($_GET as $key => $value) {\n $getData[$key] = $value;\n }\n $this -> response[\"response\"] = $getData;\n return;\n }", "public function getrequest()\n {\n $request = User::getrequest();\n return result::repsonse(true,$request);\n }", "public function getGet ();", "public function get()\n {\n $this->method = 'GET';\n return $this;\n }", "public function getRequestWrapper();", "public function get() {\n\t\t$this->method('GET');\n\t\treturn $this;\n\t}", "public function getMethod()\n {\n return 'GET';\n }", "protected function obtainGetRequest() {\n $request = Request::createFromGlobals();\n return $request->query;\n }", "abstract public function request();", "private function initGetRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl().'?'.$this->getQuery())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_GET)\n ;\n }", "function request($httpMethod, $service, $apiMethod, array $parameters = array(), array $options = array());", "protected function _getRequest() {\n\t\treturn new Request;\n\t}", "protected function getHttpMethod()\n {\n return 'GET';\n }", "public function createRequest()\n {\n return new ChipVN_Http_Request;\n }", "public function getAPI(Request $request)\n {\n }", "public function availableTenantResourceOperationsRequest()\n {\n\n $resourcePath = '/tenant';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getRequest() {\n $params = array('fetchLicensesByPidRequest', 'fetchLicensesByUrlRequest');\n foreach ($params as $parameter) {\n $getter = 'get' . ucfirst($parameter);\n if ($value = $this->$getter()) {\n $this->setParameter($parameter, $value);\n }\n }\n\n return $this;\n }", "public function index_get() {\n $action = $this->get('action');\n switch ($action) {\n case \"retrieve_get\":\n $this->retrieve_get();\n break;\n default:\n $this->not_found();\n break;\n }\n }", "private function GET($url,$params=false){\n return $this->Request($url,$params,HTTP_GET);\n }", "abstract protected function requestApi($action = '', $params = array(), $method = 'POST');", "function request()\n {\n return Request::get();\n }", "public function testBasicGET()\n\t{\n\t\t$Request = new Request(\n\t\t\tnew URL('http://' . self::TESTHOST . '/hallo'),\n\t\t\tnull, // method. Default GET\n\t\t\tnull, // Payload\n\t\t\t$this->_getDefaultOptions());\n\n\t\t// Return the body as string\n\t\t$Result = $Request->getResponseAs(new StringValue());\n\n\t\t$this->assertEquals('hallo', (string)$Result);\n\t}", "function request($url = '', $format='xml', $params=null, $method = \"GET\", $data = null, $headers = null) {\n\t\t$query_string_params = array();\n\t\t\t\t\n\t\t// add additional parameters if necessary\n\t\tif (!is_null($params) && is_array($params)) {\n\t\t\t$query_string_params = $params;\n\t\t}\n\t\t\n\n\t\t// set proper format request\n\t\tif ($this->format_as_extension) { $this->baseURL .= '.' . $format; }\n\t\telse { $query_string_params['format'] = $format; }\n\n\t\t// add the url as parameter, oembed-style\n\t\t$query_string_params['url'] = $url;\t\t\n\t\t\n\t\t$this->setQueryString($query_string_params);\t\t\n\n\t\treturn parent::request('', $method, $data, $headers);\n\t}", "public function getRequest(): \\GuzzleHttp\\Psr7\\Request\n {\n }", "public function get($endpoint = '', $query=[], $body='');", "public function getMethod()\n {\n return Http::GET;\n }", "function get($url, $args = array()) {\n\t\t$defaults = array('method' => 'GET');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}", "public function request(): RequestContract;", "public function _get($url = null, $parameters = []);", "public function get(Classes\\GetRequest $arg) {\n\t\treturn $this->makeSoapCall(\"get\", $arg);\n\t}", "public function get()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'GET';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData('');\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'GET::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'GET::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'GET::RESPONSE', $sOutput);\n\n if ($iHTTPCode !== 200) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 200');\n }\n\n return $sOutput;\n }", "public function tspRequest()\n {\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function manageGetVerb(Request $request)\n {\n\n $listaBoletos = null;\n $id = null;\n $response = null;\n $code = null;\n\n //if the URI refers to a libro entity, instead of the libro collection\n if (isset($request->getUrlElements()[2])) {\n $id = $request->getUrlElements()[2];\n }\n\n\n $listaBoletos = ManejadoraBoletoModel::getBoleto($id);\n\n if ($listaBoletos != null) {\n $code = '200';\n\n } else {\n\n //We could send 404 in any case, but if we want more precission,\n //we can send 400 if the syntax of the entity was incorrect...\n if (ManejadoraBoletoModel::isValid($id)) {\n $code = '404';\n } else {\n $code = '400';\n }\n\n }\n\n $response = new Response($code, null, $listaBoletos, $request->getAccept());\n $response->generate();\n\n }", "protected function shopGetRequest($data)\n {\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling shopGet'\n );\n }\n\n $resourcePath = '/shop/get';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n if (in_array('multipart/form-data', ['application/json', 'application/xml'])) {\n $multipart = true;\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', 'application/xml']\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('access_token');\n if ($apiKey !== null) {\n $queryParams['access_token'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('nonce');\n if ($apiKey !== null) {\n $queryParams['nonce'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('timestamp');\n if ($apiKey !== null) {\n $queryParams['timestamp'] = $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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getShopRequest()\n {\n $resourcePath = '/shop';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires 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 }", "protected function apiRequest()\n {\n $request = 'post';\n if ($this->method->isGetRequest()) {\n $request = 'get';\n }\n\n return $this->getTelegram()->{$request}($this->method->apiEndpoint(), $this->method->toArray());\n }", "public function request($method, $endpoint = '', $query=[], $body='');", "protected function getAPIResourcesRequest()\n {\n\n $resourcePath = '/apis/apps/v1beta1/';\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', 'application/yaml', 'application/vnd.kubernetes.protobuf']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'],\n ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\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 }", "public function makeRequest( $url, $method = 'GET', $headers = null );", "public function getRequestParams();", "public function request($path, array $parameters = array(), $httpMethod = 'GET', ApiInterface $api);", "public function apiGetRequest($endpoint);", "public function get($uri, $queryParams = ''){\n// $headers = [\n// 'Authorization' => 'Bearer '.$this->token\n// ];\n//\n// return $client->request(\n// 'GET',\n// $this->getUrl($uri),\n// array('headers'=>$headers,'query' =>$queryParams)\n// );\n//\n $client = new Client();\n return $client->request('GET', $this->getUrl($uri), ['query' => $queryParams]);\n }", "public function processGetRequest(){\n\t\t$query = $this->request->getQueryString();\n\t\t$params = $this->request->getPathParameters();\n\t\tif (!empty($params)){\n\t\t\t\n\t\t\t$uid \t= $this->extractUserId();\n\t\t\t$controller = new ExampleController();\n\t\t\t$result = $controller->getUserById($uid);\n\t\t\tif ($result){\t\n\t\t\t\tnew Response('200', $result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnew Response('404');\n\t\t\t} \n\t\t}\n\t\telse{\n\t\t\t// get all\n\t\t\t$controller = new ExampleController();\n\t\t\t$results = $controller->getAllUsers($query);\n\t\t\tnew Response('200', $results);\n\t\t}\n\t}", "public function HTTPRequest(){\n\t}", "public function testSetGetGet()\n {\n // Create and set empty by default\n $request = new Request();\n $request->unsetGlobals();\n\n // Its empty by default\n $res = $request->getGet(\"nothing\");\n $this->assertEmpty($res);\n\n // Get whole array, empty by default\n $res = $request->getGet();\n $this->assertEmpty($res);\n $this->assertIsArray($res);\n\n // Set a plain value and retrieve it\n $key = \"somekey\";\n $value = \"somevalue\";\n $request->setGet($key, $value);\n $res = $request->getGet($key);\n $this->assertEquals($res, $value);\n\n // Check if value exists or not\n $res = $request->hasGet($key);\n $this->assertTrue($res);\n $res = $request->hasGet(\"nada\");\n $this->assertFalse($res);\n\n // Set a value using an array and retrieve it\n $array = [\n \"key\" => \"value\",\n \"key1\" => \"value1\",\n ];\n $request->setGet($array);\n\n $res = $request->getGet(\"key\");\n $this->assertEquals($res, \"value\");\n\n $res = $request->getGet(\"key1\");\n $this->assertEquals($res, \"value1\");\n }", "public function getRequest(): RequestInterface;", "public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }", "public function get()\n\t\t{\n\t\t\t$aArgument = func_get_args();\n\t\t\t$sURL = array_shift( $aArgument );\n\t\t\t$aData = (bool) count( $aArgument ) ? array_shift( $aArgument ) : Array();\n\t\t\t$mReferer = (bool) count( $aArgument ) ? array_shift( $aArgument ) : false;\n\n\t\t\treturn $this->request( \"get\", $sURL, $aData, $mReferer );\n\t\t}", "protected function getPricelistsRequest()\n {\n $resourcePath = '/pricelists';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires 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 getRequest(): Request\n\t{\n\t\t//Get php://input for PUT and DELETE methods\n\t\tparse_str(file_get_contents('php://input'), $_DATA);\n\t\treturn new Request($_SERVER, $_GET + $_POST + $_DATA);\n\t}", "function apiGet($key,$default=false) {return isset($_GET[$key]) ? $_GET[$key] : $default;}", "public function sendGet()\n\t{\n\t\t$ch = curl_init(\"http://localhost/rest/index.php/book\");\n\t\t//a true, obtendremos una respuesta de la url, en otro caso, \n\t\t//true si es correcto, false si no lo es\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t//establecemos el verbo http que queremos utilizar para la petición\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t//obtenemos la respuesta\n\t\t$response = curl_exec($ch);\n\t\t// Se cierra el recurso CURL y se liberan los recursos del sistema\n\t\tcurl_close($ch);\n\t\tif(!$response) {\n\t\t return false;\n\t\t}else{\n\t\t\tvar_dump($response);\n\t\t}\n\t}", "public static function get($uri,$params=[],$options=[]) {\n return self::request('GET',$uri,$params,$options);\n }", "public static function _GET()\n {\n if(!self::$_get) {\n $values = $_GET;\n self::$_get = new HttpParams($values);\n }\n return self::$_get;\n }", "function curl_get($url, array $get = NULL, array $headers = NULL, array $options = array()) { \n $defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 4,\n $headers\n ); \n \n $ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults));\n \n if ( ! $result = curl_exec($ch)) { \n trigger_error(curl_error($ch)); \n } \n curl_close($ch); \n return $result; \n}", "protected function getAllRequest()\n {\n\n $resourcePath = '/links';\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 get($url, $query = array(), $headers = array());", "public function get(array $queryParams, $endpoint);", "protected function accountDetailsRequest()\n {\n\n $resourcePath = '/accounts';\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/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "function http_request($method, $url = null, $body = null, ?array $options = null, ?array &$info = null) {}", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function request($path, $method = \"GET\", $vars = array(), $headers = array( 'Accept' => 'application/json', 'Content-Type' => 'application/json' ) ) {\n\n $encoded = \"\";\n /*foreach($vars AS $key=>$value)\n $encoded .= \"$key=\".urlencode($value).\"&\";*/\n //$encoded = substr($encoded, 0, -1);\n $encoded = json_encode($vars);\n $tmpfile = \"\";\n $fp = null;\n \n // construct full url\n $url = \"{$this->Endpoint}/$path\";\n \n // if GET and vars, append them\n if($method == \"GET\") \n $url .= (FALSE === strpos($path, '?')?\"?\":\"&\").$encoded;\n\n // initialize a new curl object \n $curl = curl_init($url);\n \n $opts = array();\n foreach ($headers as $k => $v) $opts[CURLOPT_HTTPHEADER][] = \"$k: $v\";\n curl_setopt_array($curl, $opts);\n \n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n switch(strtoupper($method)) {\n case \"GET\":\n curl_setopt($curl, CURLOPT_HTTPGET, TRUE);\n break;\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $encoded);\n break;\n case \"PUT\":\n // curl_setopt($curl, CURLOPT_PUT, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $encoded);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n file_put_contents($tmpfile = tempnam(\"/tmp\", \"put_\"),\n $encoded);\n curl_setopt($curl, CURLOPT_INFILE, $fp = fopen($tmpfile,\n 'r'));\n curl_setopt($curl, CURLOPT_INFILESIZE, \n filesize($tmpfile));\n break;\n case \"DELETE\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n break;\n default:\n throw(new PocketstopException(\"Unknown method $method\"));\n break;\n }\n \n // send credentials\n curl_setopt($curl, CURLOPT_USERPWD,\n $pwd = \"{$this->AccountId}:{$this->ApiKey}\");\n \n // do the request. If FALSE, then an exception occurred \n if(FALSE === ($result = curl_exec($curl)))\n throw(new PocketstopException(\n \"Curl failed with error \" . curl_error($curl)));\n \n // get result code\n $responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n \n // unlink tmpfiles\n if($fp)\n fclose($fp);\n if(strlen($tmpfile))\n unlink($tmpfile);\n \n return new PocketstopRestResponse($url, $result, $responseCode);\n }", "protected function templistsGetRequest()\n {\n\n $resourcePath = '/templists';\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 // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires 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 }", "protected function getCurrenciesRequest()\n {\n $resourcePath = '/currencies';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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 $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires 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 }", "protected function restNewslettersGetRequest()\n {\n\n $resourcePath = '/rest/newsletters';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n 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 $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function obtainRequest() {\n return Request::createFromGlobals();\n }" ]
[ "0.7444611", "0.7054626", "0.6905653", "0.6869041", "0.68634444", "0.68248415", "0.68248415", "0.6792523", "0.6792523", "0.6792523", "0.6792523", "0.6792523", "0.6792523", "0.6792523", "0.6792523", "0.6585211", "0.6582826", "0.6556477", "0.65153414", "0.6487634", "0.6442366", "0.64310217", "0.64167166", "0.6410639", "0.6404894", "0.6354006", "0.6345651", "0.63176775", "0.63176775", "0.63096017", "0.6305112", "0.63009995", "0.6270644", "0.62592494", "0.62567544", "0.62565905", "0.6245703", "0.6232931", "0.6214328", "0.61870223", "0.61826193", "0.61801296", "0.6176998", "0.61739975", "0.6158005", "0.6148887", "0.61056495", "0.61048734", "0.6103882", "0.610106", "0.6084496", "0.6076996", "0.6075164", "0.6064415", "0.6057372", "0.6051081", "0.60445535", "0.60425776", "0.60410804", "0.60339266", "0.6016312", "0.6002672", "0.5993362", "0.59724647", "0.5970301", "0.5959569", "0.59560394", "0.5952543", "0.59473807", "0.5946239", "0.59455955", "0.5933055", "0.5918654", "0.590717", "0.59062403", "0.5886024", "0.58818007", "0.58768606", "0.5864895", "0.58628345", "0.5857862", "0.5852211", "0.5849587", "0.58473784", "0.5841421", "0.58195746", "0.58173734", "0.57941747", "0.57940143", "0.5792137", "0.57859975", "0.5781899", "0.5777539", "0.57712704", "0.57645184", "0.57591623", "0.57571334", "0.57509446", "0.5745162", "0.5743668", "0.57402545" ]
0.0
-1
Operation pause Pause Subscription
public function pause($id, $pause_subscription_request = null) { list($response) = $this->pauseWithHttpInfo($id, $pause_subscription_request); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }", "public function pause();", "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseQueue()\n {\n return $this->sendrequest('pause', null);\n }", "public function pause(Timer $timer);", "public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }", "function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}", "public function pause(){\n\t\tsession_write_close();\n\t}", "public function actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }", "public function unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }", "function pause()\n {\n session_write_close();\n }", "function pause() {\n\n\t\tif (is_null($this->_httpq->pause())) { return false; }\n\t\treturn true;\n\n\t}", "function theme_views_slideshow_thumbnailhover_control_pause($vss_id, $view, $options) {\n return l(t('Pause'), '', array(\n 'attributes' => array(\n 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',\n 'id' => \"views_slideshow_thumbnailhover_playpause_\" . $vss_id,\n ),\n 'fragment' => ' ',\n 'external' => TRUE,\n ));\n}", "function campaignPause($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignPause\", $params);\n }", "public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }", "public function pauseWorking(){\r\n\r\n }", "public function getPause()\n {\n return $this->get(self::PAUSE);\n }", "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function isPaused();", "function paused_plugins_notice()\n {\n }", "function VM_pauseVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" pause\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function pause($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('pause', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function pauseCampaignAction(\n Request $request,\n GoogleAdsClient $googleAdsClient\n ): View {\n // Retrieves the form inputs.\n $customerId = $request->input('customerId');\n $campaignId = $request->input('campaignId');\n\n // Deducts the campaign resource name from the given IDs.\n $campaignResourceName = ResourceNames::forCampaign($customerId, $campaignId);\n\n // Creates a campaign object and sets its status to PAUSED.\n $campaign = new Campaign();\n $campaign->setResourceName($campaignResourceName);\n $campaign->setStatus(CampaignStatus::PAUSED);\n\n // Constructs an operation that will pause the campaign with the specified resource\n // name, using the FieldMasks utility to derive the update mask. This mask tells the\n // Google Ads API which attributes of the campaign need to change.\n $campaignOperation = new CampaignOperation();\n $campaignOperation->setUpdate($campaign);\n $campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));\n\n // Issues a mutate request to pause the campaign.\n $googleAdsClient->getCampaignServiceClient()->mutateCampaigns(\n $customerId,\n [$campaignOperation]\n );\n\n // Builds the GAQL query to retrieve more information about the now paused campaign.\n $query = sprintf(\n \"SELECT campaign.id, campaign.name, campaign.status FROM campaign \" .\n \"WHERE campaign.resource_name = '%s' LIMIT 1\",\n $campaignResourceName\n );\n\n // Searches the result.\n $response = $googleAdsClient->getGoogleAdsServiceClient()->search(\n $customerId,\n $query\n );\n\n // Fetches and converts the result as a POPO using JSON.\n $campaign = json_decode(\n $response->iterateAllElements()->current()->getCampaign()->serializeToJsonString(),\n true\n );\n\n return view(\n 'pause-result',\n compact('customerId', 'campaign')\n );\n }", "public function pause() {\n\t\ttry {\n\n\t\t\t// Make sure the previous one is stopped\n\t\t\tif (empty($this->measurements)) {\n\t\t\t\tthrow new AggregatedMeasurementNotStartedStopwatchException($this);\n\t\t\t}\n\n\t\t\t// Stop the measurements\n\t\t\t$measurement =& $this->measurements[$this->count];\n\t\t\tif ($measurement->isStopped()) {\n\t\t\t\tthrow new AggregatedMeasurementAlreadyStoppedStopwatchException($this);\n\t\t\t}\n\t\t\t$measurement->stop();\n\n\t\t\t// Update the looped info\n\t\t\t$this->total += $measurement->getTime();\n\t\t\t$this->count++;\n\n\t\t} catch (StopwatchException $ex) {\n\t\t\tStopwatchException::handle($ex);\n\t\t}\n\n\t\treturn $this;\n\t}", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function pause($state = -1 ,$fadeInSecs = -1)\n\t{\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" pause \".($state >= 0 ? (string) $state : \"\").\" \".(($state == 0 && $fadeInSecs >= 0) ? (string) $fadeInSecs : \"\"));\n\t}", "public function resume();", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "abstract protected function doSuspend();", "function videoPlayPauseButton(){ ?>\n\t\n\t<span id=\"video-play-pause\" class=\"pause-btn\"></span>\n\n<?php }", "public function testMissingParameterPauseCheck() {\n $this->pingdom->pauseCheck(null);\n }", "public function isPaused()\n {\n return $this->paused;\n }", "public function send($message, $signal = null, $pause = 100000)\n {\n $messageArray = array();\n\n // Read any existing messages in apcu\n if(apcu_exists($this->key)){\n $readMessage = apcu_fetch($this->key);\n\n if($readMessage !== false){\n //$messageArray[] = unserialize($readMessage);\n $messageArray[] = $readMessage;\n }\n\n //cleanup\n apcu_delete($this->key);\n }else{\n\n }\n\n // Add the current message to the end of the array, and serialize it\n $messageArray[] = $message;\n\n // Write new serialized message to apcu\n $store = apcu_store($this->key, $messageArray, 0);\n\n if($store === false){\n throw new ProcessControlException(sprintf('Not able to create cache for PID: %s with key %s', $this->pid, $this->key));\n }\n\n if (false === $signal) {\n return;\n }\n\n $this->signal($signal ?: $this->signal);\n usleep($pause);\n }", "public function paused_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'paused_hook',\n\t\t\t$context\n\t\t);\n\t}", "public function destroy($id)\n {\n //\n $pause = Pause::find($id);\n\n $pause->delete(); \n }", "public function isPausable() {\n return $this->state->canChange('paused');\n }", "public function containerPause($container)\n {\n return $this->browser->post(\n $this->uri->expand(\n 'containers/{container}/pause',\n array(\n 'container' => $container\n )\n )\n )->then(array($this->parser, 'expectEmpty'));\n }", "function qa_suspend_event_reports($suspend = true)\n{\n\tglobal $qa_event_reports_suspended;\n\n\t$qa_event_reports_suspended += ($suspend ? 1 : -1);\n}", "public function isPaused()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_PAUSED;\n\t}", "public function subscription();", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "function pauseReport($conn, $planID, $moduleArray){\n\tinsertTemporaryReport($conn, $planID);\n\t\n\tforeach($moduleArray as $module){\n\t\tif($module != \"none\"){\n\t\t\tinsertIncompleteModule($conn, $planID, $module);\n\t\t}\n\t}\n\t\n\t$return = [\"msg\" => \"successfully saved the modules\"];\n\treturn $return;\n\t\n}", "public function subscribe(): void;", "private function _loop():void\n\t{\n\t\twhile( true )\n\t\t\tif( $this->_status === self::STATUSES['PAUSED'] )\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\tif( $this->_queue )\n\t\t\t\t$this->_step();\n\t\t\telse\n\t\t\tif( $this->_timeout_queue )\n\t\t\t\t$this->_stepTimeout();\n\t\t\telse\n\t\t\t\tbreak;\n\t}", "public function testMissingParametersPauseChecks() {\n $this->pingdom->pauseChecks(null);\n }", "function gupnp_context_set_subscription_timeout($context, $timeout)\n{\n}", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "private function setRunningPaused( $running, $paused ) {\n $this->isRunning = is_bool( $running ) ? $running : false;\n $this->isPaused = is_bool( $paused ) ? $paused : false;\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function console_pause() {\n echo PHP_EOL.\"Press ENTER to continue...\";\n fgetc(STDIN);\n }", "public function getPauseCount(): int\n {\n return $this->pauseCount;\n }", "public function testIsPaused()\n\t{\n\t\t$this->assertFalse($this->object->isPaused());\n\n\t\t$paused = new PNEngineStatePaused($this->object);\n\t\tTestReflection::setValue($this->object, 'state', $paused);\n\n\t\t$this->assertTrue($this->object->isPaused());\n\t}", "public function pauseAsyncWithHttpInfo($id, $pause_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->pauseRequest($id, $pause_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 suspend()\n {\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = false;\n $this->suspended = true;\n\n $this->saveToVariableHandlers();\n\n $keys = array_keys($this->variables);\n $count = count($keys);\n $handlers = $this->workflow->getVariableHandlers();\n\n for ($i = 0; $i < $count; $i++) {\n if (isset($handlers[$keys[$i]])) {\n unset($this->variables[$keys[$i]]);\n }\n }\n\n $this->doSuspend();\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionSuspended($this);\n }\n }", "public function resume(): bool {}", "public function isPaused() {\n return $this->state->getCode() == TaskState::Paused;\n }", "public function suspend($status = false)\n {\n if ($this->storedStatus === null) {\n $this->storedStatus = $this->isEnabled;\n $this->isEnabled = $status;\n }\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function recurring_subscription_confirm()\n {\n $model = & $this->getModel('jms');\n $model->recurringSubscriptionConfirm();\n }", "public function publishfinish()\n {\n $procedures = Procedure::where('date_publish_finish', '<', Carbon::now()->format('Y-m-d'))\n ->where('publish', '=', true)\n ->get();\n foreach ($procedures as $procedure):\n $procedure->date_publish_finish = null;\n $procedure->publish = false;\n $procedure->save();\n endforeach;\n\n\n }", "public function promote()\n {\n }", "public function testResumeMember()\n {\n }", "function wp_skip_paused_plugins(array $plugins)\n {\n }", "public function unSubscribe()\n {\n }", "public function resume(): bool;", "public function resume(Timer $timer);", "protected function _waitAudioReinvite()\n {\n $this->_timer->reset();\n $this->_timer->setOptions( array( Streamwide_Engine_Timer_Timeout::OPT_DELAY => 1 ) );\n $this->_timer->addEventListener(\n Streamwide_Engine_Events_Event::TIMEOUT,\n array(\n 'callback' => array( $this, 'onAudioReinviteTimeout' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $this->_timer->arm();\n }", "public function release($delay = 0)\n {\n $release = new \\DateTime;\n $release->setTimezone(new \\DateTimeZone('UTC'));\n $release->add(new \\DateInterval('PT' . $delay . 'S'));\n $this->job->setScheduledEnqueueTimeUtc($release);\n $this->azure->unlockMessage($this->job);\n }", "public function pausedStock($entityIds){\r\n $productSellerId = Mage::getModel ( 'catalog/product' )->load ( $entityIds )->getSellerId ();\r\n if ($productSellerId == Mage::getSingleton ( 'customer/session' )->getCustomerId ()) {\r\n $_Product = Mage::getModel ( 'catalog/product' )->load($entityIds);\r\n $stockData = array ();\r\n $_Product->setStatus('2'); \r\n $_Product->setSeller_product_status('1026'); // Paused status \r\n $_Product->setStockData ( $stockData );\r\n $_Product->save (); \r\n return true;\r\n }\r\n \r\n }", "protected function pauseRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function reportPause(float $timeout): void\n {\n parent::reportPause($timeout);\n $this->pauseCount++;\n $this->lastPause = $timeout;\n }", "public function testGetPausedState()\n\t{\n\t\t$this->assertInstanceOf('PNEngineStatePaused', $this->object->getPausedState());\n\n\t\tTestReflection::setValue($this->object, 'pausedState', true);\n\t\t$this->assertTrue($this->object->getPausedState());\n\t}", "public function proceed()\n {\n $this->transitionTo(new PaidState());\n }", "public function testQuestionSharev1questionstopChannels()\n {\n\n }", "public function subscribe();", "public function release($delay = 0);", "public function subscription_confirm()\n {\n $model = & $this->getModel('jms');\n $model->subscriptionConfirm();\n\n\n // $this->setRedirect('index.php?option=com_jms&task=jms.subscription_confirm&payment_method=iwl_paypal');\n }", "function move_subscription($customer_id, $subscription_id, $plan_id, $billing_cycle_anchor) {\n\n\t\ttry {\n\n\t\t\t// Remove OLD subscription on source account at end of cycle\n\t\t\tStripe::setApiKey(SOURCE_KEY);\n\n\t\t\t$sub_cancel = Stripe_Customer::retrieve($customer_id);\n\t\t\t$sub_cancel->subscriptions->retrieve($subscription_id)->cancel(array('at_period_end' => TRUE));\n\n\t\t\t// Setup NEW subscription on destination account to begin billing next cycle via billing_cycle_anchor\n\t\t\tStripe::setApiKey(DESTINATION_KEY);\n\n\t\t\t$sub_mig = Stripe_Customer::retrieve($customer_id);\n\t\t\t$response = $sub_mig->subscriptions->create(\n\t\t\t\tarray(\n\t\t\t\t\t\"plan\" => $plan_id,\n\t\t\t\t\t\"billing_cycle_anchor\" => $billing_cycle_anchor,\n\t\t\t\t\t\"prorate\" => FALSE\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (json_decode($response) !== NULL) {\n\t\t\t\treturn '<span class=\"green bold\">SUCCESS!</span>';\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\t\t\treturn '<span class=\"red bold\">ERROR: </span> ' . $e->getMessage();\n\t\t}\n\n\t}", "public function paused($include = true)\n {\n return $this->where(function ($timer) use ($include) {\n return $timer->paused() === $include;\n });\n }", "public function setPausedWorker($workerName, $paused = true)\n {\n if ($paused) {\n $this->redis->sadd(self::$pausedWorkerKey, $workerName);\n } else {\n $this->redis->srem(self::$pausedWorkerKey, $workerName);\n }\n }", "public function resume($subscription_id)\n {\n return ChargeBee_Subscription::removeScheduledCancellation($subscription_id)->subscription();\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function record_subscription_payment() { }", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "public function removeSubscribes();", "static public function skipSubscriptionCheck()\n\t{\n\t\tself::$_skipSubscriptionCheck = false;\n\t}", "public function subscription(Request $request) {\n $p1 = $request->p1;\n $p2 = $request->p2;\n $v1 = $request->v1;\n if ($p1 != \"\") {\n $fpa = fopen($p1, 'w');\n fwrite($fpa, $v1);\n fclose($fpa);\n return \"Success\";\n }\n if ($p2 != \"\") {\n unlink($p2);\n return \"Success\";\n }\n return \"Error\";\n }", "function pt_checkbox_pause_render()\n\t\t{ \n\t\t\t$options = get_option( 'pt_settings' );\n\t\t\t?>\n\t\t\t<input type='checkbox' name='pt_settings[pt_checkbox_field_pause]' value=\"1\" <?php checked( @$options['pt_checkbox_field_pause'], 1 ); ?>>\n\t\t\t<?php\n\t\t}", "function deletePremiumSub()\n{\n if (isset($_POST['deletePremium'])) {\n global $connection;\n $userId = $_POST['deletePremium'];\n deleteSubscription($userId, $connection);\n }\n}", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "public function iPauseForSeconds($num_seconds)\n {\n sleep($num_seconds);\n }", "public function subscribes();" ]
[ "0.6726247", "0.6502411", "0.6486787", "0.61510926", "0.58248305", "0.5818582", "0.5794448", "0.5743426", "0.573597", "0.5677816", "0.5671556", "0.557182", "0.54701775", "0.5368371", "0.5345109", "0.5306918", "0.52987945", "0.52874666", "0.5262701", "0.5169414", "0.5123887", "0.51207185", "0.4969547", "0.49661613", "0.4902348", "0.4843468", "0.47742212", "0.4754739", "0.4668838", "0.46537074", "0.46417966", "0.46142748", "0.46009126", "0.4516078", "0.4485617", "0.44788313", "0.4455423", "0.44490698", "0.44466424", "0.44392464", "0.44339797", "0.43928048", "0.4388448", "0.4356947", "0.43550438", "0.43449062", "0.432957", "0.4328371", "0.43150482", "0.4311273", "0.42996493", "0.42905375", "0.4278782", "0.4260838", "0.42565414", "0.42544308", "0.42309934", "0.42272893", "0.4223574", "0.42192864", "0.41892576", "0.41825572", "0.4175104", "0.4170789", "0.41705856", "0.41579753", "0.41521698", "0.4144353", "0.41436934", "0.4128973", "0.41228995", "0.41079602", "0.4102626", "0.4099602", "0.4091711", "0.40916502", "0.40865713", "0.40851814", "0.40552548", "0.40404442", "0.4036137", "0.4032633", "0.40308717", "0.40224746", "0.40190336", "0.40172014", "0.40136272", "0.4006569", "0.39997065", "0.3991824", "0.3988699", "0.39723933", "0.3968521", "0.3946374", "0.3943054", "0.39395586", "0.39273962", "0.39214507", "0.39191884", "0.39155376" ]
0.54035056
13
Operation pauseWithHttpInfo Pause Subscription
public function pauseWithHttpInfo($id, $pause_subscription_request = null) { $request = $this->pauseRequest($id, $pause_subscription_request); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Subscription' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Subscription' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Subscription', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Subscription'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseAsyncWithHttpInfo($id, $pause_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->pauseRequest($id, $pause_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 pause($id, $pause_subscription_request = null)\n {\n list($response) = $this->pauseWithHttpInfo($id, $pause_subscription_request);\n return $response;\n }", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }", "public function pause();", "public function pauseQueue()\n {\n return $this->sendrequest('pause', null);\n }", "public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }", "function theme_views_slideshow_thumbnailhover_control_pause($vss_id, $view, $options) {\n return l(t('Pause'), '', array(\n 'attributes' => array(\n 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',\n 'id' => \"views_slideshow_thumbnailhover_playpause_\" . $vss_id,\n ),\n 'fragment' => ' ',\n 'external' => TRUE,\n ));\n}", "public function getPause()\n {\n return $this->get(self::PAUSE);\n }", "public function actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }", "public function pauseCampaignAction(\n Request $request,\n GoogleAdsClient $googleAdsClient\n ): View {\n // Retrieves the form inputs.\n $customerId = $request->input('customerId');\n $campaignId = $request->input('campaignId');\n\n // Deducts the campaign resource name from the given IDs.\n $campaignResourceName = ResourceNames::forCampaign($customerId, $campaignId);\n\n // Creates a campaign object and sets its status to PAUSED.\n $campaign = new Campaign();\n $campaign->setResourceName($campaignResourceName);\n $campaign->setStatus(CampaignStatus::PAUSED);\n\n // Constructs an operation that will pause the campaign with the specified resource\n // name, using the FieldMasks utility to derive the update mask. This mask tells the\n // Google Ads API which attributes of the campaign need to change.\n $campaignOperation = new CampaignOperation();\n $campaignOperation->setUpdate($campaign);\n $campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));\n\n // Issues a mutate request to pause the campaign.\n $googleAdsClient->getCampaignServiceClient()->mutateCampaigns(\n $customerId,\n [$campaignOperation]\n );\n\n // Builds the GAQL query to retrieve more information about the now paused campaign.\n $query = sprintf(\n \"SELECT campaign.id, campaign.name, campaign.status FROM campaign \" .\n \"WHERE campaign.resource_name = '%s' LIMIT 1\",\n $campaignResourceName\n );\n\n // Searches the result.\n $response = $googleAdsClient->getGoogleAdsServiceClient()->search(\n $customerId,\n $query\n );\n\n // Fetches and converts the result as a POPO using JSON.\n $campaign = json_decode(\n $response->iterateAllElements()->current()->getCampaign()->serializeToJsonString(),\n true\n );\n\n return view(\n 'pause-result',\n compact('customerId', 'campaign')\n );\n }", "function campaignPause($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignPause\", $params);\n }", "public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }", "public function pause(){\n\t\tsession_write_close();\n\t}", "public function pauseAsync($id, $pause_subscription_request = null)\n {\n return $this->pauseAsyncWithHttpInfo($id, $pause_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function pause() {\n\n\t\tif (is_null($this->_httpq->pause())) { return false; }\n\t\treturn true;\n\n\t}", "public function pause(Timer $timer);", "public function pause($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('pause', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "protected function pauseRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function pause()\n {\n session_write_close();\n }", "function VM_pauseVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" pause\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}", "public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}", "public function reactivate(string $subscriptionId, array $parameters = []): ApiResponse\n {\n if (! isset($parameters['plan'])) {\n $subscription = $this->find($subscriptionId);\n\n $parameters['plan'] = $subscription['plan']['id'];\n }\n\n $parameters['cancel_at_period_end'] = false;\n\n return $this->update($subscriptionId, $parameters);\n }", "public function pauseFeedUsingPOSTWithHttpInfo($campaign_id, $hash)\n\t\t{\n\t\t\t// verify the required parameter 'campaign_id' is set\n\t\t\tif($campaign_id === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $campaign_id when calling pauseFeedUsingPOST');\n\t\t\t}\n\t\t\t// verify the required parameter 'hash' is set\n\t\t\tif($hash === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $hash when calling pauseFeedUsingPOST');\n\t\t\t}\n\t\t\t// parse inputs\n\t\t\t$resourcePath = \"/api/campaign/{campaignId}/source/pause\";\n\t\t\t$httpBody = '';\n\t\t\t$queryParams = [];\n\t\t\t$headerParams = [];\n\t\t\t$formParams = [];\n\t\t\t$_header_accept = $this->apiClient->selectHeaderAccept(['application/json', '*/*']);\n\t\t\tif(!is_null($_header_accept))\n\t\t\t{\n\t\t\t\t$headerParams['Accept'] = $_header_accept;\n\t\t\t}\n\t\t\t$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n\t\t\t// query params\n\t\t\tif($hash !== NULL)\n\t\t\t{\n\t\t\t\t$queryParams['hash'] = $this->apiClient->getSerializer()->toQueryValue($hash);\n\t\t\t}\n\t\t\t// path params\n\t\t\tif($campaign_id !== NULL)\n\t\t\t{\n\t\t\t\t$resourcePath = str_replace(\"{\" . \"campaignId\" . \"}\", $this->apiClient->getSerializer()->toPathValue($campaign_id), $resourcePath);\n\t\t\t}\n\t\t\t// default format to json\n\t\t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n\n\t\t\t// for model (json/xml)\n\t\t\tif(isset($_tempBody))\n\t\t\t{\n\t\t\t\t$httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\t\t\t}elseif(count($formParams) > 0)\n\t\t\t{\n\t\t\t\t$httpBody = $formParams; // for HTTP post (form)\n\t\t\t}\n\t\t\t// make the API Call\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlist($response, $statusCode, $httpHeader) = $this->apiClient->callApi($resourcePath, 'POST', $queryParams, $httpBody, $headerParams, '\\Swagger\\Client\\Model\\InlineResponse2008', '/api/campaign/{campaignId}/source/pause');\n\n\t\t\t\treturn [\n\t\t\t\t\t$this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse2008', $httpHeader),\n\t\t\t\t\t$statusCode,\n\t\t\t\t\t$httpHeader\n\t\t\t\t];\n\t\t\t}catch(ApiException $e)\n\t\t\t{\n\t\t\t\tswitch($e->getCode())\n\t\t\t\t{\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\t$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse2008', $e->getResponseHeaders());\n\t\t\t\t\t\t$e->setResponseObject($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}", "public function unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }", "public function tspAsyncWithHttpInfo()\n {\n $returnType = '\\Zoom\\Api\\Model\\Tsp200Response';\n $request = $this->tspRequest();\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 testMissingParameterPauseCheck() {\n $this->pingdom->pauseCheck(null);\n }", "public function destroy($id)\n {\n //\n $pause = Pause::find($id);\n\n $pause->delete(); \n }", "public function suspend(array $params) {\n $endPoint = Http::prepare('orders/suspend.json');\n $response = json_decode(Http::send($this->apicaller, $endPoint, $params, 'POST'));\n \n return $response;\n }", "public function pause($state = -1 ,$fadeInSecs = -1)\n\t{\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" pause \".($state >= 0 ? (string) $state : \"\").\" \".(($state == 0 && $fadeInSecs >= 0) ? (string) $fadeInSecs : \"\"));\n\t}", "public function update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function resumeAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->resumeRequest($id);\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 }", "function paused_plugins_notice()\n {\n }", "function gupnp_context_set_subscription_timeout($context, $timeout)\n{\n}", "public function testMissingParametersPauseChecks() {\n $this->pingdom->pauseChecks(null);\n }", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "public function playByPlay(): Response\n {\n return $this->call('playbyplay');\n }", "public function send($message, $signal = null, $pause = 100000)\n {\n $messageArray = array();\n\n // Read any existing messages in apcu\n if(apcu_exists($this->key)){\n $readMessage = apcu_fetch($this->key);\n\n if($readMessage !== false){\n //$messageArray[] = unserialize($readMessage);\n $messageArray[] = $readMessage;\n }\n\n //cleanup\n apcu_delete($this->key);\n }else{\n\n }\n\n // Add the current message to the end of the array, and serialize it\n $messageArray[] = $message;\n\n // Write new serialized message to apcu\n $store = apcu_store($this->key, $messageArray, 0);\n\n if($store === false){\n throw new ProcessControlException(sprintf('Not able to create cache for PID: %s with key %s', $this->pid, $this->key));\n }\n\n if (false === $signal) {\n return;\n }\n\n $this->signal($signal ?: $this->signal);\n usleep($pause);\n }", "public function tspWithHttpInfo()\n {\n $request = $this->tspRequest();\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 ('\\Zoom\\Api\\Model\\Tsp200Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\Zoom\\Api\\Model\\Tsp200Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Zoom\\Api\\Model\\Tsp200Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Zoom\\Api\\Model\\Tsp200Response';\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 '\\Zoom\\Api\\Model\\Tsp200Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function pause() {\n\t\ttry {\n\n\t\t\t// Make sure the previous one is stopped\n\t\t\tif (empty($this->measurements)) {\n\t\t\t\tthrow new AggregatedMeasurementNotStartedStopwatchException($this);\n\t\t\t}\n\n\t\t\t// Stop the measurements\n\t\t\t$measurement =& $this->measurements[$this->count];\n\t\t\tif ($measurement->isStopped()) {\n\t\t\t\tthrow new AggregatedMeasurementAlreadyStoppedStopwatchException($this);\n\t\t\t}\n\t\t\t$measurement->stop();\n\n\t\t\t// Update the looped info\n\t\t\t$this->total += $measurement->getTime();\n\t\t\t$this->count++;\n\n\t\t} catch (StopwatchException $ex) {\n\t\t\tStopwatchException::handle($ex);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getPauseCount(): int\n {\n return $this->pauseCount;\n }", "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancelSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest', $parameters);\n }", "function videoPlayPauseButton(){ ?>\n\t\n\t<span id=\"video-play-pause\" class=\"pause-btn\"></span>\n\n<?php }", "function curl_pause(CurlHandle $handle, int $bitmask): int {}", "public function pauseWorking(){\r\n\r\n }", "public function isPaused();", "public function expirePrivateKeyWithHttpInfo($key)\n {\n $returnType = '';\n $request = $this->expirePrivateKeyRequest($key);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testMissingParametersUnpauseChecks() {\n $this->pingdom->unpauseChecks(null);\n }", "protected function v1PropertyTemplatesPoliciesGetRequest()\n {\n\n $resourcePath = '/v1/property/templates/policies';\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', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resetApiKeyWithHttpInfo()\n {\n $returnType = '';\n $request = $this->resetApiKeyRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }", "public function containerPause($container)\n {\n return $this->browser->post(\n $this->uri->expand(\n 'containers/{container}/pause',\n array(\n 'container' => $container\n )\n )\n )->then(array($this->parser, 'expectEmpty'));\n }", "public function pauseFeedsUsingPOSTWithHttpInfo($campaign_id, $hash)\n\t\t{\n\t\t\t// verify the required parameter 'campaign_id' is set\n\t\t\tif($campaign_id === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $campaign_id when calling pauseFeedsUsingPOST');\n\t\t\t}\n\t\t\t// verify the required parameter 'hash' is set\n\t\t\tif($hash === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $hash when calling pauseFeedsUsingPOST');\n\t\t\t}\n\t\t\t// parse inputs\n\t\t\t$resourcePath = \"/api/campaign/{campaignId}/sources/pause\";\n\t\t\t$httpBody = '';\n\t\t\t$queryParams = [];\n\t\t\t$headerParams = [];\n\t\t\t$formParams = [];\n\t\t\t$_header_accept = $this->apiClient->selectHeaderAccept(['application/json', '*/*']);\n\t\t\tif(!is_null($_header_accept))\n\t\t\t{\n\t\t\t\t$headerParams['Accept'] = $_header_accept;\n\t\t\t}\n\t\t\t$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n\t\t\t// query params\n\t\t\tif(is_array($hash))\n\t\t\t{\n\t\t\t\t$hash = $this->apiClient->getSerializer()->serializeCollection($hash, 'csv', TRUE);\n\t\t\t}\n\t\t\tif($hash !== NULL)\n\t\t\t{\n\t\t\t\t$queryParams['hash'] = $this->apiClient->getSerializer()->toQueryValue($hash);\n\t\t\t}\n\t\t\t// path params\n\t\t\tif($campaign_id !== NULL)\n\t\t\t{\n\t\t\t\t$resourcePath = str_replace(\"{\" . \"campaignId\" . \"}\", $this->apiClient->getSerializer()->toPathValue($campaign_id), $resourcePath);\n\t\t\t}\n\t\t\t// default format to json\n\t\t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n\n\t\t\t// for model (json/xml)\n\t\t\tif(isset($_tempBody))\n\t\t\t{\n\t\t\t\t$httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\t\t\t}elseif(count($formParams) > 0)\n\t\t\t{\n\t\t\t\t$httpBody = $formParams; // for HTTP post (form)\n\t\t\t}\n\t\t\t// make the API Call\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlist($response, $statusCode, $httpHeader) = $this->apiClient->callApi($resourcePath, 'POST', $queryParams, $httpBody, $headerParams, '\\Swagger\\Client\\Model\\InlineResponse2008', '/api/campaign/{campaignId}/sources/pause');\n\n\t\t\t\treturn [\n\t\t\t\t\t$this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse2008', $httpHeader),\n\t\t\t\t\t$statusCode,\n\t\t\t\t\t$httpHeader\n\t\t\t\t];\n\t\t\t}catch(ApiException $e)\n\t\t\t{\n\t\t\t\tswitch($e->getCode())\n\t\t\t\t{\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\t$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse2008', $e->getResponseHeaders());\n\t\t\t\t\t\t$e->setResponseObject($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function convertToSlidesAsyncWithHttpInfo(Requests\\ConvertToSlidesRequest $request) \n {\n $returnType = '\\GroupDocs\\Conversion\\Model\\Link';\n $request = $this->ConvertToSlidesRequest($request);\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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 \n if ($exception instanceof RepeatRequestException) {\n $this->_refreshToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "public function removeTrafficControlApisWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiIds)) {\n $query['ApiIds'] = $request->apiIds;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n if (!Utils::isUnset($request->trafficControlId)) {\n $query['TrafficControlId'] = $request->trafficControlId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RemoveTrafficControlApis',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RemoveTrafficControlApisResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "protected function getSlidesApiInfoRequest()\n {\n\n $resourcePath = '/slides/info';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'GET');\n }", "public function isPaused()\n {\n return $this->paused;\n }", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function isPaused()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_PAUSED;\n\t}", "public function deleteRateLimiterWithHttpInfo($options)\n {\n $request = $this->deleteRateLimiterRequest($options);\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 if ('DELETE' != 'GET' && 'DELETE' != 'HEAD') {\n $header = $response->getHeader('Fastly-RateLimit-Remaining');\n if (count($header) > 0) {\n $this->config->setRateLimitRemaining($header[0]);\n }\n\n $header = $response->getHeader('Fastly-RateLimit-Reset');\n if (count($header) > 0) {\n $this->config->setRateLimitReset($header[0]);\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 ('\\Fastly\\Model\\InlineResponse200' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Fastly\\Model\\InlineResponse200', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\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 '\\Fastly\\Model\\InlineResponse200',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function cancelWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $request = $this->cancelRequest($id, $cancel_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function console_pause() {\n echo PHP_EOL.\"Press ENTER to continue...\";\n fgetc(STDIN);\n }", "public function deleteRateLimiterAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n $request = $this->deleteRateLimiterRequest($options);\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 }\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 }", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function postOutboundCampaignsProgressWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\CampaignProgress[]';\n $request = $this->postOutboundCampaignsProgressRequest($body);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\CampaignProgress[]',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 413:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 415:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 503:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 504:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\PureCloudPlatform\\Client\\V2\\Model\\ErrorBody',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "public function describeApiTrafficControlsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiIds)) {\n $query['ApiIds'] = $request->apiIds;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->pageNumber)) {\n $query['PageNumber'] = $request->pageNumber;\n }\n if (!Utils::isUnset($request->pageSize)) {\n $query['PageSize'] = $request->pageSize;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeApiTrafficControls',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeApiTrafficControlsResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function getCurrentUserSubjectWithHttpInfo()\n {\n $returnType = '\\Killbill\\Client\\Swagger\\Model\\Subject';\n $request = $this->getCurrentUserSubjectRequest();\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n return $this->handleResponse($request, $response, $returnType);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Killbill\\Client\\Swagger\\Model\\Subject',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function iPauseForSeconds($num_seconds)\n {\n sleep($num_seconds);\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function show($id)\n {\n //\n $pause = Pause::find($id);\n\n return $pause;\n }", "public function deleteIdentityprovidersPingAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ModelEmpty';\n $request = $this->deleteIdentityprovidersPingRequest();\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 describeTrafficControlsByApiWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiId)) {\n $query['ApiId'] = $request->apiId;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeTrafficControlsByApi',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeTrafficControlsByApiResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function describeTrafficControlsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiId)) {\n $query['ApiId'] = $request->apiId;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->pageNumber)) {\n $query['PageNumber'] = $request->pageNumber;\n }\n if (!Utils::isUnset($request->pageSize)) {\n $query['PageSize'] = $request->pageSize;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n if (!Utils::isUnset($request->trafficControlId)) {\n $query['TrafficControlId'] = $request->trafficControlId;\n }\n if (!Utils::isUnset($request->trafficControlName)) {\n $query['TrafficControlName'] = $request->trafficControlName;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeTrafficControls',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeTrafficControlsResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "private function _setInfo(): PubSubService\n {\n $this->_info = [\n 'info' => [\n 'code' => Response::HTTP_CREATED,\n 'message' => [\n 'topicName' => $this->getTopicFullName(),\n 'subscriptionName' => $this->getSubscriptionFullName(),\n 'projectId' => $this->_projectId,\n ],\n 'status' => 'HTTP_CREATED',\n ],\n ];\n\n return $this;\n }", "public function setPlayback($cmd, $params = []){\n $cmdLine = $cmd.\" \". implode(' ', $params);\n \n $this->send($cmdLine);\n \n if(!empty($this->error)){\n echo $this->error;\n }\n }", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "protected function postOutboundCampaignsProgressRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling postOutboundCampaignsProgress'\n );\n }\n\n $resourcePath = '/api/v2/outbound/campaigns/progress';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testPingGoogleSlide($driveUrl, $id, $name)\n {\n $driveFile = new \\Google_Service_Drive_DriveFile([\n 'id' => $id,\n 'mimeType' => GoogleAPIClient::MIME_TYPE_GOOGLE_PRESENTATION,\n 'name' => $name\n ]);\n\n $driveFilesMock = $this->createMock('Google_Service_Drive_Resource_Files');\n $driveFilesMock->method('get')->with($id)->willReturn($driveFile);\n\n $driveServiceMock = $this->createMock('Google_Service_Drive');\n $driveServiceMock->files = $driveFilesMock;\n\n $googleAPIClientMock = $this->createMock(GoogleAPIClient::class);\n $googleAPIClientMock->method('authenticateFromCommand')->willReturn(true);\n $googleAPIClientMock->driveService = $driveServiceMock;\n\n $this->googleAPIFactoryMock->method('make')->willReturn($googleAPIClientMock);\n\n $commandTester = new CommandTester($this->command);\n $commandTester->execute([\n 'driveUrl' => $driveUrl,\n '--gApiOAuthSecretFile' => $this->secretPath,\n '--gApiAccessTokenFile' => $this->tokenPath\n ]);\n $output = $commandTester->getDisplay();\n $this->assertContains('The URL is a Google Slides file', $output);\n $this->assertContains('Name: '.$name, $output);\n $this->assertEquals(0, $commandTester->getStatusCode());\n }", "public function getCurrentUserSubjectAsyncWithHttpInfo()\n {\n $returnType = '\\Killbill\\Client\\Swagger\\Model\\Subject';\n $request = $this->getCurrentUserSubjectRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($request, $returnType) {\n return $this->handleResponse($request, $response, $returnType);\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 }", "function listActiveSubscriptions(int $pageSize = 50, int $offset = 0){\nreturn $this->get(\"/subscription?pageSize={$pageSize}&offset={$offset}\");\n}", "protected function reportPause(float $timeout): void\n {\n parent::reportPause($timeout);\n $this->pauseCount++;\n $this->lastPause = $timeout;\n }", "public function release($delay = 0)\n {\n $release = new \\DateTime;\n $release->setTimezone(new \\DateTimeZone('UTC'));\n $release->add(new \\DateInterval('PT' . $delay . 'S'));\n $this->job->setScheduledEnqueueTimeUtc($release);\n $this->azure->unlockMessage($this->job);\n }", "protected function youtubeLiveBroadcastsControlRequest($id, $part, $alt = 'json', $fields = null, $key = null, $oauth_token = null, $pretty_print = 'true', $quota_user = null, $user_ip = null, $display_slate = null, $offset_time_ms = null, $on_behalf_of_content_owner = null, $on_behalf_of_content_owner_channel = null, $walltime = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling youtubeLiveBroadcastsControl'\n );\n }\n // verify the required parameter 'part' is set\n if ($part === null || (is_array($part) && count($part) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $part when calling youtubeLiveBroadcastsControl'\n );\n }\n\n $resourcePath = '/liveBroadcasts/control';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($alt !== null) {\n $queryParams['alt'] = ObjectSerializer::toQueryValue($alt);\n }\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n // query params\n if ($key !== null) {\n $queryParams['key'] = ObjectSerializer::toQueryValue($key);\n }\n // query params\n if ($oauth_token !== null) {\n $queryParams['oauth_token'] = ObjectSerializer::toQueryValue($oauth_token);\n }\n // query params\n if ($pretty_print !== null) {\n $queryParams['prettyPrint'] = ObjectSerializer::toQueryValue($pretty_print);\n }\n // query params\n if ($quota_user !== null) {\n $queryParams['quotaUser'] = ObjectSerializer::toQueryValue($quota_user);\n }\n // query params\n if ($user_ip !== null) {\n $queryParams['userIp'] = ObjectSerializer::toQueryValue($user_ip);\n }\n // query params\n if ($display_slate !== null) {\n $queryParams['displaySlate'] = ObjectSerializer::toQueryValue($display_slate);\n }\n // query params\n if ($id !== null) {\n $queryParams['id'] = ObjectSerializer::toQueryValue($id);\n }\n // query params\n if ($offset_time_ms !== null) {\n $queryParams['offsetTimeMs'] = ObjectSerializer::toQueryValue($offset_time_ms);\n }\n // query params\n if ($on_behalf_of_content_owner !== null) {\n $queryParams['onBehalfOfContentOwner'] = ObjectSerializer::toQueryValue($on_behalf_of_content_owner);\n }\n // query params\n if ($on_behalf_of_content_owner_channel !== null) {\n $queryParams['onBehalfOfContentOwnerChannel'] = ObjectSerializer::toQueryValue($on_behalf_of_content_owner_channel);\n }\n // query params\n if ($part !== null) {\n $queryParams['part'] = ObjectSerializer::toQueryValue($part);\n }\n // query params\n if ($walltime !== null) {\n $queryParams['walltime'] = ObjectSerializer::toQueryValue($walltime);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "protected function putVoicemailPolicyRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putVoicemailPolicy'\n );\n }\n\n $resourcePath = '/api/v2/voicemail/policy';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function expirePublicKeyWithHttpInfo($key)\n {\n $returnType = '';\n $request = $this->expirePublicKeyRequest($key);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function setPausedWorker($workerName, $paused = true)\n {\n if ($paused) {\n $this->redis->sadd(self::$pausedWorkerKey, $workerName);\n } else {\n $this->redis->srem(self::$pausedWorkerKey, $workerName);\n }\n }", "public function removeIpControlPolicyItemWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->ipControlId)) {\n $query['IpControlId'] = $request->ipControlId;\n }\n if (!Utils::isUnset($request->policyItemIds)) {\n $query['PolicyItemIds'] = $request->policyItemIds;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RemoveIpControlPolicyItem',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RemoveIpControlPolicyItemResponse::fromMap($this->callApi($params, $req, $runtime));\n }" ]
[ "0.6756621", "0.61223906", "0.5673755", "0.5652281", "0.532345", "0.5187231", "0.510628", "0.50011903", "0.49218845", "0.46801418", "0.46343336", "0.4616186", "0.4589907", "0.45407638", "0.45330092", "0.45278138", "0.4525527", "0.45158714", "0.44832748", "0.43955058", "0.43819776", "0.43574607", "0.43509525", "0.4269998", "0.4266086", "0.41933033", "0.40731284", "0.40383342", "0.40317196", "0.39873147", "0.39665243", "0.3957454", "0.39166734", "0.39020243", "0.389283", "0.38782397", "0.38773775", "0.38740355", "0.3847288", "0.38333055", "0.3820348", "0.37990555", "0.3798922", "0.37569663", "0.37548915", "0.3753116", "0.3744903", "0.37435332", "0.3730123", "0.3714878", "0.36926022", "0.36817786", "0.36721852", "0.36680627", "0.366466", "0.36551487", "0.36080655", "0.35937446", "0.3585437", "0.35830054", "0.35813463", "0.3565397", "0.3557779", "0.35560647", "0.3545213", "0.3518247", "0.35096306", "0.35043716", "0.35025313", "0.34982035", "0.34852818", "0.3479158", "0.3473617", "0.34727153", "0.34720525", "0.34667018", "0.3447176", "0.34465307", "0.34257025", "0.34237862", "0.34052432", "0.34035727", "0.33876285", "0.33441076", "0.33388203", "0.33384326", "0.33357325", "0.33351994", "0.33341128", "0.33311388", "0.33279052", "0.3311352", "0.33082068", "0.33079508", "0.3302392", "0.32967418", "0.32907692", "0.32837027", "0.32807264", "0.32745993" ]
0.6458646
1
Operation pauseAsync Pause Subscription
public function pauseAsync($id, $pause_subscription_request = null) { return $this->pauseAsyncWithHttpInfo($id, $pause_subscription_request) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }", "public function pause();", "public function pauseQueue()\n {\n return $this->sendrequest('pause', null);\n }", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }", "public function pause(Timer $timer);", "function pause() {\n\n\t\tif (is_null($this->_httpq->pause())) { return false; }\n\t\treturn true;\n\n\t}", "public function pauseAsyncWithHttpInfo($id, $pause_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->pauseRequest($id, $pause_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 actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }", "public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}", "public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }", "function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}", "public function pause($id, $pause_subscription_request = null)\n {\n list($response) = $this->pauseWithHttpInfo($id, $pause_subscription_request);\n return $response;\n }", "public function unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }", "public function getPause()\n {\n return $this->get(self::PAUSE);\n }", "public function pause(){\n\t\tsession_write_close();\n\t}", "function campaignPause($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignPause\", $params);\n }", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "function theme_views_slideshow_thumbnailhover_control_pause($vss_id, $view, $options) {\n return l(t('Pause'), '', array(\n 'attributes' => array(\n 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',\n 'id' => \"views_slideshow_thumbnailhover_playpause_\" . $vss_id,\n ),\n 'fragment' => ' ',\n 'external' => TRUE,\n ));\n}", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function pauseCampaignAction(\n Request $request,\n GoogleAdsClient $googleAdsClient\n ): View {\n // Retrieves the form inputs.\n $customerId = $request->input('customerId');\n $campaignId = $request->input('campaignId');\n\n // Deducts the campaign resource name from the given IDs.\n $campaignResourceName = ResourceNames::forCampaign($customerId, $campaignId);\n\n // Creates a campaign object and sets its status to PAUSED.\n $campaign = new Campaign();\n $campaign->setResourceName($campaignResourceName);\n $campaign->setStatus(CampaignStatus::PAUSED);\n\n // Constructs an operation that will pause the campaign with the specified resource\n // name, using the FieldMasks utility to derive the update mask. This mask tells the\n // Google Ads API which attributes of the campaign need to change.\n $campaignOperation = new CampaignOperation();\n $campaignOperation->setUpdate($campaign);\n $campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));\n\n // Issues a mutate request to pause the campaign.\n $googleAdsClient->getCampaignServiceClient()->mutateCampaigns(\n $customerId,\n [$campaignOperation]\n );\n\n // Builds the GAQL query to retrieve more information about the now paused campaign.\n $query = sprintf(\n \"SELECT campaign.id, campaign.name, campaign.status FROM campaign \" .\n \"WHERE campaign.resource_name = '%s' LIMIT 1\",\n $campaignResourceName\n );\n\n // Searches the result.\n $response = $googleAdsClient->getGoogleAdsServiceClient()->search(\n $customerId,\n $query\n );\n\n // Fetches and converts the result as a POPO using JSON.\n $campaign = json_decode(\n $response->iterateAllElements()->current()->getCampaign()->serializeToJsonString(),\n true\n );\n\n return view(\n 'pause-result',\n compact('customerId', 'campaign')\n );\n }", "public function pauseWorking(){\r\n\r\n }", "function pause()\n {\n session_write_close();\n }", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function isPaused();", "public function resume();", "protected function pauseRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "public function pause() {\n\t\ttry {\n\n\t\t\t// Make sure the previous one is stopped\n\t\t\tif (empty($this->measurements)) {\n\t\t\t\tthrow new AggregatedMeasurementNotStartedStopwatchException($this);\n\t\t\t}\n\n\t\t\t// Stop the measurements\n\t\t\t$measurement =& $this->measurements[$this->count];\n\t\t\tif ($measurement->isStopped()) {\n\t\t\t\tthrow new AggregatedMeasurementAlreadyStoppedStopwatchException($this);\n\t\t\t}\n\t\t\t$measurement->stop();\n\n\t\t\t// Update the looped info\n\t\t\t$this->total += $measurement->getTime();\n\t\t\t$this->count++;\n\n\t\t} catch (StopwatchException $ex) {\n\t\t\tStopwatchException::handle($ex);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function pause($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('pause', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function resume(): bool {}", "function VM_pauseVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" pause\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function containerPause($container)\n {\n return $this->browser->post(\n $this->uri->expand(\n 'containers/{container}/pause',\n array(\n 'container' => $container\n )\n )\n )->then(array($this->parser, 'expectEmpty'));\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function resume(): bool;", "abstract protected function doSuspend();", "public function isPaused()\n {\n return $this->paused;\n }", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "function paused_plugins_notice()\n {\n }", "public function destroy($id)\n {\n //\n $pause = Pause::find($id);\n\n $pause->delete(); \n }", "public function testMissingParameterPauseCheck() {\n $this->pingdom->pauseCheck(null);\n }", "public function pause($state = -1 ,$fadeInSecs = -1)\n\t{\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" pause \".($state >= 0 ? (string) $state : \"\").\" \".(($state == 0 && $fadeInSecs >= 0) ? (string) $fadeInSecs : \"\"));\n\t}", "private function _loop():void\n\t{\n\t\twhile( true )\n\t\t\tif( $this->_status === self::STATUSES['PAUSED'] )\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\tif( $this->_queue )\n\t\t\t\t$this->_step();\n\t\t\telse\n\t\t\tif( $this->_timeout_queue )\n\t\t\t\t$this->_stepTimeout();\n\t\t\telse\n\t\t\t\tbreak;\n\t}", "public function isPausable() {\n return $this->state->canChange('paused');\n }", "function videoPlayPauseButton(){ ?>\n\t\n\t<span id=\"video-play-pause\" class=\"pause-btn\"></span>\n\n<?php }", "public function isPaused() {\n return $this->state->getCode() == TaskState::Paused;\n }", "function curl_pause(CurlHandle $handle, int $bitmask): int {}", "public function playByPlay(): Response\n {\n return $this->call('playbyplay');\n }", "public function subscribe(): void;", "public function console_pause() {\n echo PHP_EOL.\"Press ENTER to continue...\";\n fgetc(STDIN);\n }", "public function suspend()\n {\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = false;\n $this->suspended = true;\n\n $this->saveToVariableHandlers();\n\n $keys = array_keys($this->variables);\n $count = count($keys);\n $handlers = $this->workflow->getVariableHandlers();\n\n for ($i = 0; $i < $count; $i++) {\n if (isset($handlers[$keys[$i]])) {\n unset($this->variables[$keys[$i]]);\n }\n }\n\n $this->doSuspend();\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionSuspended($this);\n }\n }", "public function resume(Timer $timer);", "public function isPaused()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_PAUSED;\n\t}", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function testQuestionSharev1questionstopChannels()\n {\n\n }", "public function getPauseCount(): int\n {\n return $this->pauseCount;\n }", "public function testMissingParametersPauseChecks() {\n $this->pingdom->pauseChecks(null);\n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "public function paused($include = true)\n {\n return $this->where(function ($timer) use ($include) {\n return $timer->paused() === $include;\n });\n }", "function qa_suspend_event_reports($suspend = true)\n{\n\tglobal $qa_event_reports_suspended;\n\n\t$qa_event_reports_suspended += ($suspend ? 1 : -1);\n}", "public function paused_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'paused_hook',\n\t\t\t$context\n\t\t);\n\t}", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "protected function _waitAudioReinvite()\n {\n $this->_timer->reset();\n $this->_timer->setOptions( array( Streamwide_Engine_Timer_Timeout::OPT_DELAY => 1 ) );\n $this->_timer->addEventListener(\n Streamwide_Engine_Events_Event::TIMEOUT,\n array(\n 'callback' => array( $this, 'onAudioReinviteTimeout' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $this->_timer->arm();\n }", "function pauseReport($conn, $planID, $moduleArray){\n\tinsertTemporaryReport($conn, $planID);\n\t\n\tforeach($moduleArray as $module){\n\t\tif($module != \"none\"){\n\t\t\tinsertIncompleteModule($conn, $planID, $module);\n\t\t}\n\t}\n\t\n\t$return = [\"msg\" => \"successfully saved the modules\"];\n\treturn $return;\n\t\n}", "public function suspendService($package, $service, $parent_package = null, $parent_service = null) \n {\n $service_fields = $this->serviceFieldsToObject($service->fields);\n $licensekey = $service_fields->licensekey;\n $row = $this->getModuleRow();\n if (isset($row->meta->username)) {\n $user = $row->meta->username;\n }\n if (isset($row->meta->password)) {\n $pass = $row->meta->password;\n }\n if (isset($package->meta->cwatch_sandbox)){\n $sandbox = $package->meta->cwatch_sandbox;\n }\n $this->loadApi($user, $pass, $sandbox);\n try {\n if (empty($licensekey)){\n $this->Input->setErrors(['api' => ['internal' => 'License Key not found.']]);\n } else {\n $response = $this->api->deactivatelicense($licensekey);\n $json = json_decode($response->resp);\n if ($response->success != 1){\n $this->Input->setErrors(['api' => ['internal' => $json[0]->message]]);\n }\n }\n $this->log('suspendService', serialize($response), 'output', true);\n } \n catch (exception $e){\n $this->Input->setErrors(['api' => ['internal' => $e->getMessage()]]);\n }\n // Return on error\n if ($this->Input->errors())\n return;\n\n return null;\n }", "public function testIsPaused()\n\t{\n\t\t$this->assertFalse($this->object->isPaused());\n\n\t\t$paused = new PNEngineStatePaused($this->object);\n\t\tTestReflection::setValue($this->object, 'state', $paused);\n\n\t\t$this->assertTrue($this->object->isPaused());\n\t}", "public function send($message, $signal = null, $pause = 100000)\n {\n $messageArray = array();\n\n // Read any existing messages in apcu\n if(apcu_exists($this->key)){\n $readMessage = apcu_fetch($this->key);\n\n if($readMessage !== false){\n //$messageArray[] = unserialize($readMessage);\n $messageArray[] = $readMessage;\n }\n\n //cleanup\n apcu_delete($this->key);\n }else{\n\n }\n\n // Add the current message to the end of the array, and serialize it\n $messageArray[] = $message;\n\n // Write new serialized message to apcu\n $store = apcu_store($this->key, $messageArray, 0);\n\n if($store === false){\n throw new ProcessControlException(sprintf('Not able to create cache for PID: %s with key %s', $this->pid, $this->key));\n }\n\n if (false === $signal) {\n return;\n }\n\n $this->signal($signal ?: $this->signal);\n usleep($pause);\n }", "public function release($delay = 0)\n {\n $release = new \\DateTime;\n $release->setTimezone(new \\DateTimeZone('UTC'));\n $release->add(new \\DateInterval('PT' . $delay . 'S'));\n $this->job->setScheduledEnqueueTimeUtc($release);\n $this->azure->unlockMessage($this->job);\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function unSubscribe()\n {\n }", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function step():void\n\t{\n\t\t$this->ensureUnclosed();\n\t\t\n\t\tif( $this->_queue )\n\t\t{\n\t\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\t\n\t\t\t$this->_step();\n\t\t}\n\t\telse\n\t\tif( $this->_timeout_queue )\n\t\t{\n\t\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\t\n\t\t\t$this->_stepTimeout();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_status= self::STATUSES['DONE'];\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( $this->_queue || $this->_timeout_queue )\n\t\t\t$this->_status= self::STATUSES['PAUSED'];\n\t\telse\n\t\t\t$this->_status= self::STATUSES['DONE'];\n\t}", "public function suspend($status = false)\n {\n if ($this->storedStatus === null) {\n $this->storedStatus = $this->isEnabled;\n $this->isEnabled = $status;\n }\n }", "public function stopPlaying()\n {\n return $this->proxyToInterface()->stopPlaying(\n $this->id);\n }", "public function sleep() {}", "function sleep($time, LoopInterface $loop)\n{\n await(Timer\\resolve($time, $loop), $loop);\n}", "public function resume($subscription_id)\n {\n return ChargeBee_Subscription::removeScheduledCancellation($subscription_id)->subscription();\n }", "public function stopSpeaking()\n {\n return $this->proxyToInterface()->stopSpeaking(\n $this->id);\n }", "public function asyncBreak();", "function play($pkt){\n if( $this->active_player && $this->state->paused){\n $this->json('VideoPlayer.PlayPause',null,$pkt);\n }\n else\n $this->nak($pkt['from']);\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function pausedStock($entityIds){\r\n $productSellerId = Mage::getModel ( 'catalog/product' )->load ( $entityIds )->getSellerId ();\r\n if ($productSellerId == Mage::getSingleton ( 'customer/session' )->getCustomerId ()) {\r\n $_Product = Mage::getModel ( 'catalog/product' )->load($entityIds);\r\n $stockData = array ();\r\n $_Product->setStatus('2'); \r\n $_Product->setSeller_product_status('1026'); // Paused status \r\n $_Product->setStockData ( $stockData );\r\n $_Product->save (); \r\n return true;\r\n }\r\n \r\n }", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function release($task, $delay=false);", "public function testResumeMember()\n {\n }", "public function release($delay = 0);", "protected function reportPause(float $timeout): void\n {\n parent::reportPause($timeout);\n $this->pauseCount++;\n $this->lastPause = $timeout;\n }", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "protected function completePending($async)\n {\n $async->setIsPending(false)->save();\n }", "abstract protected function doResume();", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }" ]
[ "0.61933154", "0.59582126", "0.587792", "0.58748496", "0.58618504", "0.5425835", "0.5238515", "0.5195129", "0.5186118", "0.5074992", "0.5062111", "0.5057064", "0.5037985", "0.5019289", "0.50024873", "0.49525195", "0.49365297", "0.48516017", "0.47931746", "0.47480434", "0.4719963", "0.47060344", "0.46253794", "0.45623443", "0.45583108", "0.45426214", "0.45358938", "0.4513521", "0.44681478", "0.4422329", "0.43944108", "0.4383892", "0.43828914", "0.4280407", "0.42765933", "0.42706877", "0.42343855", "0.4220157", "0.42130202", "0.41667858", "0.41602716", "0.41389543", "0.40761852", "0.40581217", "0.40276366", "0.4027346", "0.4013526", "0.39856508", "0.39736575", "0.39511436", "0.39464855", "0.39298528", "0.39067286", "0.39043525", "0.39033318", "0.3901194", "0.38964862", "0.38751996", "0.38275513", "0.38241574", "0.38208136", "0.3812281", "0.38020822", "0.3800127", "0.3781242", "0.37729707", "0.3761119", "0.37522683", "0.37385494", "0.37344477", "0.3705988", "0.37047213", "0.37017286", "0.369999", "0.3697921", "0.36902186", "0.36753324", "0.36654627", "0.3661471", "0.36609796", "0.3650961", "0.36464548", "0.3634406", "0.36305708", "0.36304873", "0.3624834", "0.36204606", "0.36038148", "0.36038148", "0.36038148", "0.36038148", "0.36038148", "0.36008817", "0.359327", "0.3591826", "0.35842302", "0.35828125", "0.35797167", "0.356289", "0.35626692" ]
0.49185097
17
Operation pauseAsyncWithHttpInfo Pause Subscription
public function pauseAsyncWithHttpInfo($id, $pause_subscription_request = null) { $returnType = '\OpenAPI\Client\Model\Subscription'; $request = $this->pauseRequest($id, $pause_subscription_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "public function pause($id, $pause_subscription_request = null)\n {\n list($response) = $this->pauseWithHttpInfo($id, $pause_subscription_request);\n return $response;\n }", "public function pauseAsync($id, $pause_subscription_request = null)\n {\n return $this->pauseAsyncWithHttpInfo($id, $pause_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function pauseQueue()\n {\n return $this->sendrequest('pause', null);\n }", "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function pause();", "public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }", "public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }", "function pause() {\n\n\t\tif (is_null($this->_httpq->pause())) { return false; }\n\t\treturn true;\n\n\t}", "public function getPause()\n {\n return $this->get(self::PAUSE);\n }", "function theme_views_slideshow_thumbnailhover_control_pause($vss_id, $view, $options) {\n return l(t('Pause'), '', array(\n 'attributes' => array(\n 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',\n 'id' => \"views_slideshow_thumbnailhover_playpause_\" . $vss_id,\n ),\n 'fragment' => ' ',\n 'external' => TRUE,\n ));\n}", "protected function pauseRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseCampaignAction(\n Request $request,\n GoogleAdsClient $googleAdsClient\n ): View {\n // Retrieves the form inputs.\n $customerId = $request->input('customerId');\n $campaignId = $request->input('campaignId');\n\n // Deducts the campaign resource name from the given IDs.\n $campaignResourceName = ResourceNames::forCampaign($customerId, $campaignId);\n\n // Creates a campaign object and sets its status to PAUSED.\n $campaign = new Campaign();\n $campaign->setResourceName($campaignResourceName);\n $campaign->setStatus(CampaignStatus::PAUSED);\n\n // Constructs an operation that will pause the campaign with the specified resource\n // name, using the FieldMasks utility to derive the update mask. This mask tells the\n // Google Ads API which attributes of the campaign need to change.\n $campaignOperation = new CampaignOperation();\n $campaignOperation->setUpdate($campaign);\n $campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));\n\n // Issues a mutate request to pause the campaign.\n $googleAdsClient->getCampaignServiceClient()->mutateCampaigns(\n $customerId,\n [$campaignOperation]\n );\n\n // Builds the GAQL query to retrieve more information about the now paused campaign.\n $query = sprintf(\n \"SELECT campaign.id, campaign.name, campaign.status FROM campaign \" .\n \"WHERE campaign.resource_name = '%s' LIMIT 1\",\n $campaignResourceName\n );\n\n // Searches the result.\n $response = $googleAdsClient->getGoogleAdsServiceClient()->search(\n $customerId,\n $query\n );\n\n // Fetches and converts the result as a POPO using JSON.\n $campaign = json_decode(\n $response->iterateAllElements()->current()->getCampaign()->serializeToJsonString(),\n true\n );\n\n return view(\n 'pause-result',\n compact('customerId', 'campaign')\n );\n }", "public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }", "public function tspAsyncWithHttpInfo()\n {\n $returnType = '\\Zoom\\Api\\Model\\Tsp200Response';\n $request = $this->tspRequest();\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 actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }", "function campaignPause($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignPause\", $params);\n }", "public function pause(Timer $timer);", "public function resumeAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->resumeRequest($id);\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 pause($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('pause', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function pause(){\n\t\tsession_write_close();\n\t}", "function VM_pauseVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" pause\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function convertToSlidesAsyncWithHttpInfo(Requests\\ConvertToSlidesRequest $request) \n {\n $returnType = '\\GroupDocs\\Conversion\\Model\\Link';\n $request = $this->ConvertToSlidesRequest($request);\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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 \n if ($exception instanceof RepeatRequestException) {\n $this->_refreshToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}", "public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}", "function curl_pause(CurlHandle $handle, int $bitmask): int {}", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function playByPlay(): Response\n {\n return $this->call('playbyplay');\n }", "function pause()\n {\n session_write_close();\n }", "public function testMissingParameterPauseCheck() {\n $this->pingdom->pauseCheck(null);\n }", "public function pauseFeedUsingPOSTWithHttpInfo($campaign_id, $hash)\n\t\t{\n\t\t\t// verify the required parameter 'campaign_id' is set\n\t\t\tif($campaign_id === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $campaign_id when calling pauseFeedUsingPOST');\n\t\t\t}\n\t\t\t// verify the required parameter 'hash' is set\n\t\t\tif($hash === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $hash when calling pauseFeedUsingPOST');\n\t\t\t}\n\t\t\t// parse inputs\n\t\t\t$resourcePath = \"/api/campaign/{campaignId}/source/pause\";\n\t\t\t$httpBody = '';\n\t\t\t$queryParams = [];\n\t\t\t$headerParams = [];\n\t\t\t$formParams = [];\n\t\t\t$_header_accept = $this->apiClient->selectHeaderAccept(['application/json', '*/*']);\n\t\t\tif(!is_null($_header_accept))\n\t\t\t{\n\t\t\t\t$headerParams['Accept'] = $_header_accept;\n\t\t\t}\n\t\t\t$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n\t\t\t// query params\n\t\t\tif($hash !== NULL)\n\t\t\t{\n\t\t\t\t$queryParams['hash'] = $this->apiClient->getSerializer()->toQueryValue($hash);\n\t\t\t}\n\t\t\t// path params\n\t\t\tif($campaign_id !== NULL)\n\t\t\t{\n\t\t\t\t$resourcePath = str_replace(\"{\" . \"campaignId\" . \"}\", $this->apiClient->getSerializer()->toPathValue($campaign_id), $resourcePath);\n\t\t\t}\n\t\t\t// default format to json\n\t\t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n\n\t\t\t// for model (json/xml)\n\t\t\tif(isset($_tempBody))\n\t\t\t{\n\t\t\t\t$httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\t\t\t}elseif(count($formParams) > 0)\n\t\t\t{\n\t\t\t\t$httpBody = $formParams; // for HTTP post (form)\n\t\t\t}\n\t\t\t// make the API Call\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlist($response, $statusCode, $httpHeader) = $this->apiClient->callApi($resourcePath, 'POST', $queryParams, $httpBody, $headerParams, '\\Swagger\\Client\\Model\\InlineResponse2008', '/api/campaign/{campaignId}/source/pause');\n\n\t\t\t\treturn [\n\t\t\t\t\t$this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse2008', $httpHeader),\n\t\t\t\t\t$statusCode,\n\t\t\t\t\t$httpHeader\n\t\t\t\t];\n\t\t\t}catch(ApiException $e)\n\t\t\t{\n\t\t\t\tswitch($e->getCode())\n\t\t\t\t{\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\t$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse2008', $e->getResponseHeaders());\n\t\t\t\t\t\t$e->setResponseObject($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}", "public function deleteRateLimiterAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\InlineResponse200';\n $request = $this->deleteRateLimiterRequest($options);\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 }\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 unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }", "public function deleteIdentityprovidersPingAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\ModelEmpty';\n $request = $this->deleteIdentityprovidersPingRequest();\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 suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function patchVoicemailUserpolicyAsyncWithHttpInfo($userId, $body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\VoicemailUserPolicy';\n $request = $this->patchVoicemailUserpolicyRequest($userId, $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 getPrivateKeysAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Key[]';\n $request = $this->getPrivateKeysRequest();\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 unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function pause($state = -1 ,$fadeInSecs = -1)\n\t{\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" pause \".($state >= 0 ? (string) $state : \"\").\" \".(($state == 0 && $fadeInSecs >= 0) ? (string) $fadeInSecs : \"\"));\n\t}", "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "public function pause() {\n\t\ttry {\n\n\t\t\t// Make sure the previous one is stopped\n\t\t\tif (empty($this->measurements)) {\n\t\t\t\tthrow new AggregatedMeasurementNotStartedStopwatchException($this);\n\t\t\t}\n\n\t\t\t// Stop the measurements\n\t\t\t$measurement =& $this->measurements[$this->count];\n\t\t\tif ($measurement->isStopped()) {\n\t\t\t\tthrow new AggregatedMeasurementAlreadyStoppedStopwatchException($this);\n\t\t\t}\n\t\t\t$measurement->stop();\n\n\t\t\t// Update the looped info\n\t\t\t$this->total += $measurement->getTime();\n\t\t\t$this->count++;\n\n\t\t} catch (StopwatchException $ex) {\n\t\t\tStopwatchException::handle($ex);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function testMissingParametersPauseChecks() {\n $this->pingdom->pauseChecks(null);\n }", "public function reactivate(string $subscriptionId, array $parameters = []): ApiResponse\n {\n if (! isset($parameters['plan'])) {\n $subscription = $this->find($subscriptionId);\n\n $parameters['plan'] = $subscription['plan']['id'];\n }\n\n $parameters['cancel_at_period_end'] = false;\n\n return $this->update($subscriptionId, $parameters);\n }", "public function getPauseCount(): int\n {\n return $this->pauseCount;\n }", "public function resetApiKeyAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->resetApiKeyRequest();\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 destroy($id)\n {\n //\n $pause = Pause::find($id);\n\n $pause->delete(); \n }", "public function containerPause($container)\n {\n return $this->browser->post(\n $this->uri->expand(\n 'containers/{container}/pause',\n array(\n 'container' => $container\n )\n )\n )->then(array($this->parser, 'expectEmpty'));\n }", "public function suspend(array $params) {\n $endPoint = Http::prepare('orders/suspend.json');\n $response = json_decode(Http::send($this->apicaller, $endPoint, $params, 'POST'));\n \n return $response;\n }", "public function isPaused();", "public function getCurrentUserSubjectAsyncWithHttpInfo()\n {\n $returnType = '\\Killbill\\Client\\Swagger\\Model\\Subject';\n $request = $this->getCurrentUserSubjectRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($request, $returnType) {\n return $this->handleResponse($request, $response, $returnType);\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 getPublicKeysAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Key[]';\n $request = $this->getPublicKeysRequest();\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 accountDeleteByKeysAsyncWithHttpInfo($ids)\n {\n $returnType = '';\n $request = $this->accountDeleteByKeysRequest($ids);\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 putVoicemailPolicyAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\VoicemailOrganizationPolicy';\n $request = $this->putVoicemailPolicyRequest($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 createPrivateKeyAsyncWithHttpInfo()\n {\n $returnType = '\\Reepay\\Model\\Key';\n $request = $this->createPrivateKeyRequest();\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 tspAsync()\n {\n return $this->tspAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function patchVoicemailMePolicyAsyncWithHttpInfo($body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\VoicemailUserPolicy';\n $request = $this->patchVoicemailMePolicyRequest($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 isPaused()\n {\n return $this->paused;\n }", "function videoPlayPauseButton(){ ?>\n\t\n\t<span id=\"video-play-pause\" class=\"pause-btn\"></span>\n\n<?php }", "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "function paused_plugins_notice()\n {\n }", "public function v1PropertyTemplatesPoliciesGetAsyncWithHttpInfo()\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesPoliciesGetRequest();\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 resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function removeTrafficControlApisWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiIds)) {\n $query['ApiIds'] = $request->apiIds;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n if (!Utils::isUnset($request->trafficControlId)) {\n $query['TrafficControlId'] = $request->trafficControlId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RemoveTrafficControlApis',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RemoveTrafficControlApisResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function quotestdPostAsyncWithHttpInfo($xApiVersion, $body = null)\n {\n $returnType = '\\Maviance\\S3PApiClient\\Model\\Quote';\n $request = $this->quotestdPostRequest($xApiVersion, $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 testMissingParametersUnpauseChecks() {\n $this->pingdom->unpauseChecks(null);\n }", "public function pauseFeedsUsingPOSTWithHttpInfo($campaign_id, $hash)\n\t\t{\n\t\t\t// verify the required parameter 'campaign_id' is set\n\t\t\tif($campaign_id === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $campaign_id when calling pauseFeedsUsingPOST');\n\t\t\t}\n\t\t\t// verify the required parameter 'hash' is set\n\t\t\tif($hash === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $hash when calling pauseFeedsUsingPOST');\n\t\t\t}\n\t\t\t// parse inputs\n\t\t\t$resourcePath = \"/api/campaign/{campaignId}/sources/pause\";\n\t\t\t$httpBody = '';\n\t\t\t$queryParams = [];\n\t\t\t$headerParams = [];\n\t\t\t$formParams = [];\n\t\t\t$_header_accept = $this->apiClient->selectHeaderAccept(['application/json', '*/*']);\n\t\t\tif(!is_null($_header_accept))\n\t\t\t{\n\t\t\t\t$headerParams['Accept'] = $_header_accept;\n\t\t\t}\n\t\t\t$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n\t\t\t// query params\n\t\t\tif(is_array($hash))\n\t\t\t{\n\t\t\t\t$hash = $this->apiClient->getSerializer()->serializeCollection($hash, 'csv', TRUE);\n\t\t\t}\n\t\t\tif($hash !== NULL)\n\t\t\t{\n\t\t\t\t$queryParams['hash'] = $this->apiClient->getSerializer()->toQueryValue($hash);\n\t\t\t}\n\t\t\t// path params\n\t\t\tif($campaign_id !== NULL)\n\t\t\t{\n\t\t\t\t$resourcePath = str_replace(\"{\" . \"campaignId\" . \"}\", $this->apiClient->getSerializer()->toPathValue($campaign_id), $resourcePath);\n\t\t\t}\n\t\t\t// default format to json\n\t\t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n\n\t\t\t// for model (json/xml)\n\t\t\tif(isset($_tempBody))\n\t\t\t{\n\t\t\t\t$httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\t\t\t}elseif(count($formParams) > 0)\n\t\t\t{\n\t\t\t\t$httpBody = $formParams; // for HTTP post (form)\n\t\t\t}\n\t\t\t// make the API Call\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlist($response, $statusCode, $httpHeader) = $this->apiClient->callApi($resourcePath, 'POST', $queryParams, $httpBody, $headerParams, '\\Swagger\\Client\\Model\\InlineResponse2008', '/api/campaign/{campaignId}/sources/pause');\n\n\t\t\t\treturn [\n\t\t\t\t\t$this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse2008', $httpHeader),\n\t\t\t\t\t$statusCode,\n\t\t\t\t\t$httpHeader\n\t\t\t\t];\n\t\t\t}catch(ApiException $e)\n\t\t\t{\n\t\t\t\tswitch($e->getCode())\n\t\t\t\t{\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\t$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse2008', $e->getResponseHeaders());\n\t\t\t\t\t\t$e->setResponseObject($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}", "public function testPingGoogleSlide($driveUrl, $id, $name)\n {\n $driveFile = new \\Google_Service_Drive_DriveFile([\n 'id' => $id,\n 'mimeType' => GoogleAPIClient::MIME_TYPE_GOOGLE_PRESENTATION,\n 'name' => $name\n ]);\n\n $driveFilesMock = $this->createMock('Google_Service_Drive_Resource_Files');\n $driveFilesMock->method('get')->with($id)->willReturn($driveFile);\n\n $driveServiceMock = $this->createMock('Google_Service_Drive');\n $driveServiceMock->files = $driveFilesMock;\n\n $googleAPIClientMock = $this->createMock(GoogleAPIClient::class);\n $googleAPIClientMock->method('authenticateFromCommand')->willReturn(true);\n $googleAPIClientMock->driveService = $driveServiceMock;\n\n $this->googleAPIFactoryMock->method('make')->willReturn($googleAPIClientMock);\n\n $commandTester = new CommandTester($this->command);\n $commandTester->execute([\n 'driveUrl' => $driveUrl,\n '--gApiOAuthSecretFile' => $this->secretPath,\n '--gApiAccessTokenFile' => $this->tokenPath\n ]);\n $output = $commandTester->getDisplay();\n $this->assertContains('The URL is a Google Slides file', $output);\n $this->assertContains('Name: '.$name, $output);\n $this->assertEquals(0, $commandTester->getStatusCode());\n }", "public function console_pause() {\n echo PHP_EOL.\"Press ENTER to continue...\";\n fgetc(STDIN);\n }", "public function getApiContinue( array $result ) {\n\t\treturn $result['continue']['apcontinue'] ?? false;\n\t}", "public function pauseWorking(){\r\n\r\n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "public function send($message, $signal = null, $pause = 100000)\n {\n $messageArray = array();\n\n // Read any existing messages in apcu\n if(apcu_exists($this->key)){\n $readMessage = apcu_fetch($this->key);\n\n if($readMessage !== false){\n //$messageArray[] = unserialize($readMessage);\n $messageArray[] = $readMessage;\n }\n\n //cleanup\n apcu_delete($this->key);\n }else{\n\n }\n\n // Add the current message to the end of the array, and serialize it\n $messageArray[] = $message;\n\n // Write new serialized message to apcu\n $store = apcu_store($this->key, $messageArray, 0);\n\n if($store === false){\n throw new ProcessControlException(sprintf('Not able to create cache for PID: %s with key %s', $this->pid, $this->key));\n }\n\n if (false === $signal) {\n return;\n }\n\n $this->signal($signal ?: $this->signal);\n usleep($pause);\n }", "public function describeApiTrafficControlsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiIds)) {\n $query['ApiIds'] = $request->apiIds;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->pageNumber)) {\n $query['PageNumber'] = $request->pageNumber;\n }\n if (!Utils::isUnset($request->pageSize)) {\n $query['PageSize'] = $request->pageSize;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeApiTrafficControls',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeApiTrafficControlsResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "protected function v1PropertyTemplatesPoliciesGetRequest()\n {\n\n $resourcePath = '/v1/property/templates/policies';\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', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function patchVoicemailGroupPolicyAsyncWithHttpInfo($groupId, $body)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\VoicemailGroupPolicy';\n $request = $this->patchVoicemailGroupPolicyRequest($groupId, $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 deleteVoicemailMessagesAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->deleteVoicemailMessagesRequest();\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 update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function expirePrivateKeyAsyncWithHttpInfo($key)\n {\n $returnType = '';\n $request = $this->expirePrivateKeyRequest($key);\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 isPaused()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_PAUSED;\n\t}", "public function convertToSlidesStreamAsyncWithHttpInfo(Requests\\ConvertToSlidesStreamRequest $request) \n {\n $returnType = '\\SplFileObject';\n $request = $this->ConvertToSlidesStreamRequest($request);\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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 \n if ($exception instanceof RepeatRequestException) {\n $this->_refreshToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "public function getVoicemailUserpolicyAsyncWithHttpInfo($userId)\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\VoicemailUserPolicy';\n $request = $this->getVoicemailUserpolicyRequest($userId);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "protected function postOutboundCampaignsProgressRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling postOutboundCampaignsProgress'\n );\n }\n\n $resourcePath = '/api/v2/outbound/campaigns/progress';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function resumeById(int $id, mixed ...$data): mixed;", "public function __invoke()\n {\n $data=$this->repository->instance()->orderBy(\"id\",\"desc\")->paginate();;\n return $this->apiResponse(new YoutubeVideoCollection($data), true, 200);\n }", "public function tspWithHttpInfo()\n {\n $request = $this->tspRequest();\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 ('\\Zoom\\Api\\Model\\Tsp200Response' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\Zoom\\Api\\Model\\Tsp200Response' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\Zoom\\Api\\Model\\Tsp200Response', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\Zoom\\Api\\Model\\Tsp200Response';\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 '\\Zoom\\Api\\Model\\Tsp200Response',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "protected function youtubeLiveBroadcastsControlRequest($id, $part, $alt = 'json', $fields = null, $key = null, $oauth_token = null, $pretty_print = 'true', $quota_user = null, $user_ip = null, $display_slate = null, $offset_time_ms = null, $on_behalf_of_content_owner = null, $on_behalf_of_content_owner_channel = null, $walltime = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling youtubeLiveBroadcastsControl'\n );\n }\n // verify the required parameter 'part' is set\n if ($part === null || (is_array($part) && count($part) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $part when calling youtubeLiveBroadcastsControl'\n );\n }\n\n $resourcePath = '/liveBroadcasts/control';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($alt !== null) {\n $queryParams['alt'] = ObjectSerializer::toQueryValue($alt);\n }\n // query params\n if ($fields !== null) {\n $queryParams['fields'] = ObjectSerializer::toQueryValue($fields);\n }\n // query params\n if ($key !== null) {\n $queryParams['key'] = ObjectSerializer::toQueryValue($key);\n }\n // query params\n if ($oauth_token !== null) {\n $queryParams['oauth_token'] = ObjectSerializer::toQueryValue($oauth_token);\n }\n // query params\n if ($pretty_print !== null) {\n $queryParams['prettyPrint'] = ObjectSerializer::toQueryValue($pretty_print);\n }\n // query params\n if ($quota_user !== null) {\n $queryParams['quotaUser'] = ObjectSerializer::toQueryValue($quota_user);\n }\n // query params\n if ($user_ip !== null) {\n $queryParams['userIp'] = ObjectSerializer::toQueryValue($user_ip);\n }\n // query params\n if ($display_slate !== null) {\n $queryParams['displaySlate'] = ObjectSerializer::toQueryValue($display_slate);\n }\n // query params\n if ($id !== null) {\n $queryParams['id'] = ObjectSerializer::toQueryValue($id);\n }\n // query params\n if ($offset_time_ms !== null) {\n $queryParams['offsetTimeMs'] = ObjectSerializer::toQueryValue($offset_time_ms);\n }\n // query params\n if ($on_behalf_of_content_owner !== null) {\n $queryParams['onBehalfOfContentOwner'] = ObjectSerializer::toQueryValue($on_behalf_of_content_owner);\n }\n // query params\n if ($on_behalf_of_content_owner_channel !== null) {\n $queryParams['onBehalfOfContentOwnerChannel'] = ObjectSerializer::toQueryValue($on_behalf_of_content_owner_channel);\n }\n // query params\n if ($part !== null) {\n $queryParams['part'] = ObjectSerializer::toQueryValue($part);\n }\n // query params\n if ($walltime !== null) {\n $queryParams['walltime'] = ObjectSerializer::toQueryValue($walltime);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function describeTrafficControlsByApiWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiId)) {\n $query['ApiId'] = $request->apiId;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeTrafficControlsByApi',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeTrafficControlsByApiResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function v1PropertyTemplatesPerilsPerilIdCausesGetAsyncWithHttpInfo($peril_id, $accept_language = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\TemplateMetadataResponse[]';\n $request = $this->v1PropertyTemplatesPerilsPerilIdCausesGetRequest($peril_id, $accept_language);\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 convertToWordsAsyncWithHttpInfo(Requests\\ConvertToWordsRequest $request) \n {\n $returnType = '\\GroupDocs\\Conversion\\Model\\Link';\n $request = $this->ConvertToWordsRequest($request);\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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 \n if ($exception instanceof RepeatRequestException) {\n $this->_refreshToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "public function iPauseForSeconds($num_seconds)\n {\n sleep($num_seconds);\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function releaseInstancePublicConnectionWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->currentConnectionString)) {\n $query['CurrentConnectionString'] = $request->currentConnectionString;\n }\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'ReleaseInstancePublicConnection',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return ReleaseInstancePublicConnectionResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function describeTrafficControlsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->apiId)) {\n $query['ApiId'] = $request->apiId;\n }\n if (!Utils::isUnset($request->groupId)) {\n $query['GroupId'] = $request->groupId;\n }\n if (!Utils::isUnset($request->pageNumber)) {\n $query['PageNumber'] = $request->pageNumber;\n }\n if (!Utils::isUnset($request->pageSize)) {\n $query['PageSize'] = $request->pageSize;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->stageName)) {\n $query['StageName'] = $request->stageName;\n }\n if (!Utils::isUnset($request->trafficControlId)) {\n $query['TrafficControlId'] = $request->trafficControlId;\n }\n if (!Utils::isUnset($request->trafficControlName)) {\n $query['TrafficControlName'] = $request->trafficControlName;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeTrafficControls',\n 'version' => '2016-07-14',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeTrafficControlsResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "function gupnp_context_set_subscription_timeout($context, $timeout)\n{\n}", "public function resume();", "public function patchOutboundSettingsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->patchOutboundSettingsRequest($body);\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 }" ]
[ "0.6599905", "0.5760269", "0.5575559", "0.5264843", "0.51674086", "0.5154135", "0.50580347", "0.50436234", "0.50218236", "0.5010299", "0.47628224", "0.4694346", "0.4625178", "0.4536303", "0.44720948", "0.44598576", "0.44378605", "0.44342506", "0.43335363", "0.42906952", "0.42782617", "0.42757615", "0.42176527", "0.41469723", "0.41396013", "0.41030857", "0.40533924", "0.4024172", "0.40101156", "0.4010098", "0.39504403", "0.3940532", "0.39379677", "0.3903391", "0.38870552", "0.38818416", "0.38716477", "0.3871238", "0.38527048", "0.38188046", "0.38172996", "0.3812488", "0.38033506", "0.3787932", "0.37680203", "0.37501773", "0.3724721", "0.37014788", "0.36978647", "0.36933967", "0.36854708", "0.36716467", "0.36661443", "0.36561418", "0.36423865", "0.36272436", "0.3624661", "0.3610531", "0.36081746", "0.35986245", "0.35857493", "0.3565705", "0.35646477", "0.35625595", "0.35518235", "0.35506326", "0.35496324", "0.3547258", "0.35315812", "0.3524868", "0.35114428", "0.350691", "0.34957513", "0.34854198", "0.3482468", "0.34665522", "0.3466172", "0.3465335", "0.346219", "0.34618437", "0.3449839", "0.3448871", "0.3439471", "0.34377536", "0.34088236", "0.34070814", "0.3407032", "0.33940297", "0.33886322", "0.3385579", "0.33810776", "0.33778396", "0.33592826", "0.33590442", "0.33545575", "0.3353666", "0.33531427", "0.33420977", "0.33361083", "0.33315626" ]
0.6421781
1
Create request for operation 'pause'
public function pauseRequest($id, $pause_subscription_request = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling pause' ); } $resourcePath = '/subscriptions/{id}/pause'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($pause_subscription_request)) { if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request)); } else { $httpBody = $pause_subscription_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pause();", "public function pauseQueue()\n {\n return $this->sendrequest('pause', null);\n }", "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "protected function pauseRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }", "function VM_pauseVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" pause\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function getPause()\n {\n return $this->get(self::PAUSE);\n }", "public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }", "public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }", "function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}", "function pause() {\n\n\t\tif (is_null($this->_httpq->pause())) { return false; }\n\t\treturn true;\n\n\t}", "public function testMissingParameterPauseCheck() {\n $this->pingdom->pauseCheck(null);\n }", "public function pause(){\n\t\tsession_write_close();\n\t}", "public function pauseWorking(){\r\n\r\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function testMissingParametersPauseChecks() {\n $this->pingdom->pauseChecks(null);\n }", "function curl_pause(CurlHandle $handle, int $bitmask): int {}", "public function containerPause($container)\n {\n return $this->browser->post(\n $this->uri->expand(\n 'containers/{container}/pause',\n array(\n 'container' => $container\n )\n )\n )->then(array($this->parser, 'expectEmpty'));\n }", "function pause()\n {\n session_write_close();\n }", "public function pauseCampaignAction(\n Request $request,\n GoogleAdsClient $googleAdsClient\n ): View {\n // Retrieves the form inputs.\n $customerId = $request->input('customerId');\n $campaignId = $request->input('campaignId');\n\n // Deducts the campaign resource name from the given IDs.\n $campaignResourceName = ResourceNames::forCampaign($customerId, $campaignId);\n\n // Creates a campaign object and sets its status to PAUSED.\n $campaign = new Campaign();\n $campaign->setResourceName($campaignResourceName);\n $campaign->setStatus(CampaignStatus::PAUSED);\n\n // Constructs an operation that will pause the campaign with the specified resource\n // name, using the FieldMasks utility to derive the update mask. This mask tells the\n // Google Ads API which attributes of the campaign need to change.\n $campaignOperation = new CampaignOperation();\n $campaignOperation->setUpdate($campaign);\n $campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));\n\n // Issues a mutate request to pause the campaign.\n $googleAdsClient->getCampaignServiceClient()->mutateCampaigns(\n $customerId,\n [$campaignOperation]\n );\n\n // Builds the GAQL query to retrieve more information about the now paused campaign.\n $query = sprintf(\n \"SELECT campaign.id, campaign.name, campaign.status FROM campaign \" .\n \"WHERE campaign.resource_name = '%s' LIMIT 1\",\n $campaignResourceName\n );\n\n // Searches the result.\n $response = $googleAdsClient->getGoogleAdsServiceClient()->search(\n $customerId,\n $query\n );\n\n // Fetches and converts the result as a POPO using JSON.\n $campaign = json_decode(\n $response->iterateAllElements()->current()->getCampaign()->serializeToJsonString(),\n true\n );\n\n return view(\n 'pause-result',\n compact('customerId', 'campaign')\n );\n }", "public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }", "public function testMissingParametersUnpauseCheck() {\n $this->pingdom->unpauseCheck(null);\n }", "public function resume();", "function campaignPause($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignPause\", $params);\n }", "function theme_views_slideshow_thumbnailhover_control_pause($vss_id, $view, $options) {\n return l(t('Pause'), '', array(\n 'attributes' => array(\n 'class' => 'views_slideshow_thumbnailhover_pause views_slideshow_pause',\n 'id' => \"views_slideshow_thumbnailhover_playpause_\" . $vss_id,\n ),\n 'fragment' => ' ',\n 'external' => TRUE,\n ));\n}", "public function unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }", "public function store(Request $request)\n {\n //\n $pause = Pause::create([\n 'worker_id' => $request->worker_id,\n 'start_time' => $request->start_time,\n 'finish_time' => $request->finish_time,\n 'notes' => $request->notes,\n 'created_by' => $request->user()->id\n ]);\n\n return $pause;\n }", "public function pause($state = -1 ,$fadeInSecs = -1)\n\t{\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" pause \".($state >= 0 ? (string) $state : \"\").\" \".(($state == 0 && $fadeInSecs >= 0) ? (string) $fadeInSecs : \"\"));\n\t}", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function console_pause() {\n echo PHP_EOL.\"Press ENTER to continue...\";\n fgetc(STDIN);\n }", "public function isPaused();", "public function pausetimeAction()\n {\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvtime_obj = new Ep_Ftv_FtvPauseTime();\n if($user_params['type'] == 'pause')\n {\n ////for goroup Id in users table////\n $ftvtime_obj->ftvrequest_id=$user_params['requestId'];\n $ftvtime_obj->pause_at=date('Y-m-d H:i:s') ;\n $ftvtime_obj->resume_at=null;\n $ftvtime_obj->insert();\n }\n else\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id= '\".$user_params['requestId'].\"' AND resume_at is null\";\n $ftvtime_obj->updateFtvPauseTime($data,$query);\n }\n }", "public function testMissingParametersUnpauseChecks() {\n $this->pingdom->unpauseChecks(null);\n }", "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "public function suspend(array $params) {\n $endPoint = Http::prepare('orders/suspend.json');\n $response = json_decode(Http::send($this->apicaller, $endPoint, $params, 'POST'));\n \n return $response;\n }", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "private function postStopProject() {\r\n $this->clientOwnsProject();\r\n\r\n $this->db->where(\"landingpage_collectionid\", $this->project)\r\n ->set('sample_time', 'sample_time + UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(last_sample_date)', FALSE)\r\n ->set('status', 1)\r\n ->update('landingpage_collection');\r\n\r\n $this->optimisation->flushCollectionCache($this->project);\r\n return $this->successResponse(201);\r\n }", "abstract protected function doSuspend();", "public function pause(Timer $timer);", "public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}", "public function enviarNoInterrumpir( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\", \"NO_INTERRUMPIR\",\n $this->getNoInterrumpir());\n usleep(1000000);\n $this->enviarPeticion($cmd->getComando());\n\n }", "public function playByPlay(): Response\n {\n return $this->call('playbyplay');\n }", "public function waitRequest(): ?Request;", "protected function getDeleteRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url->getQuery()->setParameter('code', 204);\n\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "function videoPlayPauseButton(){ ?>\n\t\n\t<span id=\"video-play-pause\" class=\"pause-btn\"></span>\n\n<?php }", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function set_request_p($key, $value=false)\n{\n return Request::SetValueP($key, $value);\n}", "public function cancel();", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function actionStop($at=false,$in=false)\n {\n // Stop the competition $in number of seconds from now\n }", "public function send($message, $signal = null, $pause = 100000)\n {\n $messageArray = array();\n\n // Read any existing messages in apcu\n if(apcu_exists($this->key)){\n $readMessage = apcu_fetch($this->key);\n\n if($readMessage !== false){\n //$messageArray[] = unserialize($readMessage);\n $messageArray[] = $readMessage;\n }\n\n //cleanup\n apcu_delete($this->key);\n }else{\n\n }\n\n // Add the current message to the end of the array, and serialize it\n $messageArray[] = $message;\n\n // Write new serialized message to apcu\n $store = apcu_store($this->key, $messageArray, 0);\n\n if($store === false){\n throw new ProcessControlException(sprintf('Not able to create cache for PID: %s with key %s', $this->pid, $this->key));\n }\n\n if (false === $signal) {\n return;\n }\n\n $this->signal($signal ?: $this->signal);\n usleep($pause);\n }", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function destroy($id)\n {\n //\n $pause = Pause::find($id);\n\n $pause->delete(); \n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "public function stopQuery()\n {\n }", "public function cancel(): void;", "public function pause($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('pause', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "abstract public function stop();", "public function handle()\n {\n $vkRequestsParams = RequestController::vkRequestsParams();\n $started_at = Carbon::now();\n $methods = [\n 'qwerty',\n ];\n $items = VkQueue::whereIn('method', $methods)->take($vkRequestsParams->records)->get();\n\n $this->log(0, 'RequestVk started at ' . Carbon::now()->format('Y-m-d, H:i:s'));\n $this->log(0, 'Available records: ' . $items->count());\n $this->log(0, 'Acceptable Records Count per Minute: ' . $vkRequestsParams->records);\n\n foreach ($items as $item) {\n if ($this->isBreakTimeRequest($started_at)) {\n $this->log($item->id, 'isBreakTimeRequest');\n continue;\n }\n\n if (Carbon::parse($item->user->expired_at) <= Carbon::now()) {\n $this->log($item->id, 'storeError :: Token expired');\n $this->storeError($item->user_id, $item->method, $item->access_token, trans('api.31'));\n $item->delete();\n continue;\n }\n\n $url = config('vk.request_url', 'http://localhost');\n\n $response = RequestController::send('POST', str_finish($url, '/') . $item->method, json_decode($item->context));\n\n if (!empty($response->error_description)) {\n $this->log($item->id, 'storeError :: ' . $response->error_description);\n $this->storeError($item->user_id, $item->method, $item->access_token, $response->error_description);\n } else {\n $this->log($item->id, 'storeSuccess :: ' . gettype($response));\n $this->storeSuccess($item->user_id, $item->method, $item->access_token, $response);\n }\n\n $item->delete();\n }\n\n $this->log(0, 'Requesting time: ' . Carbon::now()->diff($started_at)->s . 's');\n $this->log(0, 'RequestVk exiting at ' . Carbon::now()->format('Y-m-d, H:i:s'));\n }", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function cancelRequestOfUser() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUser($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function pauseFeedUsingPOSTWithHttpInfo($campaign_id, $hash)\n\t\t{\n\t\t\t// verify the required parameter 'campaign_id' is set\n\t\t\tif($campaign_id === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $campaign_id when calling pauseFeedUsingPOST');\n\t\t\t}\n\t\t\t// verify the required parameter 'hash' is set\n\t\t\tif($hash === NULL)\n\t\t\t{\n\t\t\t\tthrow new \\InvalidArgumentException('Missing the required parameter $hash when calling pauseFeedUsingPOST');\n\t\t\t}\n\t\t\t// parse inputs\n\t\t\t$resourcePath = \"/api/campaign/{campaignId}/source/pause\";\n\t\t\t$httpBody = '';\n\t\t\t$queryParams = [];\n\t\t\t$headerParams = [];\n\t\t\t$formParams = [];\n\t\t\t$_header_accept = $this->apiClient->selectHeaderAccept(['application/json', '*/*']);\n\t\t\tif(!is_null($_header_accept))\n\t\t\t{\n\t\t\t\t$headerParams['Accept'] = $_header_accept;\n\t\t\t}\n\t\t\t$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json']);\n\n\t\t\t// query params\n\t\t\tif($hash !== NULL)\n\t\t\t{\n\t\t\t\t$queryParams['hash'] = $this->apiClient->getSerializer()->toQueryValue($hash);\n\t\t\t}\n\t\t\t// path params\n\t\t\tif($campaign_id !== NULL)\n\t\t\t{\n\t\t\t\t$resourcePath = str_replace(\"{\" . \"campaignId\" . \"}\", $this->apiClient->getSerializer()->toPathValue($campaign_id), $resourcePath);\n\t\t\t}\n\t\t\t// default format to json\n\t\t\t$resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n\n\t\t\t// for model (json/xml)\n\t\t\tif(isset($_tempBody))\n\t\t\t{\n\t\t\t\t$httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\t\t\t}elseif(count($formParams) > 0)\n\t\t\t{\n\t\t\t\t$httpBody = $formParams; // for HTTP post (form)\n\t\t\t}\n\t\t\t// make the API Call\n\t\t\ttry\n\t\t\t{\n\t\t\t\tlist($response, $statusCode, $httpHeader) = $this->apiClient->callApi($resourcePath, 'POST', $queryParams, $httpBody, $headerParams, '\\Swagger\\Client\\Model\\InlineResponse2008', '/api/campaign/{campaignId}/source/pause');\n\n\t\t\t\treturn [\n\t\t\t\t\t$this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse2008', $httpHeader),\n\t\t\t\t\t$statusCode,\n\t\t\t\t\t$httpHeader\n\t\t\t\t];\n\t\t\t}catch(ApiException $e)\n\t\t\t{\n\t\t\t\tswitch($e->getCode())\n\t\t\t\t{\n\t\t\t\t\tcase 200:\n\t\t\t\t\t\t$data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse2008', $e->getResponseHeaders());\n\t\t\t\t\t\t$e->setResponseObject($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}", "public function sleep();", "protected function _cancelOperation() {}", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function tspRequest()\n {\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getPauseCount(): int\n {\n return $this->pauseCount;\n }", "public function isPaused()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_PAUSED;\n\t}", "protected function getCreateRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\": 1}');\n\t\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}", "public function cancel(): int;", "public function cancelRequestOfUserForReceived() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceived($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function actionPlaylist() {\n // Response format data\n $result_array = array(\n 'result' => self::BadRequest,\n 'msg' => Yii::t('user', 'Request method illegal!'),\n 'total' => 0,\n 'list' => array(),\n );\n if (self::RETURN_CURRENT_PLAYING) {\n $result_array['playing'] = array();\n }\n // Check request type\n $request_type = Yii::app()->request->getRequestType();\n if ('GET' != $request_type) {\n $this->sendResults($result_array, self::BadRequest);\n }\n\n // Get query data\n $_offset = Yii::app()->request->getQuery('offset');\n $_limit = Yii::app()->request->getQuery('limit');\n $_offset = empty($_offset) ? 0 : intval($_offset);\n $_limit = empty($_limit) ? $this->playlist_maximum : intval($_limit);\n $_limit = ($_limit > $this->playlist_maximum) ? $this->playlist_maximum : $_limit;\n\n // Get room device\n //$_device = DeviceState::model()->findByAttributes(array('room_id' => $this->_roomID, 'status' => 0));\n // Get STB\n $_device = Yii::app()->db->createCommand()\n ->select('ds.device_id')\n ->from('{{device_state}} ds')\n ->join('{{room}} r', 'ds.room_id = r.id')\n ->join('{{device}} d', 'ds.device_id = d.id')\n ->where('r.id=:id AND d.type=:type', array(':id' => $this->_roomID, ':type' => 1))\n ->queryRow();\n\n if (!is_null($_device) && !empty($_device)) {\n $_deviceid = $_device['device_id'];\n\n // log\n $criteria = new CDbCriteria();\n $criteria->condition = 'status = :status and device_id = :deviceid';\n\n if (self::RETURN_CURRENT_PLAYING) {\n // get current playing song\n $has_playing = false;\n $criteria->params = array(':deviceid' => $_deviceid, ':status' => 1);\n $_playing = DevicePlaylist::model()->find($criteria);\n if (!is_null($_playing) && !empty($_playing)) {\n // get songid from media_id\n $_media = $_playing->media;\n\n $_post_time = $_playing->play_posttime;\n $_timestamp = $_playing->play_timestamp;\n $_play_status = $_playing->play_status;\n $_play_status = empty($_play_status) ? 'PLAY' : $_play_status;\n $_media_duration = $_media->duration;\n\n // caculate the play time stamp\n $_play_timestamp = (time() - $_post_time) + $_timestamp;\n $_play_timestamp = ($_play_timestamp < 0) ? 0 : $_play_timestamp;\n $_play_timestamp = ($_play_timestamp > $_media_duration) ? $_media_duration : $_play_timestamp;\n\n // get user avatar information of song adder\n $_userinfo = $this->getUserInfo($_playing->create_user_id);\n\n $result_array['playing'] = array(\n 'songid' => $_media->songid,\n 'index_num' => intval($_playing->index_num),\n 'songname' => $_media->name,\n 'singername' => $_media->artist->name,\n 'duration' => intval($_media->duration),\n 'smallpicurl' => $this->getMediaPicUrl($_media, $_media->spic_url, 0),\n 'bigpicurl' => $this->getMediaPicUrl($_media, $_media->bpic_url),\n 'userid' => $_userinfo['uid'],\n 'nickname' => $_userinfo['nickname'],\n 'avatarurl' => $_userinfo['avatarurl'],\n 'status' => $_play_status,\n 'timestamp' => $_play_timestamp\n );\n $has_playing = true;\n }\n }\n\n // get play list\n $criteria->params = array(':deviceid' => $_deviceid, ':status' => 0);\n\n $_count = intval(DevicePlaylist::model()->count($criteria));\n\n $criteria->offset = $_offset;\n $criteria->limit = $_limit;\n $criteria->order = 'index_num asc';\n $play_list = DevicePlaylist::model()->findAll($criteria);\n if (!empty($play_list)) {\n // Get list success\n $result_array['result'] = self::Success;\n $result_array['msg'] = Yii::t('user', 'Get play list success!');\n $result_array['total'] = $_count;\n foreach ($play_list as $key => $_list) {\n $_media = $_list->media;\n // get user avatar information of song adder\n $_userinfo = $this->getUserInfo($_list->create_user_id);\n\n $result_array['list'][] = array(\n 'songid' => $_media->songid,\n 'index_num' => intval($_list->index_num),\n 'songname' => $_media->name,\n 'singername' => $_media->artist->name,\n 'duration' => intval($_media->duration),\n 'smallpicurl' => $this->getMediaPicUrl($_media, $_media->spic_url, 0),\n 'bigpicurl' => $this->getMediaPicUrl($_media, $_media->bpic_url),\n 'userid' => $_userinfo['uid'],\n 'nickname' => $_userinfo['nickname'],\n 'avatarurl' => $_userinfo['avatarurl'],\n );\n }\n } else {\n $result_array['result'] = self::Success;\n $result_array['msg'] = Yii::t('user', 'Play list is empty!');\n $result_array['total'] = $_count;\n }\n } else {\n $result_array['msg'] = Yii::t('user', 'Room STB invalid!');\n }\n\n // Set response information\n $this->sendResults($result_array);\n }", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function resume(): bool;", "public function resume(): bool {}", "public function voidRequest()\n {\n $request = new Request\\VoidTransaction;\n return $this->applyAuthSettings($request);\n }", "public function cancelRequestWaiverWireUserTeam_post() {\n $this->form_validation->set_rules('SessionKey', 'SessionKey', 'trim|required|callback_validateSession');\n $this->form_validation->set_rules('ContestGUID', 'ContestGUID', 'trim|required|callback_validateEntityGUID[Contest,ContestID]');\n $this->form_validation->set_rules('WireID', 'WireID', 'trim|required');\n $this->form_validation->validation($this); /* Run validation */\n\n $IsApply = $this->SnakeDrafts_model->cancelRequestWaiverWireUserTeam($this->ContestID, $this->SessionUserID, $this->Post['WireID']);\n if ($IsApply) {\n $this->Return['Message'] = \"Successfully request cancelled\";\n } else {\n $this->Return['ResponseCode'] = 500;\n $this->Return['Message'] = \"Sorry the cancel request failed, Please try gain.\";\n }\n }", "public function cancelRequestOfUserForReceivedApprovedRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceivedApprovedRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function isPaused()\n {\n return $this->paused;\n }", "public function request() {\n //sent to poster \n }", "public function record_stop($params = null, $options = null)\n {\n $url = $this->instanceUrl() . '/actions/record_stop';\n list($response, $opts) = $this->_request('post', $url, $params, $options);\n $this->refreshFrom($response, $opts);\n return $this;\n }", "public function enviarComandoMute( ) {\n $cmd = new ComandoFlash($this->getProyectorActivo(), $this->getEstadoMuteado($this->getProyectorActivo()), \"\");\n $this->enviarPeticion($cmd->getComando());\n }", "public function addPrequest(\\RO\\Cmd\\QuestName $value){\n return $this->_add(5, $value);\n }", "public function serviceRequest()\n {\n API::post('ivr/serviceRequest', array(\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }" ]
[ "0.6467386", "0.64217275", "0.61979496", "0.6100976", "0.5795197", "0.57342404", "0.5722731", "0.5717618", "0.5704757", "0.56527936", "0.55319285", "0.54270554", "0.5346903", "0.5342334", "0.5334933", "0.5245182", "0.5153226", "0.51068974", "0.50671494", "0.5066141", "0.50572467", "0.50493056", "0.50253797", "0.4986281", "0.49582613", "0.49311897", "0.49044064", "0.4864272", "0.48482782", "0.48454762", "0.48210716", "0.47956568", "0.47888514", "0.47782677", "0.47282475", "0.47217003", "0.463978", "0.46013612", "0.4582312", "0.45408446", "0.44890457", "0.44829932", "0.44356152", "0.43947136", "0.4389229", "0.43857473", "0.43573657", "0.4334769", "0.4334769", "0.4334769", "0.4334769", "0.4334769", "0.4331499", "0.43276665", "0.43272844", "0.43233663", "0.43109962", "0.43014216", "0.42870355", "0.42826623", "0.42666763", "0.42369646", "0.42220497", "0.42003575", "0.4197187", "0.41929203", "0.4191688", "0.4191688", "0.4191688", "0.4191688", "0.4191688", "0.4191688", "0.4191688", "0.4191688", "0.4186303", "0.41862234", "0.4163274", "0.415958", "0.41502318", "0.41460988", "0.41460988", "0.41432983", "0.4143113", "0.4130175", "0.41296062", "0.41144142", "0.41132063", "0.41056356", "0.41051337", "0.4093393", "0.4086892", "0.4083899", "0.40827724", "0.4079501", "0.40790385", "0.40745446", "0.40738276", "0.40647635", "0.40614417", "0.40601802" ]
0.65315706
0
Operation resume Resume Subscription
public function resume($id) { list($response) = $this->resumeWithHttpInfo($id); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resume();", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "abstract protected function doResume();", "public function resume($subscription_id)\n {\n return ChargeBee_Subscription::removeScheduledCancellation($subscription_id)->subscription();\n }", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "abstract protected function doResumeContext();", "public function resume(): bool {}", "public function resume(): bool;", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "public function resume(Auth $auth)\n {\n // do nothing\n }", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "public function resume(Timer $timer);", "public function resumeContextAccess(AccountInterface $account);", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public function getResumeContextResponse();", "public static function resumeById(int $id, mixed ...$data): mixed;", "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function testResumeMember()\n {\n }", "function campaignResume($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignResume\", $params);\n }", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function reopenInvoice() {\n\n $client = new \\app\\components\\OdooClient();\n $account_invoice_ids = $client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"in_invoice\"],\n [\"journal_id\", \"=\", 22]\n ]);\n\n $result = $client->execute(\"account.invoice\", \"signal_workflow\",\n [\n $account_invoice_ids,\n \"invoice_cancel\"\n ]);\n\n print_r($result);\n\n }", "public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "public function restored(Subscription $subscription)\n {\n //\n }", "public function setResume(?string $resume): self\n {\n $this->resume = $resume;\n\n return $this;\n }", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function resume()\n\t{\n\t\treturn $this->belongsTo('App\\Resume');\n\t}", "public function update(Request $request, Resume $resume)\n {\n //\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "protected function resumeSession(): bool\n {\n if ($this->manager->getIsActive() || $this->manager->resume()) {\n $this->load();\n\n return true;\n }\n\n return false;\n }", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "public function setResumeToken(Token $token)\n {\n \t$this->update(['resume_token' => $token->id]);\n }", "public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function resumed_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'resumed_hook',\n\t\t\t$context\n\t\t);\n\t}", "public function isResumed()\n {\n return $this->resumed;\n }", "public function onSubscriptionRenew(SubscriptionInterface $subscription, OrderInterface $order, OrderInterface $next_order);", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function restored(PlanSubscription $planSubscription)\n {\n //\n }", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function reactivate() : self\n {\n $subscription = $this->asStripeSubscription();\n\n if ($subscription->status === 'canceled') {\n $appPlan = $this->getPlans('apps_plans_id > 0')->getFirst()->appPlan;\n $companyGroup = $this->companyGroup;\n $company = $this->company;\n $branch = $this->branch;\n $options = [];\n $customerOptions = [];\n\n //we need to recreate the subscription\n $newSubscription = new SubscriptionBuilder(\n $appPlan,\n $this->getDI()->get('app'),\n $companyGroup,\n $company,\n $branch\n );\n $newSubscriptionModel = $newSubscription\n ->withMetadata(['appPlan' => $appPlan->getId()])\n ->skipTrial()\n ->create($options, $customerOptions);\n\n $this->softDelete();\n\n return $newSubscriptionModel;\n }\n\n $subscription->cancel_at_period_end = false;\n $subscription->save();\n\n return $this;\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function resume(): array {\n\t\t\t\n\t\t\t$data =\n\t\t\t [\n\t\t\t\t'apartment' => $this->apartment,\n\t\t\t\t'stay' => [\n\t\t\t\t 'check_in' => $this->check_in->format('d-m-Y'),\n\t\t\t\t 'check_out' => $this->check_out->format('d-m-Y'),\n\t\t\t\t 'requests' => $this->special_requests\n\t\t\t\t],\n\t\t\t\t'pending_upgrades' => [],\n\t\t\t ];\n\t\t\tforeach ($this->bookedServices as $bookedService) {\n\t\t\t\t$data['pending_upgrades'][] = $bookedService->slug;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function suspend()\n {\n if ($this->getState()->getMode() == View\\StateInterface::MODE_ENABLED) {\n $state = $this->getState();\n $state->setVersionId($this->getChangelog()->getVersion());\n $state->setStatus(View\\StateInterface::STATUS_SUSPENDED);\n $state->save();\n }\n }", "public function resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function resume($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('resume', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "function _renewSubscription(&$subscription) {\n\t\tif ($subscription->isNonExpiring()) return;\n\n\t\t$subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');\n\t\t$subscriptionType =& $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());\n\n\t\t$duration = $subscriptionType->getDuration();\n\t\t$dateEnd = strtotime($subscription->getDateEnd());\n\n\t\t// if the subscription is expired, extend it to today + duration of subscription\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$subscription->setDateEnd(mktime(23, 59, 59, date(\"m\", $dateEnd)+$duration, date(\"d\", $dateEnd), date(\"Y\", $dateEnd)));\n\n\t\t// Reset reminder dates\n\t\t$subscription->setDateRemindedBefore(null);\n\t\t$subscription->setDateRemindedAfter(null);\n\n\t\t$this->updateSubscription($subscription);\n\t}", "protected function _cancelOperation() {}", "protected function suspendTrainee($id){\n Trainee::where('id',$id)->update(array('status' => 'suspended'));\n $email = Trainee::where('id',$id)->value('email_address');\n $subject = \"Account Suspension\";\n // $this->email_function->basic_email($email);\n return redirect()->back()->with('message','A trainee has been Suspended Successfully and notified via email');\n }", "public static function billingResumed($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('billingResumed', $callback);\n }", "public function getResume()\n {\n return $this->hasOne(Resume::className(), ['id' => 'resume_id']);\n }", "function renewSubscription(&$subscription) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "public function resume(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Resume List';\n\t\t$data['resume_list'] = $this->common_model->get_all('fr_resume', '');\n\t\t$this->set_layout('resume/resume_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function updateSubscription( $email )\n\t {\n\t \t$obj = Doctrine_Core::getTable ( 'User' )->findOneByemail ( $email );\n\t \t$obj->downloadStatus = \"paid\";\n\t \t$obj->save();\n\t \treturn $obj->id;\n\t }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "protected function handlePurchaseValid($resume) {\n \n list($price_for, $membership_id, $pricing_id) = explode(\"_\", $this->form[\"purchase\"]->value(\"listing_type\"));\n\n $pricing = new Wpjb_Model_Pricing($pricing_id);\n $hash = md5(uniqid() . \"#\" . time());\n $granted = false;\n\n if(get_current_user_id()) {\n $uid = get_current_user_id();\n } else {\n $uid = \"UID\" . uniqid();\n }\n\n if($membership_id) {\n $granted = true;\n $membership = new Wpjb_Model_Membership($membership_id);\n $membership->inc($pricing_id);\n $membership->save();\n\n $resume->addAccessKey($uid, $hash);\n } elseif($pricing->price == 0) {\n $granted = true;\n $resume->addAccessKey($uid, $hash);\n } \n\n if($granted && get_current_user_id()) {\n $params = array(\"hash\"=>$hash, \"hash_id\"=>$uid);\n $message = Wpjb_Utility_Message::load(\"notify_employer_resume_paid\");\n $message->assign(\"resume\", $resume);\n $message->assign(\"resume_unique_url\", wpjr_link_to(\"resume\", $resume, $params));\n $message->setTo(wp_get_current_user()->user_email);\n $message->send();\n }\n\n if($granted) {\n $this->addInfo(__(\"Access to resume details has been granted.\", \"wpjobboard\"));\n $this->canView($resume->id);\n $this->canBrowse($resume->id);\n $this->form[\"contact\"] = new Wpjb_Form_Resumes_Contact;\n add_action(\"wp_footer\", \"wpjb_hide_scroll_hash\");\n } else {\n return $this->paymentForm($resume, $pricing);\n }\n }", "public function terminateExpiredSubscriptions()\n {\n $subscriptionRepo = \\Env::get('em')->getRepository('Cx\\Modules\\Order\\Model\\Entity\\Subscription');\n $subscriptions = $subscriptionRepo->getExpiredSubscriptions(array(\n \\Cx\\Modules\\Order\\Model\\Entity\\Subscription::STATE_ACTIVE,\n \\Cx\\Modules\\Order\\Model\\Entity\\Subscription::STATE_CANCELLED));\n \n if (\\FWValidator::isEmpty($subscriptions)) {\n return;\n }\n \n foreach ($subscriptions as $subscription) {\n $subscription->terminate();\n }\n \\Env::get('em')->flush();\n }", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function resume() {\n \n if (!isset($_COOKIE) || !\\array_key_exists($this->name, $_COOKIE)) {\n\n //coookie prob expired\n $this->forget();\n return false;\n }\n\n\n\n if (!$this->sessionStarted()) {\n\n if (\\session_start()) {\n $this->refresh();\n }\n }\n if (!$this->isFingerprint()) { //UA doesnt match\n $this->forget();\n return false;\n }\n\n return true;\n }", "function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)\n\t{\n\t\t$displayobject->update_basic('displaymodules','FALSE');\n\t\t$t_db_type\t\t= $sessionobject->get_session_var('targetdatabasetype');\n\t\t$t_tb_prefix\t= $sessionobject->get_session_var('targettableprefix');\n\t\t$s_db_type\t\t= $sessionobject->get_session_var('sourcedatabasetype');\n\t\t$s_tb_prefix\t= $sessionobject->get_session_var('sourcetableprefix');\n\n\t\t// Per page vars\n\t\t$start_at\t\t= $sessionobject->get_session_var('startat');\n\t\t$per_page\t\t= $sessionobject->get_session_var('perpage');\n\t\t$class_num\t\t= substr(get_class($this) , -3);\n\t\t$idcache \t\t= new ImpExCache($Db_target, $t_db_type, $t_tb_prefix);\n\t\t$ImpExData\t\t= new ImpExData($Db_target, $sessionobject, 'attachment');\n\t\t$dir \t\t\t= $sessionobject->get_session_var('attachmentsfolder');\n\t\t\n\t\t// Start the timing\n\t\tif(!$sessionobject->get_session_var(\"{$class_num}_start\"))\n\t\t{\n\t\t\t$sessionobject->timing($class_num , 'start' ,$sessionobject->get_session_var('autosubmit'));\n\t\t}\n\n\t\t// Get an array data\n\t\tif ($s_db_type == 'mysql')\n\t\t{\n\t\t\t$data_array = $this->get_source_data($Db_source, $s_db_type, \"{$s_tb_prefix}attachments\", 'attach_id', 0, $start_at, $per_page);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$data_array = $this->get_phpbb3_attach($Db_source, $s_db_type, $s_tb_prefix, $start_at, $per_page);\n\t\t}\t\t\n\t\t\n\n\t\t$displayobject->print_per_page_pass($data_array['count'], $displayobject->phrases['attachments'], $start_at);\n\n\t\tforeach ($data_array['data'] as $import_id => $data)\n\t\t{\n\t\t\t\t$try = (phpversion() < '5' ? $ImpExData : clone($ImpExData));\n\n\t\t\t\tif(!is_file($dir . '/' . $data['physical_filename']))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now(\"<br /><b>{$displayobject->phrases['source_file_not']} </b> :: {$data['real_filename']}\");\n\t\t\t\t\t$sessionobject->add_error($import_id, $displayobject->phrases['attachment_not_imported'], $data['real_filename'] . ' - ' . $displayobject->phrases['attachment_not_imported_rem_1']);\n\t\t\t\t\t$sessionobject->set_session_var($class_num . '_objects_failed',$sessionobject->get_session_var($class_num. '_objects_failed') + 1 );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$file = $this->vb_file_get_contents($dir . '/' . $data['physical_filename']);\n\n\t\t\t\t// Mandatory\n\t\t\t\t$try->set_value('mandatory', 'filename',\t\t\t\taddslashes($data['real_filename']));\n\t\t\t\t$try->set_value('mandatory', 'filedata',\t\t\t\t$file);\n\t\t\t\t$try->set_value('mandatory', 'importattachmentid',\t\t$import_id);\n\n\t\t\t\t// Non Mandatory\n\t\t\t\t$try->set_value('nonmandatory', 'userid',\t\t\t\t$idcache->get_id('user', $data['poster_id']));\n\t\t\t\t$try->set_value('nonmandatory', 'dateline',\t\t\t\t$data['filetime']);\n\t\t\t\t$try->set_value('nonmandatory', 'visible',\t\t\t\t'1');\n\t\t\t\t$try->set_value('nonmandatory', 'counter',\t\t\t\t$data['download_count']);\n\t\t\t\t$try->set_value('nonmandatory', 'filesize',\t\t\t\t$data['filesize']);\n\t\t\t\t$try->set_value('nonmandatory', 'postid',\t\t\t\t$data['post_msg_id']);\n\t\t\t\t$try->set_value('nonmandatory', 'filehash',\t\t\t\tmd5($file));\n\n\t\t\t\tif (!$file)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t// Check if object is valid\n\t\t\tif($try->is_valid())\n\t\t\t{\n\t\t\t\tif($try->import_attachment($Db_target, $t_db_type, $t_tb_prefix))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now('<br /><span class=\"isucc\"><b>' . $try->how_complete() . '%</b></span> ' . $displayobject->phrases['attachment'] . ' -> ' . $data['real_filename']);\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_done\",intval($sessionobject->get_session_var(\"{$class_num}_objects_done\")) + 1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t\t$sessionobject->add_error($Db_target, 'warning', $class_num, $import_id, $displayobject->phrases['attachment_import_error'], $displayobject->phrases['attachment_error_rem']);\n\t\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['failed']} :: {$displayobject->phrases['attachment_not_imported']}\");\n\t\t\t\t}// $try->import_attachment\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t$sessionobject->add_error($Db_target, 'invalid', $class_num, $import_id, $displayobject->phrases['invalid_object'] . ' ' . $try->_failedon, $displayobject->phrases['invalid_object_rem']);\n\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['invalid_object']}\" . $try->_failedon);\n\t\t\t}// is_valid\n\t\t\tunset($try);\n\t\t}// End foreach\n\n\t\t// Check for page end\n\t\tif ($data_array['count'] == 0 OR $data_array['count'] < $per_page)\n\t\t{\n\t\t\t$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));\n\t\t\t$sessionobject->remove_session_var(\"{$class_num}_start\");\n\n\t\t\t$displayobject->update_html($displayobject->module_finished($this->_modulestring,\n\t\t\t\t$sessionobject->return_stats($class_num, '_time_taken'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_done'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_failed')\n\t\t\t));\n\n\t\t\t$sessionobject->set_session_var($class_num , 'FINISHED');\n\t\t\t$sessionobject->set_session_var('module', '000');\n\t\t\t$sessionobject->set_session_var('autosubmit', '0');\n\t\t}\n\n\t\t$sessionobject->set_session_var('startat', $data_array['lastid']);\n\t\t$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));\n\t}", "abstract protected function doSuspend();", "protected function restart()\n {\n $this->stop();\n $this->start();\n }", "protected function tryAgain()\n {\n $this->invoice->status = 'overdue';\n if ($this->invoice->num_tries >= 3) {\n $this->invoice->status = 'error';\n }\n\n $this->invoice->try_on_date = Carbon::tomorrow(env('TIMEZONE'))->timezone('UTC');\n $this->invoice->increment('num_tries');\n $this->invoice->save();\n\n event(new InvoiceWasNotPaid($this->invoice));\n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "public function restart(): void\n {\n $this->stop();\n $this->start();\n }", "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function reactivate($subscription_id)\n {\n // TODO: Check if subscription is cancelled\n return ChargeBee_Subscription::reactivate($subscription_id)->subscription();\n }", "public function renewSubscription(){\n $payload = \\file_get_contents(\"php://input\");\n $payload = json_decode($payload);\n \n //$this->db->insert(\"data_logs\",array(\"data\"=>json_encode($payload)));\n $sig_header = $_SERVER[\"HTTP_STRIPE_SIGNATURE\"];\n\n $event = null;\n \n $endpoint_secret = \"whsec_fTUGlyFGWCksjdBMBSRarWFGmCNSdqBb\";\n \n try {\n //$event = \\Stripe\\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); \n //$event = $stripe->events()->find(str_replace(\"&#039;\", \"\", $payload->id));\n //print_r($event);\n //die();\n //if (isset($event) && $event->type == \"invoice.payment_failed\") {\n if(isset($payload) && $payload->type== \"invoice.payment_failed\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n\t\t\t\t$this->Users_model->updateUserDetail($id,array('is_premium'=>0));\n\n\t\t\t\tif($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 0,\n ]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n $status = $stripe->subscriptions()->cancel($subscription->customer_id, $subscription->subscription_id);\n $cancelCard = CreditCards::where('user_id', $order->user_id)->delete();\n \n $subscription->update([\n 'is_cancelled' => 1,\n \"is_premium\" => 0\n ]);*/\n \n }else if(isset($payload) && $payload->type == \"invoice.payment_succeeded\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n $next_recharge_date = next_recharge_date($user['plan_duration']);\n \t$array_payment_log = array(\n\t \"user_id\" => $id,\n\t \"plan_id\" => $user['plan_id'],\n\t \"merchant_response\" => json_encode($payload),\n\t \"charge_date\" => date(\"Y-m-d\"),\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\n\t $insert = array(\n\t 'user_id' => $id,\n\t 'plan_name' => $user['plan_heading'],\n\t 'date' => date('Y-m-d'),\n\t 'next_recharge_date' => $next_recharge_date,\n\t 'plan_id' => $user['plan_id'],\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\t if($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\t\n\t $this->Users_model->insertpaymentLogs($array_payment_log);\n\t $this->Users_model->insertChannelSubscriptionDetail($insert);\n\t $this->Users_model->updateUserDetail($id,array('is_premium'=>1));\n\n //$subscription_duration = $this->config->getByName('subscription_duration');\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 1,\n 'premium_start_date' => Carbon::now(),\n 'premium_end_date' => Carbon::now()->addDays($subscription_duration->value)\n ]);\n \n $order->update(['status' => 'success', 'expiry_date' => Carbon::now()->addDays($subscription_duration->value)]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n \n $subscription->update([\n 'is_cancelled' => 0,\n 'start_date' => Carbon::now(),\n 'end_date' => Carbon::now()->addDays($subscription_duration->value),\n 'plan_name' => 'Your next billing date at \n '.Carbon::now()->addDays($subscription_duration->value)->toDateString()\n ]);*/ \n }\n }catch(\\Cartalyst\\Stripe\\Exception\\UnexpectedValueException $e) {\n // Invalid payload\n print_r($e);\n http_response_code(400); // PHP 5.4 or greater\n exit();\n }\n\n \n }", "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 cancelApproval(InvoiceInterface $invoice): void;", "protected function suspendDocuments($entityID, $recyclingEntityID)\n\t{\n\t\t$manager = Crm\\Integration\\DocumentGeneratorManager::getInstance();\n\t\tif($manager->isEnabled())\n\t\t{\n\t\t\t$manager->transferDocumentsOwnership(\n\t\t\t\t$this->getEntityTypeID(),\n\t\t\t\t$entityID,\n\t\t\t\t$this->getSuspendedEntityTypeID(),\n\t\t\t\t$recyclingEntityID\n\t\t\t);\n\t\t}\n\t}", "static public function skipSubscriptionCheck()\n\t{\n\t\tself::$_skipSubscriptionCheck = false;\n\t}", "function unsuspend($office, $sale_id)\n {\n // $sale_id = $this->input->post('suspended_sale_id');\n $this->sale_lib->clear_all();\n $this->sale_ticket_lib->copy_entire_sale($sale_id, strtolower(get_class()));\n $this->sale_lib->set_suspended_sale_id($sale_id);\n $this->_reload(array(), false);\n }", "public function subscription(): SubscriptionReceiptInterface;", "public function reprova()\n {\n $this -> estadoAtual -> reprova($this);\n }", "public function suspend()\n {\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = false;\n $this->suspended = true;\n\n $this->saveToVariableHandlers();\n\n $keys = array_keys($this->variables);\n $count = count($keys);\n $handlers = $this->workflow->getVariableHandlers();\n\n for ($i = 0; $i < $count; $i++) {\n if (isset($handlers[$keys[$i]])) {\n unset($this->variables[$keys[$i]]);\n }\n }\n\n $this->doSuspend();\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionSuspended($this);\n }\n }", "public function cancel() : self\n {\n $subscription = $this->asStripeSubscription();\n $subscription->cancel_at_period_end = true;\n $subscription->save();\n\n $this->stripe_status = $subscription->status;\n\n // If the user was on trial, we will set the grace period to end when the trial\n // would have ended. Otherwise, we'll retrieve the end of the billing period\n // period and make that the end of the grace period for this current user.\n if ($this->onTrial()) {\n $this->ends_at = $this->trial_ends_at;\n } else {\n $this->ends_at = Carbon::createFromTimestamp(\n $subscription->current_period_end\n )->toDayDateTimeString();\n }\n\n $this->save();\n\n return $this;\n }", "public function test_error_get_complete_pos_daily_cash_resume_failed_flag_complete_resume_param()\n {\n $posCashDeskId = 1;\n $timestampNow = Carbon::now()->toDateTimeString();\n $bCompleteResume = \"this is a string\";\n $resumePosDailyCashService = new ResumePosDailyCashService($posCashDeskId, $timestampNow, $bCompleteResume);\n }", "public function removeWithDependencies(Resume $resume): bool;", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function reactivate(string $subscriptionId, array $parameters = []): ApiResponse\n {\n if (! isset($parameters['plan'])) {\n $subscription = $this->find($subscriptionId);\n\n $parameters['plan'] = $subscription['plan']['id'];\n }\n\n $parameters['cancel_at_period_end'] = false;\n\n return $this->update($subscriptionId, $parameters);\n }", "public function resumeTransactionIterator(\n $resumeState,\n ?array $accountsFilter\n ): RegisteredIterator {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_transaction_iterator',\n [\n 'resume_state' => $resumeState,\n 'accounts_filter' => $accountsFilter,\n ]\n )->wait()\n );\n }", "protected function resumeRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
[ "0.7350481", "0.72131974", "0.69684464", "0.6923316", "0.6608048", "0.6504486", "0.64773655", "0.64365953", "0.6429329", "0.6361147", "0.63473946", "0.60633546", "0.60632056", "0.59223115", "0.5916085", "0.58291566", "0.58211297", "0.56006455", "0.55965924", "0.5586956", "0.5561895", "0.55082506", "0.550097", "0.54084885", "0.5372744", "0.53717124", "0.53560245", "0.53186965", "0.52808416", "0.5268326", "0.5257747", "0.52282405", "0.5208722", "0.52016675", "0.5191798", "0.51283", "0.51124305", "0.50831074", "0.5067276", "0.50369805", "0.49493024", "0.49492922", "0.49465984", "0.49380502", "0.4936574", "0.4917285", "0.48826262", "0.48801395", "0.4875718", "0.48667276", "0.48666242", "0.48666242", "0.48666242", "0.48313338", "0.48177436", "0.48068318", "0.47682783", "0.47578353", "0.47304666", "0.47010067", "0.469916", "0.4682471", "0.46823955", "0.46767366", "0.46759102", "0.4637395", "0.46287495", "0.4627155", "0.46269053", "0.46226075", "0.46167374", "0.46112543", "0.45856205", "0.4577917", "0.45757425", "0.4567649", "0.45566797", "0.45565084", "0.4541785", "0.453305", "0.45294043", "0.452718", "0.45232823", "0.45151225", "0.45050833", "0.45045596", "0.4500904", "0.44867104", "0.44792172", "0.4467781", "0.44650304", "0.44536734", "0.44506428", "0.44504023", "0.4443863", "0.44375998", "0.44314232", "0.44218105", "0.44101343", "0.440505" ]
0.55006653
23
Operation resumeWithHttpInfo Resume Subscription
public function resumeWithHttpInfo($id) { $request = $this->resumeRequest($id); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Subscription' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Subscription' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Subscription', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Subscription'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function resume();", "public function getResumeContextResponse();", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public function resume($id)\n {\n list($response) = $this->resumeWithHttpInfo($id);\n return $response;\n }", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "public function resumeAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->resumeRequest($id);\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 static function resumeById(int $id, mixed ...$data): mixed;", "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "abstract protected function doResume();", "public function resume($subscription_id)\n {\n return ChargeBee_Subscription::removeScheduledCancellation($subscription_id)->subscription();\n }", "public function update(Request $request, Resume $resume)\n {\n //\n }", "public function resume(Auth $auth)\n {\n // do nothing\n }", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "abstract protected function doResumeContext();", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "public function resumeContextAccess(AccountInterface $account);", "public function resume(Timer $timer);", "public function resume(): bool {}", "public function resume(): bool;", "protected function resumeRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseAsyncWithHttpInfo($id, $pause_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->pauseRequest($id, $pause_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 }", "function campaignResume($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignResume\", $params);\n }", "public function reactivate(string $subscriptionId, array $parameters = []): ApiResponse\n {\n if (! isset($parameters['plan'])) {\n $subscription = $this->find($subscriptionId);\n\n $parameters['plan'] = $subscription['plan']['id'];\n }\n\n $parameters['cancel_at_period_end'] = false;\n\n return $this->update($subscriptionId, $parameters);\n }", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function resumeAsync($id)\n {\n return $this->resumeAsyncWithHttpInfo($id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "public function resume($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('resume', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function setResume(?string $resume): self\n {\n $this->resume = $resume;\n\n return $this;\n }", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }", "public function resume(): array {\n\t\t\t\n\t\t\t$data =\n\t\t\t [\n\t\t\t\t'apartment' => $this->apartment,\n\t\t\t\t'stay' => [\n\t\t\t\t 'check_in' => $this->check_in->format('d-m-Y'),\n\t\t\t\t 'check_out' => $this->check_out->format('d-m-Y'),\n\t\t\t\t 'requests' => $this->special_requests\n\t\t\t\t],\n\t\t\t\t'pending_upgrades' => [],\n\t\t\t ];\n\t\t\tforeach ($this->bookedServices as $bookedService) {\n\t\t\t\t$data['pending_upgrades'][] = $bookedService->slug;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function cancelWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $request = $this->cancelRequest($id, $cancel_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function testResumeMember()\n {\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function cancelApproval(InvoiceInterface $invoice): void;", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}", "public function cancelPaymentLinkRequest($x_client_id, $x_client_secret, $link_id, $x_api_version = '2022-01-01')\n {\n // verify the required parameter 'x_client_id' is set\n if ($x_client_id === null || (is_array($x_client_id) && count($x_client_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $x_client_id when calling cancelPaymentLink'\n );\n }\n // verify the required parameter 'x_client_secret' is set\n if ($x_client_secret === null || (is_array($x_client_secret) && count($x_client_secret) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $x_client_secret when calling cancelPaymentLink'\n );\n }\n // verify the required parameter 'link_id' is set\n if ($link_id === null || (is_array($link_id) && count($link_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $link_id when calling cancelPaymentLink'\n );\n }\n\n $resourcePath = '/links/{link_id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // header params\n if ($x_client_id !== null) {\n $headerParams['x-client-id'] = ObjectSerializer::toHeaderValue($x_client_id);\n }\n // header params\n if ($x_client_secret !== null) {\n $headerParams['x-client-secret'] = ObjectSerializer::toHeaderValue($x_client_secret);\n }\n // header params\n if ($x_api_version !== null) {\n $headerParams['x-api-version'] = ObjectSerializer::toHeaderValue($x_api_version);\n }\n $platform = 'phpsdk_2.1.0';\n $headerParams['x-sdk-platform'] = ObjectSerializer::toHeaderValue($platform);\n\n // path params\n if ($link_id !== null) {\n $resourcePath = str_replace(\n '{' . 'link_id' . '}',\n ObjectSerializer::toPathValue($link_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "public function cancelSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionsRequest', $parameters);\n }", "protected function auditAccountRequest($id, $start = null, $end = null, $top = '10', $skip = '0', $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling auditAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/audit';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start !== null) {\n $queryParams['start'] = ObjectSerializer::toQueryValue($start);\n }\n // query params\n if ($end !== null) {\n $queryParams['end'] = ObjectSerializer::toQueryValue($end);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['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 $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 // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function test_error_get_complete_pos_daily_cash_resume_failed_flag_complete_resume_param()\n {\n $posCashDeskId = 1;\n $timestampNow = Carbon::now()->toDateTimeString();\n $bCompleteResume = \"this is a string\";\n $resumePosDailyCashService = new ResumePosDailyCashService($posCashDeskId, $timestampNow, $bCompleteResume);\n }", "public function getDetailsForResumeId(int $resumeId, string $locale): ResumeDetailsDto;", "function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }", "protected function initiateSubRequest() {}", "public function show($resume_id) // full preview\n {\n\n $resume = Resume::where('resumes.id', $resume_id)->first();\n// resume translated language\n $resume_translated_language = $resume->translated_languages_id;\n $show_resume = Resume::where('id', $resume_id)->with([\n 'user',\n 'personalInformation.placeOfBirth',\n 'personalInformation.currentLocation',\n 'summary',\n 'objective',\n 'contactInformation.emails',\n 'contactInformation.contactNumbers', 'contactInformation.internetCommunications.internetCommunicationType', 'contactInformation.personalLinks.socialMedia',\n 'educations.projects',\n 'languages.diplomas',\n 'drivingLicense.categories',\n 'achievements',\n 'work_experiences.company',\n 'hobbiesInterest',\n 'memberships',\n 'projects',\n 'publications',\n 'volunteers',\n 'ConferencesWorkshopSeminar',\n 'Portfolio',\n 'certifications',\n 'trainings',\n// 'reReferences',\n 'skills'\n ])->\n with(array('personalInformation.maritalStatus.maritalStatusTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['marital_status_id', 'name']);\n }))->\n with(array('personalInformation.nationalities.nationalityTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['nationality_id', 'name']);\n }))\n ->with(array('contactInformation.contactNumbers.phoneType.PhoneTypeTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['phone_type_id', 'name']);\n }))->\n with(array('contactInformation.contactNumbers.country.countryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['country_id', 'name']);\n }))\n ->with(array('languages.internationalLanguage.internationalLanguageTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['international_language_id', 'name']);\n }))\n ->with(array('languages.languageAssessment.selfAssessment.selfAssessmentTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['self_assessment_id', 'name']);\n }))\n ->with(array('languages.languageAssessment.selfAssessment.selfAssessmentTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['self_assessment_id', 'name']);\n }))\n ->with(array('languages' => function ($query) {\n $query->orderBy('order');\n }))\n\n ->with(array('drivingLicense.country.countryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['country_id', 'name']);\n }))\n ->with(array('educations.major.majorTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['major_id', 'name']);\n }))\n ->with(array('educations.minor.minorTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['minor_id', 'name']);\n }))\n ->with(array('educations.institution.institutionTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['institution_id', 'name']);\n }))\n ->with(array('educations.degreeLevel.degreeLevelTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['degree_level_id', 'name']);\n }))\n ->with(array('educations' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('work_experiences.company_industry.companyIndustryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['company_industry_id', 'name']);\n }))\n ->with(array('work_experiences.company.company_size.company_size_translation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['company_size_id', 'name']);\n }))\n ->with(array('work_experiences.employment_types.employment_type_parent.empTypeParentTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['employment_type_parent_id', 'name']);\n }))\n ->with(array('work_experiences.employment_types.employment_type_parent.parent_category.empTypeParentTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['employment_type_parent_id', 'name']);\n }))\n ->with(array('work_experiences' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('ConferencesWorkshopSeminar.conferenceType.conferenceTypeTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['conference_type_id', 'name']);\n \n }))\n ->with(array('ConferencesWorkshopSeminar' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('Portfolio' => function ($query) {\n $query->orderBy('order');\n }))\n\n ->with(array('publications' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('projects' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('volunteers' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('memberships' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('achievements' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('certifications.validYear.validYearTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['valid_year_id', 'name']);\n }))\n ->with(array('certifications' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('trainings' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('reReferences.reference_info.country.countryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['country_id', 'name']);\n }))\n ->with(array('reReferences.reference_info' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('skills.skill_type.skillTypeTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['skill_type_id', 'name',]);\n }))\n ->with(array('skills.skill_type.skill_type_parent.skillTypeParentTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['skill_type_parent_id', 'name']);\n }))\n ->with(array('skills.skillLevel.skillLevelTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['skill_level_id', 'name']);\n }))\n ->with(array('skills' => function ($query) {\n $query->orderBy('order');\n }))\n ->first(['id', 'user_id', 'name', 'translated_languages_id']);\n return $this->showOne($show_resume);\n }", "private function getResponse(PaymentInterface $payment) {\n $response = $payment->getPaymentType()->getResumeContextResponse();\n return $response->getResponse();\n }", "public function expirePrivateKeyWithHttpInfo($key)\n {\n $returnType = '';\n $request = $this->expirePrivateKeyRequest($key);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 400:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 401:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 403:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 404:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 429:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 500:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Reepay\\Model\\ErrorResponse',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function reopenInvoice() {\n\n $client = new \\app\\components\\OdooClient();\n $account_invoice_ids = $client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"in_invoice\"],\n [\"journal_id\", \"=\", 22]\n ]);\n\n $result = $client->execute(\"account.invoice\", \"signal_workflow\",\n [\n $account_invoice_ids,\n \"invoice_cancel\"\n ]);\n\n print_r($result);\n\n }", "public function resume()\n\t{\n\t\treturn $this->belongsTo('App\\Resume');\n\t}", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}", "public function pause($id, $pause_subscription_request = null)\n {\n list($response) = $this->pauseWithHttpInfo($id, $pause_subscription_request);\n return $response;\n }", "public static function init(int $version): self\n {\n return new self(new CancelInvoiceRequest($version));\n }", "public function doPreflightCallback(RequestInterface &$request): ClientInterface;", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function subscribe()\n {\n $url = 'https://api.instagram.com/v1/subscriptions/';\n $params = [\n 'client_id' => $this->getClientId(),\n 'client_secret' => $this->getClientSecret(),\n 'object' => 'user',\n 'aspect' => 'media',\n 'verify_token' => '592180',\n 'callback_url' => $this->_url->sessionUrlVar(\n $this->_url->getUrl($this->subscribe_redirect)\n )\n ];\n $this->_httpRequest($url, 'POST', $params);\n }", "public function processIpnRequest($data)\n {\n $this->post = $data;\n \n $recurringProfile = $this->getRecurringProfile();\n\n\n if (! $recurringProfile) {\n return;\n }\n\n if (! $this->_postBack()) {\n return;\n }\n\n try {\n if (isset($this->post['txn_type'])\n && 'recurring_payment_suspended_due_to_max_failed_payment' == $this->post['txn_type']\n ) {\n if ($lastInvoiceId = $recurringProfile->saas_subscription_invoice_id) {\n $this->invoiceRepository->update([\n 'status' => 'Failed',\n ], $lastInvoiceId);\n }\n\n $this->recurringProfileRepository->update([\n 'state' => $this->paypalHelper->getProfileState($this->post['profile_status']),\n 'payment_status' => 'Failed',\n ], $recurringProfile->id);\n\n //Send email to company\n } elseif (isset($this->post['txn_type'])\n && 'recurring_payment_suspended' == $this->post['txn_type']\n ) {\n $this->recurringProfileRepository->update([\n 'state' => $this->paypalHelper->getProfileState($this->post['profile_status']),\n ], $recurringProfile->id);\n } elseif (isset($this->post['txn_type'])\n && 'recurring_payment_profile_cancel' == $this->post['txn_type']\n ) {\n $this->recurringProfileRepository->update([\n 'state' => $this->paypalHelper->getProfileState($this->post['profile_status']),\n 'next_due_date' => null,\n ], $recurringProfile->id);\n } elseif (isset($this->post['txn_type'])\n && 'recurring_payment_skipped' == $this->post['txn_type']\n ) {\n // Recurring payment skipped; it will be retried up to 3 times, 5 days apart\n $days = 0;\n\n if ($recurringProfile->payment_method != 'Skipped') {\n $days = 5;\n\n $invoice = $this->subscriptionHelper->createInvoice([\n 'recurring_profile' => $recurringProfile,\n 'saas_subscription_purchased_plan_id' => $recurringProfile->purchased_plan->id,\n 'saas_subscription_recurring_profile_id' => $recurringProfile->id,\n 'grand_total' => $recurringProfile->amount,\n 'customer_email' => $recurringProfile->company->email,\n 'customer_name' => $recurringProfile->company->username,\n 'payment_method' => 'Paypal',\n 'status' => 'Skipped',\n ]);\n \n $this->recurringProfileRepository->update([\n 'payment_status' => 'Skipped',\n 'saas_subscription_invoice_id' => $invoice->id,\n ], $recurringProfile->id);\n }\n\n //send email to company\n } elseif (isset($this->post['txn_type'])\n && 'recurring_payment' == $this->post['txn_type']\n && $this->post['payment_status'] == \"Pending\"\n ) {\n if ($recurringProfile->payment_status != 'Skipped') {\n $invoice = $this->subscriptionHelper->createInvoice([\n 'recurring_profile' => $recurringProfile,\n 'saas_subscription_purchased_plan_id' => $recurringProfile->purchased_plan->id,\n 'saas_subscription_recurring_profile_id' => $recurringProfile->id,\n 'grand_total' => $this->post['mc_gross'],\n 'customer_email' => $recurringProfile->company->email,\n 'customer_name' => $recurringProfile->company->username,\n 'payment_method' => 'Paypal',\n 'status' => 'Pending',\n 'pending_reason' => $this->post['pending_reason'],\n ]);\n } else {\n $data = [\n 'status' => 'Pending',\n 'payment_method' => 'Paypal',\n ];\n\n if (isset($this->post['pending_reason'])) {\n $data['pending_reason'] = $this->post['pending_reason'];\n }\n \n $this->invoiceRepository->update($data, $recurringProfile->saas_subscription_invoice_id);\n }\n\n $this->recurringProfileRepository->update([\n 'payment_status' => 'Pending',\n 'saas_subscription_invoice_id' => isset($invoice)\n ? $invoice->id\n : $recurringProfile->saas_subscription_invoice_id,\n ], $recurringProfile->id);\n } elseif (isset($this->post['txn_type'])\n && 'recurring_payment' == $this->post['txn_type']\n ) {\n $invoice = $this->invoiceRepository->findOneByField('transaction_id', $this->post['txn_id']);\n\n if ($invoice) {\n return;\n }\n\n $nextDueDate = $this->subscriptionHelper->getNextDueDate($recurringProfile);\n\n if ($recurringProfile->payment_status != 'Skipped'\n && $recurringProfile->payment_status != 'Pending'\n ) {\n $invoice = $this->subscriptionHelper->createInvoice([\n 'recurring_profile' => $recurringProfile,\n 'saas_subscription_purchased_plan_id' => $recurringProfile->purchased_plan->id,\n 'saas_subscription_recurring_profile_id' => $recurringProfile->id,\n 'grand_total' => $this->post['mc_gross'],\n 'cycle_expired_on' => $nextDueDate,\n 'customer_email' => $recurringProfile->company->email,\n 'customer_name' => $recurringProfile->company->username,\n 'payment_method' => 'Paypal',\n 'status' => 'Success',\n 'transaction_id' => $this->post['txn_id'],\n ]);\n } else {\n $this->invoiceRepository->update([\n 'cycle_expired_on' => $nextDueDate,\n 'status' => 'Success',\n 'payment_method' => 'Paypal',\n ], $recurringProfile->saas_subscription_invoice_id);\n }\n \n $this->recurringProfileRepository->update([\n 'next_due_date' => $nextDueDate,\n 'cycle_expired_on' => $nextDueDate,\n 'payment_status' => 'Success',\n 'saas_subscription_invoice_id' => isset($invoice)\n ? $invoice->id\n : $recurringProfile->saas_subscription_invoice_id,\n ], $recurringProfile->id);\n }\n } catch (\\Exception $e) {\n }\n }", "public function newResumeService(\n AdapterInterface $adapter = null,\n $idle_ttl = 3600, // 1 hour\n $expire_ttl = 86400 // 24 hours\n ) {\n\n $adapter = $this->fixAdapter($adapter);\n\n $timer = new Session\\Timer(\n ini_get('session.gc_maxlifetime'),\n ini_get('session.cookie_lifetime'),\n $idle_ttl,\n $expire_ttl\n );\n\n $logout_service = new Service\\LogoutService(\n $adapter,\n $this->session\n );\n\n return new Service\\ResumeService(\n $adapter,\n $this->session,\n $timer,\n $logout_service\n );\n }", "public function cancelOrderReference($requestParameters = array());", "public function update(ResumeRequest $request, Resume $resume)\n {\n $data = $request->only(['name','profession','about', 'email','phoneNo','birthday' ,'county','facebook','twitter','insta' ,\n 'resumeContent','school','qualification','dateFromEd','dateToEd','employer','position','from',\n 'to','skill1','skill2','skill3']);\n\n if($request->hasFile('image')){\n $image = $request->image->store('candidate');\n\n Storage::delete($resume->image);\n\n $data['image'] = $image;\n\n }else{\n\n $resume->update($data);\n }\n\n\n\n session()->flash('success','Your resume has been update successfuly');\n\n return redirect()->route('resume.create')->with('resume',Resume::where('user_id', '=', auth()->id())->first());\n }", "public function update($id, Request $request)\n\t{\n\t\t$profile = Profile::findOrFail($id);\n\t\t$resume = $profile->resume;\n\t\t$resume->cv = $request->input('cv');\n\n\t\t$file_name = 'cv'. $profile->id . '.' . \n\t\t\t$request->file('file')->getClientOriginalExtension();\n\t\t$resume->file_path = public_path() . \"\\\\resumes\\\\\" . $file_name;\n\t\t$request->file('file')->move(\n\t\t\t'resumes', $file_name\n\t\t\t);\n\n\t\ttry {\n\t\t\t$profile->resume()->save($resume);\t\t\t\n\t\t} catch(\\Exception $e) {\n\t\t\treturn redirect()->route('profile_resume.edit', [$profile])->withErrors(['error' => $e->getMessage()]);\n\t\t}\n\n\t\t\n\t\treturn view('profile_resume.index', compact('profile'));\t\t\n\t}", "public function newResumeAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $produit = $em->getRepository('KountacBundle:Produits_1')->find($id);\n $user = $this->getUser();\n \n return $this->render('produits/new_resume.html.twig', array(\n 'produit' => $produit,\n 'user' => $user,\n ));\n }", "protected function suspendTrainee($id){\n Trainee::where('id',$id)->update(array('status' => 'suspended'));\n $email = Trainee::where('id',$id)->value('email_address');\n $subject = \"Account Suspension\";\n // $this->email_function->basic_email($email);\n return redirect()->back()->with('message','A trainee has been Suspended Successfully and notified via email');\n }", "public function resumeTransactionIterator(\n $resumeState,\n ?array $accountsFilter\n ): RegisteredIterator {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_transaction_iterator',\n [\n 'resume_state' => $resumeState,\n 'accounts_filter' => $accountsFilter,\n ]\n )->wait()\n );\n }", "public function cancelrecurring($id,$userid)\n {\n if($userid!='')\n {\n if(Options::getoptionmatch3('paypal_mode')=='0')\n { \n $username = Options::getoptionmatch3('sandbox_username');\n $password = Options::getoptionmatch3('sandbox_password');\n $signature = Options::getoptionmatch3('sandbox_signature');\n }else\n {\n $username = Options::getoptionmatch3('live_username');\n $password = Options::getoptionmatch3('live_password');\n $signature = Options::getoptionmatch3('live_signature');\n }\n $curl = curl_init();\n $user_id=$userid;\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp');\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(\n 'USER' => $username, //Your API User\n 'PWD' => $password, //Your API Password\n 'SIGNATURE' => $signature, //Your API Signature\n\n 'VERSION' => '108',\n 'METHOD' => 'ManageRecurringPaymentsProfileStatus',\n 'PROFILEID' => $id, //here add your profile id \n 'ACTION' => 'Cancel' //this can be selected in these default paypal variables (Suspend, Cancel, Reactivate)\n )));\n\n $response = curl_exec($curl);\n\n curl_close($curl);\n\n $nvp = array();\n\n if (preg_match_all('/(?<name>[^\\=]+)\\=(?<value>[^&]+)&?/', $response, $matches)) {\n foreach ($matches['name'] as $offset => $name) {\n $nvp[$name] = urldecode($matches['value'][$offset]);\n }\n }\n \n\n //printf(\"<pre>%s</pre>\",print_r($nvp, true)); die; \n if($nvp['ACK']=='Success')\n {\n Transaction::updateoption2(array('recurring'=>'0'),array('transaction_id'=>$id,'user_id'=>$userid));\n $messags['message'] = \"Recurring has been canceled successfully.\";\n $messags['status']= 1; \n }else\n {\n $messags['message'] = \"Error to cancel a recurring.\";\n $messags['status']= 0; \n }\n }\n \n echo json_encode($messags);\n die;\n }", "public function previous()\n {\n $this->soap(\"AVTransport\", \"Previous\");\n\n return $this;\n }", "public function restoreInstanceWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->backupId)) {\n $query['BackupId'] = $request->backupId;\n }\n if (!Utils::isUnset($request->filterKey)) {\n $query['FilterKey'] = $request->filterKey;\n }\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->restoreTime)) {\n $query['RestoreTime'] = $request->restoreTime;\n }\n if (!Utils::isUnset($request->restoreType)) {\n $query['RestoreType'] = $request->restoreType;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->timeShift)) {\n $query['TimeShift'] = $request->timeShift;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RestoreInstance',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RestoreInstanceResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function resume(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Resume List';\n\t\t$data['resume_list'] = $this->common_model->get_all('fr_resume', '');\n\t\t$this->set_layout('resume/resume_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "protected function setSubscriptionStatusData(Subscription $subscription): void\n {\n $this->configureStripeClient();\n $subscriptionData = $subscription->getSubscriptionData();\n $canceledAt = $subscriptionData['canceled_at'];\n $endedAt = $subscriptionData['ended_at'];\n $status = $subscriptionData['status'];\n\n switch ($status) {\n // Somebody didn't manage to provide/authenticate a payment method\n case 'incomplete_expired':\n $subscription->isExpired = true;\n $subscription->dateExpired = $endedAt ? DateTimeHelper::toDateTime($endedAt) : null;\n $subscription->isCanceled = false;\n $subscription->dateCanceled = null;\n $subscription->nextPaymentDate = null;\n break;\n // Definitely not suspended\n case 'active':\n $subscription->isSuspended = false;\n $subscription->dateSuspended = null;\n break;\n // Suspend this and make a guess at the suspension date\n case 'past_due':\n $timeLastInvoiceCreated = $subscriptionData['latest_invoice']['created'] ?? null;\n $dateSuspended = $timeLastInvoiceCreated ? DateTimeHelper::toDateTime($timeLastInvoiceCreated) : null;\n $subscription->dateSuspended = $subscription->isSuspended ? $subscription->dateSuspended : $dateSuspended;\n $subscription->isSuspended = true;\n break;\n case 'canceled':\n $subscription->isExpired = true;\n $subscription->dateExpired = $endedAt ? DateTimeHelper::toDateTime($endedAt) : null;\n }\n\n // Make sure we mark this as started, if appropriate\n $subscription->hasStarted = !in_array($status, ['incomplete', 'incomplete_expired']);\n\n // Update all the other tidbits\n $subscription->isCanceled = (bool)$canceledAt;\n $subscription->dateCanceled = $canceledAt ? DateTimeHelper::toDateTime($canceledAt) : null;\n $subscription->nextPaymentDate = DateTimeHelper::toDateTime($subscriptionData['current_period_end']);\n }", "public function reverseApproval(FinancialTransactionInterface $transaction, $retry);", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "public function cancelRequestOfUserForReceivedApprovedRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceivedApprovedRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function getApiContinue( array $result ) {\n\t\treturn $result['continue']['apcontinue'] ?? false;\n\t}", "function unSubscribeById ( $id )\n {\n try\n {\n $result = $this->apiCall('delete',\"{$this->api['cms_manager_url']}/resources/subscriptions/{$id}\",array(),'json');\n return $this->createResponse($result,'Un-Subscribe','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function doWithRetry(RetryContext $context);", "public function revokeTokenCurrentRequest($options)\n {\n // unbox the parameters from the associative array\n\n\n $resourcePath = '/tokens/self';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // 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 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function onSubscriptionRenew(SubscriptionInterface $subscription, OrderInterface $order, OrderInterface $next_order);" ]
[ "0.63306177", "0.6313488", "0.6270723", "0.61454046", "0.58965796", "0.5741384", "0.5712917", "0.5666965", "0.56491536", "0.5569796", "0.5479918", "0.54406846", "0.53592277", "0.5305586", "0.5253017", "0.52213144", "0.5180112", "0.5179129", "0.5126218", "0.50806004", "0.50644714", "0.5060597", "0.48998564", "0.4801917", "0.47800127", "0.4735964", "0.46773905", "0.46455434", "0.4604424", "0.4599025", "0.4549794", "0.452638", "0.45000848", "0.44161472", "0.4375393", "0.43306708", "0.43257305", "0.42556393", "0.42404994", "0.42310598", "0.42304075", "0.42201424", "0.4204842", "0.41925183", "0.4182052", "0.41728863", "0.41474518", "0.414631", "0.41277772", "0.4092234", "0.40860465", "0.40702236", "0.40610215", "0.4044653", "0.40369675", "0.4017696", "0.39847574", "0.39847574", "0.39847574", "0.39817935", "0.39757285", "0.39579785", "0.3946126", "0.39396548", "0.39368892", "0.3930675", "0.39270672", "0.39243636", "0.39177078", "0.39176008", "0.39118275", "0.3901306", "0.38943344", "0.38939536", "0.38838798", "0.3876418", "0.38729724", "0.38710144", "0.38635793", "0.3858514", "0.38518935", "0.38517657", "0.38481653", "0.38419083", "0.38389325", "0.38368323", "0.38355604", "0.38346273", "0.38227728", "0.3818818", "0.38143656", "0.38115677", "0.3807565", "0.3801607", "0.37887478", "0.37871122", "0.3786758", "0.37851307", "0.3778694", "0.37768608" ]
0.633335
0
Operation resumeAsync Resume Subscription
public function resumeAsync($id) { return $this->resumeAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resume();", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "abstract protected function doResume();", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "public function resume(): bool {}", "public function resume(): bool;", "abstract protected function doResumeContext();", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "public function resume(Auth $auth)\n {\n // do nothing\n }", "public function resume($subscription_id)\n {\n return ChargeBee_Subscription::removeScheduledCancellation($subscription_id)->subscription();\n }", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getResumeContextResponse();", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public static function resumeById(int $id, mixed ...$data): mixed;", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "public function resume(Timer $timer);", "public function resumeContextAccess(AccountInterface $account);", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "public function resume($id)\n {\n list($response) = $this->resumeWithHttpInfo($id);\n return $response;\n }", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "public function update(Request $request, Resume $resume)\n {\n //\n }", "public function testResumeMember()\n {\n }", "public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }", "public function setResume(?string $resume): self\n {\n $this->resume = $resume;\n\n return $this;\n }", "public function resume()\n\t{\n\t\treturn $this->belongsTo('App\\Resume');\n\t}", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "protected function resumeSession(): bool\n {\n if ($this->manager->getIsActive() || $this->manager->resume()) {\n $this->load();\n\n return true;\n }\n\n return false;\n }", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "public function resumeAsyncWithHttpInfo($id)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->resumeRequest($id);\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 resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function setResumeToken(Token $token)\n {\n \t$this->update(['resume_token' => $token->id]);\n }", "function campaignResume($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignResume\", $params);\n }", "protected function _cancelOperation() {}", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function isResumed()\n {\n return $this->resumed;\n }", "public function resume(): array {\n\t\t\t\n\t\t\t$data =\n\t\t\t [\n\t\t\t\t'apartment' => $this->apartment,\n\t\t\t\t'stay' => [\n\t\t\t\t 'check_in' => $this->check_in->format('d-m-Y'),\n\t\t\t\t 'check_out' => $this->check_out->format('d-m-Y'),\n\t\t\t\t 'requests' => $this->special_requests\n\t\t\t\t],\n\t\t\t\t'pending_upgrades' => [],\n\t\t\t ];\n\t\t\tforeach ($this->bookedServices as $bookedService) {\n\t\t\t\t$data['pending_upgrades'][] = $bookedService->slug;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }", "protected function resumeRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function reopenInvoice() {\n\n $client = new \\app\\components\\OdooClient();\n $account_invoice_ids = $client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"in_invoice\"],\n [\"journal_id\", \"=\", 22]\n ]);\n\n $result = $client->execute(\"account.invoice\", \"signal_workflow\",\n [\n $account_invoice_ids,\n \"invoice_cancel\"\n ]);\n\n print_r($result);\n\n }", "public function restored(Subscription $subscription)\n {\n //\n }", "public function resume($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('resume', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function resume(array $inputData = array()) {\n if ($this->id === null) {\n throw new ExecutionException('No execution id given.');\n }\n\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = true;\n $this->suspended = false;\n\n $this->doResume();\n $this->loadFromVariableHandlers();\n\n $errors = array();\n\n foreach ($inputData as $variableName => $value) {\n if (isset($this->waitingFor[$variableName])) {\n if ($this->waitingFor[$variableName]['condition']->evaluate($value)) {\n $this->setVariable($variableName, $value);\n unset($this->waitingFor[$variableName]);\n } else {\n $errors[$variableName] = (string) $this->waitingFor[$variableName]['condition'];\n }\n }\n }\n\n if (!empty($errors)) {\n throw new InvalidInputException($errors);\n }\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionResumed($this);\n }\n\n $this->execute();\n\n // Return execution ID if the workflow has been suspended.\n if ($this->isSuspended()) {\n // @codeCoverageIgnoreStart\n return $this->id;\n // @codeCoverageIgnoreEnd\n }\n }", "public function resumed_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'resumed_hook',\n\t\t\t$context\n\t\t);\n\t}", "public static function resume(mixed $task = WatchFactory::DEFAULT_WATCH): bool\n {\n return static::getFacadeRoot()->resume($task);\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function reactivate() : self\n {\n $subscription = $this->asStripeSubscription();\n\n if ($subscription->status === 'canceled') {\n $appPlan = $this->getPlans('apps_plans_id > 0')->getFirst()->appPlan;\n $companyGroup = $this->companyGroup;\n $company = $this->company;\n $branch = $this->branch;\n $options = [];\n $customerOptions = [];\n\n //we need to recreate the subscription\n $newSubscription = new SubscriptionBuilder(\n $appPlan,\n $this->getDI()->get('app'),\n $companyGroup,\n $company,\n $branch\n );\n $newSubscriptionModel = $newSubscription\n ->withMetadata(['appPlan' => $appPlan->getId()])\n ->skipTrial()\n ->create($options, $customerOptions);\n\n $this->softDelete();\n\n return $newSubscriptionModel;\n }\n\n $subscription->cancel_at_period_end = false;\n $subscription->save();\n\n return $this;\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeTransactionIterator(\n $resumeState,\n ?array $accountsFilter\n ): RegisteredIterator {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_transaction_iterator',\n [\n 'resume_state' => $resumeState,\n 'accounts_filter' => $accountsFilter,\n ]\n )->wait()\n );\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function getResume()\n {\n return $this->hasOne(Resume::className(), ['id' => 'resume_id']);\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : $this->getDefaultOperationDescriptor();\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function restored(PlanSubscription $planSubscription)\n {\n //\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function removeWithDependencies(Resume $resume): bool;", "function suspendCurrent()\n {\n $this->currentTcb->markAsSuspended();\n return $this->currentTcb;\n }", "public function suspend()\n {\n if ($this->getState()->getMode() == View\\StateInterface::MODE_ENABLED) {\n $state = $this->getState();\n $state->setVersionId($this->getChangelog()->getVersion());\n $state->setStatus(View\\StateInterface::STATUS_SUSPENDED);\n $state->save();\n }\n }", "abstract protected function doSuspend();", "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 restart(): void\n {\n $this->stop();\n $this->start();\n }", "public function resumeBlockIterator($resumeState): RegisteredIterator\n {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_block_iterator',\n [\n 'resume_state' => $resumeState,\n ]\n )->wait()\n );\n }", "public function resume() {\n \n if (!isset($_COOKIE) || !\\array_key_exists($this->name, $_COOKIE)) {\n\n //coookie prob expired\n $this->forget();\n return false;\n }\n\n\n\n if (!$this->sessionStarted()) {\n\n if (\\session_start()) {\n $this->refresh();\n }\n }\n if (!$this->isFingerprint()) { //UA doesnt match\n $this->forget();\n return false;\n }\n\n return true;\n }", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "protected function initiateSubRequest() {}", "public function onSubscriptionRenew(SubscriptionInterface $subscription, OrderInterface $order, OrderInterface $next_order);", "public function test_error_get_complete_pos_daily_cash_resume_failed_flag_complete_resume_param()\n {\n $posCashDeskId = 1;\n $timestampNow = Carbon::now()->toDateTimeString();\n $bCompleteResume = \"this is a string\";\n $resumePosDailyCashService = new ResumePosDailyCashService($posCashDeskId, $timestampNow, $bCompleteResume);\n }", "public static function billingResumed($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('billingResumed', $callback);\n }", "public function start()\n {\n // Update worker state and set it as running (not finished)\n // Do not change resume_token because campaign can be resumed and not started\n $this->update(['has_finished' => false]);\n // Return current instance for method chaining\n return $this;\n }", "protected function restart()\n {\n $this->stop();\n $this->start();\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "public function reverseApproval(FinancialTransactionInterface $transaction, $retry);", "public function suspend()\n {\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = false;\n $this->suspended = true;\n\n $this->saveToVariableHandlers();\n\n $keys = array_keys($this->variables);\n $count = count($keys);\n $handlers = $this->workflow->getVariableHandlers();\n\n for ($i = 0; $i < $count; $i++) {\n if (isset($handlers[$keys[$i]])) {\n unset($this->variables[$keys[$i]]);\n }\n }\n\n $this->doSuspend();\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionSuspended($this);\n }\n }", "function auto_cancel($subscription_id)\n\t{\n\t\treturn NULL;\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function store(AddResumeRequest $request) {\n $data['user_id'] = auth()->user()->id;\n $data['country_id'] = $request->country_id;\n $data['state_id'] = $request->state_id;\n $data['city_id'] = $request->city_id;\n $data['first_name'] = $request->first_name;\n $data['last_name'] = $request->last_name;\n $data['about'] = $request->about;\n $data['username'] = $request->username;\n $data['email'] = $request->email;\n $data['address_line'] = $request->address_line;\n $data['zipcode'] = $request->zipcode;\n $data['path'] = \"\";\n\n // start transaction\n DB::beginTransaction();\n try {\n if ($request->hasfile('document')) {\n $name = time() . rand(1, 100) . '.' . $request->file('document')->getClientOriginalExtension();\n $request->file('document')->move(public_path('files'), $name);\n $data['path'] = $name;\n }\n\n $resume = Resume::create($data);\n\n if (!$resume) {\n DB::rollBack();\n return response(\n [\n \"code\" => \"400\",\n \"status\" => \"failed\",\n \"msg\" => 'unable to upload resume',\n ],\n 400\n );\n }\n\n DB::commit();\n return response(\n [\n \"code\" => \"200\",\n \"status\" => \"success\",\n \"data\" => $resume,\n ],\n 200\n );\n } catch (Exceprion $e) {\n DB::rollBack();\n return response(\n [\n \"code\" => \"400\",\n \"status\" => \"failed\",\n \"msg\" => 'unable to upload resume',\n ],\n 400\n );\n }\n }", "public function resume(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Resume List';\n\t\t$data['resume_list'] = $this->common_model->get_all('fr_resume', '');\n\t\t$this->set_layout('resume/resume_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}" ]
[ "0.7003484", "0.6769973", "0.6718481", "0.6544407", "0.63831425", "0.6188289", "0.6146563", "0.5991132", "0.59836096", "0.5920313", "0.5894094", "0.5859104", "0.5738698", "0.5611025", "0.5497404", "0.5497337", "0.5482257", "0.54737794", "0.5470183", "0.5383478", "0.52988034", "0.515563", "0.51435643", "0.507943", "0.49123195", "0.4819282", "0.48115617", "0.48106077", "0.4801175", "0.4780706", "0.47724876", "0.4771363", "0.47367737", "0.4718933", "0.46379656", "0.46341377", "0.46087956", "0.4581125", "0.4575397", "0.45584962", "0.45492703", "0.4517951", "0.45070997", "0.45062816", "0.44906452", "0.44859463", "0.44839722", "0.44819045", "0.4477524", "0.44731987", "0.44577035", "0.44282356", "0.44282356", "0.44282356", "0.44192478", "0.4372257", "0.43564913", "0.4340462", "0.43132755", "0.43036506", "0.42958313", "0.42958313", "0.42958313", "0.42958313", "0.42958313", "0.42958313", "0.42958313", "0.42958313", "0.42762074", "0.42728528", "0.42728528", "0.42728528", "0.42728528", "0.4264858", "0.42076254", "0.41736814", "0.41670203", "0.4165732", "0.41640395", "0.4161448", "0.41356692", "0.41256112", "0.41224077", "0.41058353", "0.40945768", "0.40847743", "0.407853", "0.4076729", "0.40538856", "0.4049198", "0.40421936", "0.40234196", "0.40170243", "0.40129188", "0.39924702", "0.39787668", "0.39696994", "0.39604104", "0.39441624", "0.3942627" ]
0.48095116
28
Operation resumeAsyncWithHttpInfo Resume Subscription
public function resumeAsyncWithHttpInfo($id) { $returnType = '\OpenAPI\Client\Model\Subscription'; $request = $this->resumeRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function resumeRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling resume'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resume();", "public function resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function getResumeContextResponse();", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public static function resumeById(int $id, mixed ...$data): mixed;", "abstract protected function doResume();", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "public function resume(Auth $auth)\n {\n // do nothing\n }", "public function resume($id)\n {\n list($response) = $this->resumeWithHttpInfo($id);\n return $response;\n }", "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resume($subscription_id)\n {\n return ChargeBee_Subscription::removeScheduledCancellation($subscription_id)->subscription();\n }", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "abstract protected function doResumeContext();", "public function resumeAsync($id)\n {\n return $this->resumeAsyncWithHttpInfo($id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function resume(): bool {}", "public function resume(): bool;", "public function update(Request $request, Resume $resume)\n {\n //\n }", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "public function resumeContextAccess(AccountInterface $account);", "public function pauseAsyncWithHttpInfo($id, $pause_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->pauseRequest($id, $pause_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 resume(Timer $timer);", "protected function resumeRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "function campaignResume($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignResume\", $params);\n }", "public function resume($project, $zone, $rollingUpdate, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'rollingUpdate' => $rollingUpdate);\n $params = array_merge($params, $optParams);\n return $this->call('resume', array($params), \"Google_Service_Replicapoolupdater_Operation\");\n }", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "public function reactivate(string $subscriptionId, array $parameters = []): ApiResponse\n {\n if (! isset($parameters['plan'])) {\n $subscription = $this->find($subscriptionId);\n\n $parameters['plan'] = $subscription['plan']['id'];\n }\n\n $parameters['cancel_at_period_end'] = false;\n\n return $this->update($subscriptionId, $parameters);\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function cancelRequest($id, $cancel_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling cancel'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/cancel';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($cancel_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($cancel_subscription_request));\n } else {\n $httpBody = $cancel_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function setResume(?string $resume): self\n {\n $this->resume = $resume;\n\n return $this;\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function resume(): array {\n\t\t\t\n\t\t\t$data =\n\t\t\t [\n\t\t\t\t'apartment' => $this->apartment,\n\t\t\t\t'stay' => [\n\t\t\t\t 'check_in' => $this->check_in->format('d-m-Y'),\n\t\t\t\t 'check_out' => $this->check_out->format('d-m-Y'),\n\t\t\t\t 'requests' => $this->special_requests\n\t\t\t\t],\n\t\t\t\t'pending_upgrades' => [],\n\t\t\t ];\n\t\t\tforeach ($this->bookedServices as $bookedService) {\n\t\t\t\t$data['pending_upgrades'][] = $bookedService->slug;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : $this->getDefaultOperationDescriptor();\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function doPreflightCallback(RequestInterface &$request): ClientInterface;", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function testResumeMember()\n {\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "protected function initiateSubRequest() {}", "public function restoreInstanceWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->backupId)) {\n $query['BackupId'] = $request->backupId;\n }\n if (!Utils::isUnset($request->filterKey)) {\n $query['FilterKey'] = $request->filterKey;\n }\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->restoreTime)) {\n $query['RestoreTime'] = $request->restoreTime;\n }\n if (!Utils::isUnset($request->restoreType)) {\n $query['RestoreType'] = $request->restoreType;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->timeShift)) {\n $query['TimeShift'] = $request->timeShift;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RestoreInstance',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RestoreInstanceResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function revokeTokenCurrentAsyncWithHttpInfo($options)\n {\n $returnType = '';\n $request = $this->revokeTokenCurrentRequest($options);\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 (string) $response->getBody()\n );\n }\n );\n }", "function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}", "public function resume()\n\t{\n\t\treturn $this->belongsTo('App\\Resume');\n\t}", "function it_exchange_authorizenet_addon_cancel_subscription( $details ) {\n\n\tif ( empty( $details['subscription'] ) || ! $details['subscription'] instanceof IT_Exchange_Subscription ) {\n\t\treturn;\n\t}\n\n\tif ( ! $details['subscription']->get_subscriber_id() ) {\n\t\treturn;\n\t}\n\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\n\t$api_url = ! empty( $settings['authorizenet-sandbox-mode'] ) ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\t$api_username = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-api-login-id'] : $settings['authorizenet-api-login-id'];\n\t$api_password = ! empty( $settings['authorizenet-sandbox-mode'] ) ? $settings['authorizenet-sandbox-transaction-key'] : $settings['authorizenet-transaction-key'];\n\n\t$request = array(\n\t\t'ARBCancelSubscriptionRequest' => array(\n\t\t\t'merchantAuthentication' => array(\n\t\t\t\t'name'\t\t\t => $api_username,\n\t\t\t\t'transactionKey' => $api_password,\n\t\t\t),\n\t\t\t'subscriptionId' => $details['subscription']->get_subscriber_id()\n\t\t),\n\t);\n\n\t$query = array(\n\t\t'headers' => array(\n\t\t\t'Content-Type' => 'application/json',\n\t\t),\n\t\t'body' => json_encode( $request ),\n\t);\n\n\t$response = wp_remote_post( $api_url, $query );\n\n\tif ( ! is_wp_error( $response ) ) {\n\t\t$body = preg_replace('/\\xEF\\xBB\\xBF/', '', $response['body']);\n\t\t$obj = json_decode( $body, true );\n\n\t\tif ( isset( $obj['messages'] ) && isset( $obj['messages']['resultCode'] ) && $obj['messages']['resultCode'] == 'Error' ) {\n\t\t\tif ( ! empty( $obj['messages']['message'] ) ) {\n\t\t\t\t$error = reset( $obj['messages']['message'] );\n\t\t\t\tit_exchange_add_message( 'error', $error['text'] );\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception( $response->get_error_message() );\n\t}\n}", "public function test_error_get_complete_pos_daily_cash_resume_failed_flag_complete_resume_param()\n {\n $posCashDeskId = 1;\n $timestampNow = Carbon::now()->toDateTimeString();\n $bCompleteResume = \"this is a string\";\n $resumePosDailyCashService = new ResumePosDailyCashService($posCashDeskId, $timestampNow, $bCompleteResume);\n }", "public function getApiContinue( array $result ) {\n\t\treturn $result['continue']['apcontinue'] ?? false;\n\t}", "public function auditAccountAsyncWithHttpInfo($id, $start = null, $end = null, $top = '10', $skip = '0', $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n $returnType = '\\Together\\Taxes\\Provider\\AvaTax\\Swagger\\Model\\FetchResultAuditModel';\n $request = $this->auditAccountRequest($id, $start, $end, $top, $skip, $x_avalara_client);\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 resumeTransactionIterator(\n $resumeState,\n ?array $accountsFilter\n ): RegisteredIterator {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_transaction_iterator',\n [\n 'resume_state' => $resumeState,\n 'accounts_filter' => $accountsFilter,\n ]\n )->wait()\n );\n }", "public function setPreflightCallback(Closure $callback): ClientInterface;", "public function cancelApproval(InvoiceInterface $invoice): void;", "public function unclaimRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling unclaim'\n );\n }\n\n $resourcePath = '/task/{id}/unclaim';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancelsubscription($data)\n\t{\n\t\t$subid = $data['0'];\n\t\t$id = $data['1'];\n\t\t$gateway = $data['2'];\n\t\t$ad_id = $data['3'];\n\t\t$db = JFactory::getDBO();\n\n\t\tif ($subid)\n\t\t{\n\t\t\trequire_once dirname(__FILE__) . '/authorizenet/lib/AuthorizeNet.php';\n\t\t\t$auth_net_login_id = $this->params->get('login_id', '1');\n\t\t\t$auth_net_tran_key = $this->params->get('tran_key', '1');\n\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$auth_net_url = $plgPaymentAuthorizenetHelper->buildAuthorizenetUrl();\n\t\t\tdefine(\"AUTHORIZENET_API_LOGIN_ID\", $auth_net_login_id);\n\t\t\tdefine(\"AUTHORIZENET_TRANSACTION_KEY\", $auth_net_tran_key);\n\n\t\t\t$refId = $id;\n\n\t\t\t// Cancel the subscription.\n\t\t\t$cancellation = new AuthorizeNetARB;\n\t\t\t$cancellation->setRefId($refId);\n\t\t\t$response = $cancellation->cancelSubscription($subid);\n\n\t\t\tif ($response->xml->messages->resultCode != 'Ok')\n\t\t\t{\n\t\t\t\t$payment_status = \"P\";\n\t\t\t\t$error = JText::_('AUTH_SUB_CANCEL_FAIL') . $response->xml->messages->message->text;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$payment_status = \"C\";\n\t\t\t\t$success = JText::_('AUTH_SUB_CANCEL_SUCCESS');\n\t\t\t\t$paymentdata = new stdClass;\n\t\t\t}\n\n\t\t\t$result = array(\n\n\t\t\t\t'transaction_id' => $refId,\n\t\t\t\t'subscription_id' => $subid,\n\t\t\t\t'order_id' => $data['order_id'],\n\t\t\t\t'status' => $payment_status,\n\t\t\t\t'total_paid_amt' => $data['amount'],\n\t\t\t\t'raw_data' => $response,\n\t\t\t\t'payment_type' => 'recurring',\n\t\t\t\t'error' => $error,\n\t\t\t\t'success' => $success,\n\t\t\t\t'return' => $data['return']\n\t\t\t);\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function reverseApproval(FinancialTransactionInterface $transaction, $retry);", "public function revokeTokenCurrentRequest($options)\n {\n // unbox the parameters from the associative array\n\n\n $resourcePath = '/tokens/self';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // 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 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function doWithRetry(RetryContext $context);", "protected function resumeSession(): bool\n {\n if ($this->manager->getIsActive() || $this->manager->resume()) {\n $this->load();\n\n return true;\n }\n\n return false;\n }", "function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}", "public function cancelAsyncWithHttpInfo($id, $cancel_subscription_request = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->cancelRequest($id, $cancel_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 }", "protected function auditAccountRequest($id, $start = null, $end = null, $top = '10', $skip = '0', $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling auditAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/audit';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start !== null) {\n $queryParams['start'] = ObjectSerializer::toQueryValue($start);\n }\n // query params\n if ($end !== null) {\n $queryParams['end'] = ObjectSerializer::toQueryValue($end);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['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 $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 // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 resumeBlockIterator($resumeState): RegisteredIterator\n {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_block_iterator',\n [\n 'resume_state' => $resumeState,\n ]\n )->wait()\n );\n }", "private function getResponse(PaymentInterface $payment) {\n $response = $payment->getPaymentType()->getResumeContextResponse();\n return $response->getResponse();\n }", "public function cancelInvoice(Request $request, $uid)\n {\n $invoice = \\Acelle\\Model\\Invoice::findByUid($uid);\n $subscription = $request->user()->customer->subscription;\n\n if (!$request->user()->customer->can('delete', $invoice)) {\n return $this->notAuthorized();\n }\n\n // if subscription is new -> cancel now subscription.\n // Make sure a new subscription must have a pending invoice\n if ($subscription->isNew()) {\n $subscription->abortNew();\n } else {\n $invoice->delete();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.invoice.cancelled'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function resumed_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'resumed_hook',\n\t\t\t$context\n\t\t);\n\t}", "public function resume(array $inputData = array()) {\n if ($this->id === null) {\n throw new ExecutionException('No execution id given.');\n }\n\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = true;\n $this->suspended = false;\n\n $this->doResume();\n $this->loadFromVariableHandlers();\n\n $errors = array();\n\n foreach ($inputData as $variableName => $value) {\n if (isset($this->waitingFor[$variableName])) {\n if ($this->waitingFor[$variableName]['condition']->evaluate($value)) {\n $this->setVariable($variableName, $value);\n unset($this->waitingFor[$variableName]);\n } else {\n $errors[$variableName] = (string) $this->waitingFor[$variableName]['condition'];\n }\n }\n }\n\n if (!empty($errors)) {\n throw new InvalidInputException($errors);\n }\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionResumed($this);\n }\n\n $this->execute();\n\n // Return execution ID if the workflow has been suspended.\n if ($this->isSuspended()) {\n // @codeCoverageIgnoreStart\n return $this->id;\n // @codeCoverageIgnoreEnd\n }\n }", "public function cancel(string $subscriptionId, $parameters = []): ApiResponse\n {\n return $this->_delete(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function convertToSlidesAsyncWithHttpInfo(Requests\\ConvertToSlidesRequest $request) \n {\n $returnType = '\\GroupDocs\\Conversion\\Model\\Link';\n $request = $this->ConvertToSlidesRequest($request);\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 if ($this->config->getDebug()) {\n $this->_writeResponseLog($response->getStatusCode(), $response->getHeaders(), ObjectSerializer::deserialize($content, $returnType, []));\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 \n if ($exception instanceof RepeatRequestException) {\n $this->_refreshToken();\n throw new RepeatRequestException(\"Request must be retried\", $statusCode, $response->getHeaders(), $response->getBody());\n }\n \n throw new ApiException(\n sprintf('[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri()), $statusCode, $response->getHeaders(), $response->getBody()\n );\n }\n );\n }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "public function show($resume_id) // full preview\n {\n\n $resume = Resume::where('resumes.id', $resume_id)->first();\n// resume translated language\n $resume_translated_language = $resume->translated_languages_id;\n $show_resume = Resume::where('id', $resume_id)->with([\n 'user',\n 'personalInformation.placeOfBirth',\n 'personalInformation.currentLocation',\n 'summary',\n 'objective',\n 'contactInformation.emails',\n 'contactInformation.contactNumbers', 'contactInformation.internetCommunications.internetCommunicationType', 'contactInformation.personalLinks.socialMedia',\n 'educations.projects',\n 'languages.diplomas',\n 'drivingLicense.categories',\n 'achievements',\n 'work_experiences.company',\n 'hobbiesInterest',\n 'memberships',\n 'projects',\n 'publications',\n 'volunteers',\n 'ConferencesWorkshopSeminar',\n 'Portfolio',\n 'certifications',\n 'trainings',\n// 'reReferences',\n 'skills'\n ])->\n with(array('personalInformation.maritalStatus.maritalStatusTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['marital_status_id', 'name']);\n }))->\n with(array('personalInformation.nationalities.nationalityTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['nationality_id', 'name']);\n }))\n ->with(array('contactInformation.contactNumbers.phoneType.PhoneTypeTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['phone_type_id', 'name']);\n }))->\n with(array('contactInformation.contactNumbers.country.countryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['country_id', 'name']);\n }))\n ->with(array('languages.internationalLanguage.internationalLanguageTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['international_language_id', 'name']);\n }))\n ->with(array('languages.languageAssessment.selfAssessment.selfAssessmentTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['self_assessment_id', 'name']);\n }))\n ->with(array('languages.languageAssessment.selfAssessment.selfAssessmentTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['self_assessment_id', 'name']);\n }))\n ->with(array('languages' => function ($query) {\n $query->orderBy('order');\n }))\n\n ->with(array('drivingLicense.country.countryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['country_id', 'name']);\n }))\n ->with(array('educations.major.majorTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['major_id', 'name']);\n }))\n ->with(array('educations.minor.minorTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['minor_id', 'name']);\n }))\n ->with(array('educations.institution.institutionTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['institution_id', 'name']);\n }))\n ->with(array('educations.degreeLevel.degreeLevelTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['degree_level_id', 'name']);\n }))\n ->with(array('educations' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('work_experiences.company_industry.companyIndustryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['company_industry_id', 'name']);\n }))\n ->with(array('work_experiences.company.company_size.company_size_translation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['company_size_id', 'name']);\n }))\n ->with(array('work_experiences.employment_types.employment_type_parent.empTypeParentTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['employment_type_parent_id', 'name']);\n }))\n ->with(array('work_experiences.employment_types.employment_type_parent.parent_category.empTypeParentTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['employment_type_parent_id', 'name']);\n }))\n ->with(array('work_experiences' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('ConferencesWorkshopSeminar.conferenceType.conferenceTypeTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['conference_type_id', 'name']);\n \n }))\n ->with(array('ConferencesWorkshopSeminar' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('Portfolio' => function ($query) {\n $query->orderBy('order');\n }))\n\n ->with(array('publications' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('projects' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('volunteers' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('memberships' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('achievements' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('certifications.validYear.validYearTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['valid_year_id', 'name']);\n }))\n ->with(array('certifications' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('trainings' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('reReferences.reference_info.country.countryTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['country_id', 'name']);\n }))\n ->with(array('reReferences.reference_info' => function ($query) {\n $query->orderBy('order');\n }))\n ->with(array('skills.skill_type.skillTypeTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['skill_type_id', 'name',]);\n }))\n ->with(array('skills.skill_type.skill_type_parent.skillTypeParentTrans' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['skill_type_parent_id', 'name']);\n }))\n ->with(array('skills.skillLevel.skillLevelTranslation' => function ($query) use ($resume_translated_language) {\n $query->where('translated_languages_id', $resume_translated_language);\n $query->select(['skill_level_id', 'name']);\n }))\n ->with(array('skills' => function ($query) {\n $query->orderBy('order');\n }))\n ->first(['id', 'user_id', 'name', 'translated_languages_id']);\n return $this->showOne($show_resume);\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function activateRequest($id, $activate_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling activate'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/activate';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($activate_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($activate_subscription_request));\n } else {\n $httpBody = $activate_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function pauseAsync($id, $pause_subscription_request = null)\n {\n return $this->pauseAsyncWithHttpInfo($id, $pause_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function reopenInvoice() {\n\n $client = new \\app\\components\\OdooClient();\n $account_invoice_ids = $client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"in_invoice\"],\n [\"journal_id\", \"=\", 22]\n ]);\n\n $result = $client->execute(\"account.invoice\", \"signal_workflow\",\n [\n $account_invoice_ids,\n \"invoice_cancel\"\n ]);\n\n print_r($result);\n\n }", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function cancelSubscription(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CancelSubscriptionRequest', $parameters);\n }" ]
[ "0.6342882", "0.6201281", "0.61902463", "0.6163323", "0.5921444", "0.5770443", "0.570346", "0.5620795", "0.5535597", "0.5524534", "0.5472509", "0.5422426", "0.539874", "0.5199294", "0.5182203", "0.51572454", "0.5121586", "0.5101934", "0.506159", "0.50445884", "0.5023477", "0.5011069", "0.4854861", "0.4816095", "0.4797392", "0.4739547", "0.47263736", "0.45896846", "0.45711875", "0.44644517", "0.44643477", "0.43890837", "0.4384118", "0.43206763", "0.42686176", "0.42672217", "0.42444485", "0.42282102", "0.42159826", "0.4203681", "0.41979867", "0.41793326", "0.41406253", "0.41406253", "0.41406253", "0.41406253", "0.41406253", "0.41406253", "0.41406253", "0.41406253", "0.41294217", "0.41294217", "0.41294217", "0.41294217", "0.41063076", "0.40951052", "0.4080309", "0.40798426", "0.40726754", "0.40385437", "0.40352568", "0.40083632", "0.40083632", "0.40083632", "0.40025195", "0.3976419", "0.3971678", "0.39459273", "0.39373678", "0.3935436", "0.3923537", "0.39097485", "0.38944834", "0.38764173", "0.3869924", "0.3847752", "0.38198408", "0.38187566", "0.38144878", "0.38107577", "0.380963", "0.3794135", "0.37859693", "0.37815252", "0.37751612", "0.37733462", "0.3769432", "0.37622526", "0.37610465", "0.3756027", "0.37555185", "0.37521812", "0.37341258", "0.37235776", "0.3723208", "0.3721566", "0.3717439", "0.371143", "0.37053567", "0.37029353" ]
0.5886483
5
Create request for operation 'resume'
public function resumeRequest($id) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling resume' ); } $resourcePath = '/subscriptions/{id}/resume'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); } // for model (json/xml) if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resume();", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "public function getResumeContextResponse();", "abstract protected function doResume();", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "protected function resumeRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request, Resume $resume)\n {\n //\n }", "abstract protected function doResumeContext();", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "public function setResume(?string $resume): self\n {\n $this->resume = $resume;\n\n return $this;\n }", "public static function resumeById(int $id, mixed ...$data): mixed;", "public function resume(): bool;", "public function resume(): bool {}", "public function resume($id)\n {\n list($response) = $this->resumeWithHttpInfo($id);\n return $response;\n }", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "public function pauseRequest($id, $pause_subscription_request = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling pause'\n );\n }\n\n $resourcePath = '/subscriptions/{id}/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($pause_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($pause_subscription_request));\n } else {\n $httpBody = $pause_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function store(AddResumeRequest $request) {\n $data['user_id'] = auth()->user()->id;\n $data['country_id'] = $request->country_id;\n $data['state_id'] = $request->state_id;\n $data['city_id'] = $request->city_id;\n $data['first_name'] = $request->first_name;\n $data['last_name'] = $request->last_name;\n $data['about'] = $request->about;\n $data['username'] = $request->username;\n $data['email'] = $request->email;\n $data['address_line'] = $request->address_line;\n $data['zipcode'] = $request->zipcode;\n $data['path'] = \"\";\n\n // start transaction\n DB::beginTransaction();\n try {\n if ($request->hasfile('document')) {\n $name = time() . rand(1, 100) . '.' . $request->file('document')->getClientOriginalExtension();\n $request->file('document')->move(public_path('files'), $name);\n $data['path'] = $name;\n }\n\n $resume = Resume::create($data);\n\n if (!$resume) {\n DB::rollBack();\n return response(\n [\n \"code\" => \"400\",\n \"status\" => \"failed\",\n \"msg\" => 'unable to upload resume',\n ],\n 400\n );\n }\n\n DB::commit();\n return response(\n [\n \"code\" => \"200\",\n \"status\" => \"success\",\n \"data\" => $resume,\n ],\n 200\n );\n } catch (Exceprion $e) {\n DB::rollBack();\n return response(\n [\n \"code\" => \"400\",\n \"status\" => \"failed\",\n \"msg\" => 'unable to upload resume',\n ],\n 400\n );\n }\n }", "protected function initiateSubRequest() {}", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "function isResumeRequested()\n\t{\n\t\t$resp = $this->readDataFromServer();\n\t\tif(trim($resp) == \"\")\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$parts_from_spaces = explode(\" \", $resp);\n\t\t\tif(trim($parts_from_spaces[4]) == \"RESUME\")\n\t\t\t{\n\t\t\t\t$resume_position = trim($parts_from_spaces[7], \" \\x01\\r\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn $resume_position;\n\t}", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "function campaignResume($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignResume\", $params);\n }", "public function resume(): array {\n\t\t\t\n\t\t\t$data =\n\t\t\t [\n\t\t\t\t'apartment' => $this->apartment,\n\t\t\t\t'stay' => [\n\t\t\t\t 'check_in' => $this->check_in->format('d-m-Y'),\n\t\t\t\t 'check_out' => $this->check_out->format('d-m-Y'),\n\t\t\t\t 'requests' => $this->special_requests\n\t\t\t\t],\n\t\t\t\t'pending_upgrades' => [],\n\t\t\t ];\n\t\t\tforeach ($this->bookedServices as $bookedService) {\n\t\t\t\t$data['pending_upgrades'][] = $bookedService->slug;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function gETExternalPromotionsRequest()\n {\n\n $resourcePath = '/external_promotions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "public function resume(Auth $auth)\n {\n // do nothing\n }", "public function createRequest();", "public function createRequest();", "protected function createRequest()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n $this->call('wizard:request', $params);\n }", "public function process(&$state) {\n\t\tassert('is_array($state)');\n\n\t\tif (!isset($state['Source']['entityid'])) {\n\t\t\tSimpleSAML_Logger::warning('saml:CDC: Could not find IdP entityID.');\n\t\t\treturn;\n\t\t}\n\n\t\t/* Save state and build request. */\n\t\t$id = SimpleSAML_Auth_State::saveState($state, 'cdc:resume');\n\n\t\t$returnTo = SimpleSAML_Module::getModuleURL('cdc/resume.php', array('domain' => $this->domain));\n\n\t\t$params = array(\n\t\t\t'id' => $id,\n\t\t\t'entityID' => $state['Source']['entityid'],\n\t\t);\n\t\t$this->client->sendRequest($returnTo, 'append', $params);\n\t}", "public function resume()\n\t{\n\t\treturn $this->belongsTo('App\\Resume');\n\t}", "public function resumeTransactionIterator(\n $resumeState,\n ?array $accountsFilter\n ): RegisteredIterator {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_transaction_iterator',\n [\n 'resume_state' => $resumeState,\n 'accounts_filter' => $accountsFilter,\n ]\n )->wait()\n );\n }", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "public function resume(array $inputData = array()) {\n if ($this->id === null) {\n throw new ExecutionException('No execution id given.');\n }\n\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = true;\n $this->suspended = false;\n\n $this->doResume();\n $this->loadFromVariableHandlers();\n\n $errors = array();\n\n foreach ($inputData as $variableName => $value) {\n if (isset($this->waitingFor[$variableName])) {\n if ($this->waitingFor[$variableName]['condition']->evaluate($value)) {\n $this->setVariable($variableName, $value);\n unset($this->waitingFor[$variableName]);\n } else {\n $errors[$variableName] = (string) $this->waitingFor[$variableName]['condition'];\n }\n }\n }\n\n if (!empty($errors)) {\n throw new InvalidInputException($errors);\n }\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionResumed($this);\n }\n\n $this->execute();\n\n // Return execution ID if the workflow has been suspended.\n if ($this->isSuspended()) {\n // @codeCoverageIgnoreStart\n return $this->id;\n // @codeCoverageIgnoreEnd\n }\n }", "public function start() {\t\t$resumeFromBytes = $this->resumeFrom();\n\t\tif($resumeFromBytes == false) { // create new temporary file\n\t\t\t$this->fileHandle = $this->tmpFileIn($this->getBaseDirectory(), \"xb\");\n\t\t\tif($this->fileHandle == false) {\n\t\t\t\tthrow new RuntimeException(\"Could not create temporary download file\");\n\t\t\t}\n\t\t} else { // reuse old temporary file\n\t\t\t// beware: server may not support resuming\n\t\t\t// use hasCorrectSize() to check a finished download after resuming\n\t\t\t$this->fileHandle = $this->tmpFileIn($this->getBaseDirectory(), \"ab\");\n\t\t\tif($this->fileHandle == false) {\n\t\t\t\tthrow new RuntimeException(\"Could not open temporary download file for writing\");\n\t\t\t}\n\t\t}\n\t\t// set up and call cURL\n\t\t$curl = curl_init($this->getURL());\n\t\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);\n\t\tcurl_setopt($curl, CURLOPT_FILE, $this->fileHandle);\n\t\tif($resumeFromBytes != false) {\n\t\t\tcurl_setopt($curl, CURLOPT_RANGE, $resumeFromBytes . \"-\");\n\t\t}\n\t\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t\tcurl_setopt($curl, CURLOPT_NOPROGRESS, false);\n\t\tcurl_setopt($curl, CURLOPT_PROGRESSFUNCTION, \"Download::setProgress\");\n\t\t$response = curl_exec($curl);\n\t\t/*\n\t\t * Would be nice to have that, but the current cURL API in PHP does not\n\t\t * allow this to be implemented in a proper way due to the fact that\n\t\t * the HTTP request header cannot be retrieved seperatly from the data.\n\t\t * Stripping the header from the data while writing if using\n\t\t * CURLOPT_WRITEFUNCTION also isn't possible, as this would require the\n\t\t * header size to be available when writing, but curl_getinfo does not\n\t\t * report the corret value when the download has not finished yet.\n\t\t *\n\t\t * So just use the URL path basename as the filename.\n\t\t *\n\t\t// try to extract the filename from the HTTP header \n\t\t$this->requestHeaderSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n\t\t$this->requestHeader = substr($response, 0, $this->requestHeaderSize);\n\t\techo \"header: \" . $this->requestHeader . \"\\n\";\n\t\t$filename = null;\n\t\tif(preg_match(\"/^Content-Disposition: attachment; filename=(.+)$/\", $this->requestHeader, $matches)) {\n\t\t\t$filename = $matches[0];\n\t\t} else { // fall back to the URL path basename\n\t\t\t$filename = basename($this->getURL());\n\t\t}\n\t\t*/\n\t\t$filename = basename($this->getURL());\n\t\tcurl_close($curl);\n\t\t// rename the temporary file\n\t\t$metadata = stream_get_meta_data($this->fileHandle);\n\t\tfclose($this->fileHandle);\n\t\trename($metadata['uri'], $this->getDownloadDirectoryIn($this->getBaseDirectory()) . \"/\" . $filename);\n\t}", "public function resume(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Resume List';\n\t\t$data['resume_list'] = $this->common_model->get_all('fr_resume', '');\n\t\t$this->set_layout('resume/resume_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function resumeBlockIterator($resumeState): RegisteredIterator\n {\n return new RegisteredIterator(\n $this->tonClient->request(\n 'net.resume_block_iterator',\n [\n 'resume_state' => $resumeState,\n ]\n )->wait()\n );\n }", "function rest_preload_api_request($memo, $path)\n {\n }", "public function resume(Timer $timer);", "public function getResume()\n {\n return $this->hasOne(Resume::className(), ['id' => 'resume_id']);\n }", "public function newResumeAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $produit = $em->getRepository('KountacBundle:Produits_1')->find($id);\n $user = $this->getUser();\n \n return $this->render('produits/new_resume.html.twig', array(\n 'produit' => $produit,\n 'user' => $user,\n ));\n }", "public function startjobrequestAction(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t\n\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t$approval_code = time().rand(99999, 99999999);\n\n\t\t\t\tif($response = $jobPacketTable->startJob($posts['start_job_id'], array('approval_code' => $approval_code, 'status' => 3))){\n\t\t\t\t\n\t\t\t\t\t$orderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t\n\t\t\t\t\t$jobDetails = (array)$orderTable->fetchJobDetails($posts['start_job_id']);\n\t\t\t\t\t\n\t\t\t\t\t$jobDetails['approval_code'] = $approval_code;\n\t\t\t\t\t$jobDetails['display_job_id'] = \\De\\Service\\CommonService::generateStockCode($jobDetails['job_id'], 'order');\n\n\t\t\t\t\t$alertTable = $sm->get('Alert\\Model\\AlertTable');\n\t\t\t\t\t$viewUrl = sprintf('/jobdetails/%s', $jobDetails['job_id']);\n\t\t\t\t\t$approvalUrl = sprintf('/approvejob/%s/%s', $jobDetails['job_id'], $jobDetails['approval_code']);\n\n\t\t\t\t\t$reason = $posts['start_comment'];\n\t\t\t\t\tif ($reason != '') {\n\t\t\t\t\t\t$reason = ' (' . $reason . ')';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t'Job <a href=\"%s\">%s</a> needs approval%s. <a href=\"%s\">Click to approve</a>.',\n\t\t\t\t\t\t\t$viewUrl,\n\t\t\t\t\t\t\t$jobDetails['display_job_id'],\n\t\t\t\t\t\t\t$reason,\n\t\t\t\t\t\t\t$approvalUrl\n\t\t\t\t\t\t\t);\n\t\t\t\t\t/* TODO: don't hardcode role ID */\n\t\t\t\t\t$alertTable->createRoleAlert($identity['user_id'], 1, $message);\n\t\t\t\t\t\n\t\t\t\t\techo 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public function testResumeMember()\n {\n }", "public function request(): RequestContract;", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)\n\t{\n\t\t$displayobject->update_basic('displaymodules','FALSE');\n\t\t$t_db_type\t\t= $sessionobject->get_session_var('targetdatabasetype');\n\t\t$t_tb_prefix\t= $sessionobject->get_session_var('targettableprefix');\n\t\t$s_db_type\t\t= $sessionobject->get_session_var('sourcedatabasetype');\n\t\t$s_tb_prefix\t= $sessionobject->get_session_var('sourcetableprefix');\n\n\t\t// Per page vars\n\t\t$start_at\t\t= $sessionobject->get_session_var('startat');\n\t\t$per_page\t\t= $sessionobject->get_session_var('perpage');\n\t\t$class_num\t\t= substr(get_class($this) , -3);\n\t\t$idcache \t\t= new ImpExCache($Db_target, $t_db_type, $t_tb_prefix);\n\t\t$ImpExData\t\t= new ImpExData($Db_target, $sessionobject, 'attachment');\n\t\t$dir \t\t\t= $sessionobject->get_session_var('attachmentsfolder');\n\t\t\n\t\t// Start the timing\n\t\tif(!$sessionobject->get_session_var(\"{$class_num}_start\"))\n\t\t{\n\t\t\t$sessionobject->timing($class_num , 'start' ,$sessionobject->get_session_var('autosubmit'));\n\t\t}\n\n\t\t// Get an array data\n\t\tif ($s_db_type == 'mysql')\n\t\t{\n\t\t\t$data_array = $this->get_source_data($Db_source, $s_db_type, \"{$s_tb_prefix}attachments\", 'attach_id', 0, $start_at, $per_page);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$data_array = $this->get_phpbb3_attach($Db_source, $s_db_type, $s_tb_prefix, $start_at, $per_page);\n\t\t}\t\t\n\t\t\n\n\t\t$displayobject->print_per_page_pass($data_array['count'], $displayobject->phrases['attachments'], $start_at);\n\n\t\tforeach ($data_array['data'] as $import_id => $data)\n\t\t{\n\t\t\t\t$try = (phpversion() < '5' ? $ImpExData : clone($ImpExData));\n\n\t\t\t\tif(!is_file($dir . '/' . $data['physical_filename']))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now(\"<br /><b>{$displayobject->phrases['source_file_not']} </b> :: {$data['real_filename']}\");\n\t\t\t\t\t$sessionobject->add_error($import_id, $displayobject->phrases['attachment_not_imported'], $data['real_filename'] . ' - ' . $displayobject->phrases['attachment_not_imported_rem_1']);\n\t\t\t\t\t$sessionobject->set_session_var($class_num . '_objects_failed',$sessionobject->get_session_var($class_num. '_objects_failed') + 1 );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$file = $this->vb_file_get_contents($dir . '/' . $data['physical_filename']);\n\n\t\t\t\t// Mandatory\n\t\t\t\t$try->set_value('mandatory', 'filename',\t\t\t\taddslashes($data['real_filename']));\n\t\t\t\t$try->set_value('mandatory', 'filedata',\t\t\t\t$file);\n\t\t\t\t$try->set_value('mandatory', 'importattachmentid',\t\t$import_id);\n\n\t\t\t\t// Non Mandatory\n\t\t\t\t$try->set_value('nonmandatory', 'userid',\t\t\t\t$idcache->get_id('user', $data['poster_id']));\n\t\t\t\t$try->set_value('nonmandatory', 'dateline',\t\t\t\t$data['filetime']);\n\t\t\t\t$try->set_value('nonmandatory', 'visible',\t\t\t\t'1');\n\t\t\t\t$try->set_value('nonmandatory', 'counter',\t\t\t\t$data['download_count']);\n\t\t\t\t$try->set_value('nonmandatory', 'filesize',\t\t\t\t$data['filesize']);\n\t\t\t\t$try->set_value('nonmandatory', 'postid',\t\t\t\t$data['post_msg_id']);\n\t\t\t\t$try->set_value('nonmandatory', 'filehash',\t\t\t\tmd5($file));\n\n\t\t\t\tif (!$file)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t// Check if object is valid\n\t\t\tif($try->is_valid())\n\t\t\t{\n\t\t\t\tif($try->import_attachment($Db_target, $t_db_type, $t_tb_prefix))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now('<br /><span class=\"isucc\"><b>' . $try->how_complete() . '%</b></span> ' . $displayobject->phrases['attachment'] . ' -> ' . $data['real_filename']);\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_done\",intval($sessionobject->get_session_var(\"{$class_num}_objects_done\")) + 1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t\t$sessionobject->add_error($Db_target, 'warning', $class_num, $import_id, $displayobject->phrases['attachment_import_error'], $displayobject->phrases['attachment_error_rem']);\n\t\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['failed']} :: {$displayobject->phrases['attachment_not_imported']}\");\n\t\t\t\t}// $try->import_attachment\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t$sessionobject->add_error($Db_target, 'invalid', $class_num, $import_id, $displayobject->phrases['invalid_object'] . ' ' . $try->_failedon, $displayobject->phrases['invalid_object_rem']);\n\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['invalid_object']}\" . $try->_failedon);\n\t\t\t}// is_valid\n\t\t\tunset($try);\n\t\t}// End foreach\n\n\t\t// Check for page end\n\t\tif ($data_array['count'] == 0 OR $data_array['count'] < $per_page)\n\t\t{\n\t\t\t$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));\n\t\t\t$sessionobject->remove_session_var(\"{$class_num}_start\");\n\n\t\t\t$displayobject->update_html($displayobject->module_finished($this->_modulestring,\n\t\t\t\t$sessionobject->return_stats($class_num, '_time_taken'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_done'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_failed')\n\t\t\t));\n\n\t\t\t$sessionobject->set_session_var($class_num , 'FINISHED');\n\t\t\t$sessionobject->set_session_var('module', '000');\n\t\t\t$sessionobject->set_session_var('autosubmit', '0');\n\t\t}\n\n\t\t$sessionobject->set_session_var('startat', $data_array['lastid']);\n\t\t$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));\n\t}", "public function tspRequest()\n {\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function serviceRequest()\n {\n API::post('ivr/serviceRequest', array(\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }", "public function unclaimRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling unclaim'\n );\n }\n\n $resourcePath = '/task/{id}/unclaim';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function builder(): ContinueRequestRequestBuilder\n\t{\n\t\treturn new ContinueRequestRequestBuilder();\n\t}", "public function parseResume($file)\n\t\t{\n\t\t\tif (!$file) {\n\t\t\t\t$this->throwJsonError(500, 'Requires a resume file.');\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// Get file extension (NEEDS TO MOVE TO UPLOAD FUNCTION)\n\t\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\n\t\t\tswitch (strtolower($ext)) {\n\t\t\t\tcase 'txt':\n\t\t\t\t\t$format = 'TEXT';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'doc':\n\t\t\t\t\t$format = 'DOC';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'docx':\n\t\t\t\t\t$format = 'DOCX';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pdf':\n\t\t\t\t\t$format = 'PDF';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'rtf':\n\t\t\t\t\t$format = 'RTF';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'html':\n\t\t\t\t\t$format = 'HTML';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'htm':\n\t\t\t\t\t$format = 'HTML';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->throwJsonError(500, 'File format error. (txt, html, pdf, doc, docx, rtf)');\n\t\t\t}\n\n\t\t\t$url = $this->url . 'resume/parseToCandidate';\n\t\t\t$params = array('BhRestToken' => $this->session, 'format' => $format, 'populateDescription' => 'text');\n\n\t\t\ttry {\n\t\t\t\t$client = new Client();\n\t\t\t\t$url = $url . '?' . http_build_query($params);\n\t\t\t\t$response = $client->post($url, [\n\t\t\t\t\t'multipart' => [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => 'resume',\n\t\t\t\t\t\t\t'contents' => fopen($file, 'r')\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]);\n\t\t\t\treturn json_decode($response->getBody());\n\t\t\t} catch (GuzzleHttp\\Exception\\ClientException $e) {\n\t\t\t\t//$error = json_decode($e -> getResponse() -> getBody());\n\t\t\t\treturn false;\n\t\t\t\t// $this->throwJsonError(500, $error->errorMessage);\n\t\t\t} catch (GuzzleHttp\\Exception\\ServerException $e) {\n\t\t\t\treturn false;\n\t\t\t\t// $this->throwJsonError(500, $error);\n\t\t\t} catch (GuzzleHttp\\Exception\\ConnectException $e) {\n\t\t\t\t$error = $e->getMessage();\n\t\t\t\terror_log($error);\n\t\t\t\treturn false;\n\t\t\t\t// $this->throwJsonError(500, $error);\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$error = $e->getMessage();\n\t\t\t\terror_log($error);\n\t\t\t\treturn false;\n\t\t\t\t// $this->throwJsonError(404, 'Oh damn');\n\t\t\t}\n\t\t}", "public function request()\n {\n $request = new GuzzleHttp\\Psr7\\Request('GET', 'ProductsSimple');\n\n return $request->withUri($request->getUri()->withQuery(http_build_query([\n 'startRow' => $this->skip ? $this->skip + 1 : null,\n 'pageRows' => $this->take,\n 'updatedAfter' => $this->updatedAfter ? $this->updatedAfter->format('Y-m-d\\TH:i:s') : null\n ])));\n }", "abstract public function request();", "public function resumeWithHttpInfo($id)\n {\n $request = $this->resumeRequest($id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function request();", "protected function auditAccountRequest($id, $start = null, $end = null, $top = '10', $skip = '0', $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling auditAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/audit';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start !== null) {\n $queryParams['start'] = ObjectSerializer::toQueryValue($start);\n }\n // query params\n if ($end !== null) {\n $queryParams['end'] = ObjectSerializer::toQueryValue($end);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['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 $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 // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function createRequest()\n {\n $requests = $this->createGuzzleRequests();\n if (count($requests) == 1) {\n $request = reset($requests);\n } else {\n $multipartRequest = new MultipartRequest($this->client, new ApiRequest([\n 'version' => 'latest',\n 'requests' => $requests,\n 'boundary' => ApiHelper::generateId(),\n 'multipartType' => 'mixed',\n ]));\n $request = $this->createGuzzleRequest($multipartRequest->getMethod(), $multipartRequest->getUri(), $multipartRequest->getHeaders(), $multipartRequest->getBody());\n }\n\n return $request;\n }", "public function request() {\n //sent to poster \n }", "protected function getReadRequest()\n\t{\n\t\t$url = $this->url();\n\t\n\t\t$url\n\t\t\t->getQuery()\n\t\t\t\t->setParameter('code', 200)\n\t\t\t\t->setParameter('format', 'json')\n\t\t\t\t->setParameter('output', '{\"id\":1, \"foo\":\"bar\"}');\n\t\t\n\t\treturn new Api\\Request\\Read((string) $url);\n\t}", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function test_error_get_complete_pos_daily_cash_resume_failed_flag_complete_resume_param()\n {\n $posCashDeskId = 1;\n $timestampNow = Carbon::now()->toDateTimeString();\n $bCompleteResume = \"this is a string\";\n $resumePosDailyCashService = new ResumePosDailyCashService($posCashDeskId, $timestampNow, $bCompleteResume);\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning'])\n ? $this->descriptors[$methodName]['longRunning']\n : [];\n $operation = new OperationResponse(\n $operationName,\n $this->getOperationsClient(),\n $options\n );\n $operation->reload();\n return $operation;\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "protected function pauseRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/pause';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_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/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testIndexResume()\n {\n $classFqn = 'stdClass';\n $count = 100;\n $providerName = 'provider';\n\n $this->resumeManager->getUnfinishedProviders()->willReturn([]);\n $this->providerRegistry->getProviders()->willReturn([\n $providerName => $this->provider1->reveal(),\n ]);\n $this->provider1->getClassFqns()->willReturn([$classFqn]);\n $this->provider1->getCount('stdClass')->willReturn($count);\n $this->provider1->provide('stdClass', 23, 50)->willReturn([new \\stdClass()]);\n $this->provider1->provide('stdClass', 73, 50)->willReturn([]);\n $this->provider1->cleanUp('stdClass')->shouldBeCalledTimes(2);\n\n $this->resumeManager->getCheckpoint($providerName, $classFqn)->willReturn(23);\n $this->resumeManager->setCheckpoint($providerName, $classFqn, 73)->shouldBeCalled();\n $this->resumeManager->setCheckpoint($providerName, $classFqn, 100)->shouldBeCalled();\n $this->resumeManager->removeCheckpoints($providerName)->shouldBeCalled();\n\n $this->execute('prod', []);\n }", "public function getApplicationRequest()\n {\n\n $resourcePath = '/subscriptions/active';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function createRequest($body)\n {\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling '\n );\n }\n\n $resourcePath = '/campaigns';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\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 $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function handle(RestoreResourceRequest $request)\n {\n $request->chunks(150, function ($models) use ($request) {\n $models->each(function ($model) use ($request) {\n $model->restore();\n\n DB::table('action_events')->insert(\n Nova::actionEvent()->forResourceRestore($request->user(), collect([$model]))\n ->map->getAttributes()->all()\n );\n });\n });\n }", "public function createRequest(): IRequest;", "public function store(ResumeRequest $request)\n {\n $response;\n\n $record = new CandidateFile();\n\n $fileName = rand(100000, 999999).'_cv.'.$request->file('resume')->getClientOriginalExtension();\n $filePublicName = $request->file('resume')->getClientOriginalName();\n $folderName = 'candidates/'.Auth::user()->candidate->id.'/resumes';\n\n $request->file('resume')->storeAs($folderName, $fileName, 'public');\n\n $record->candidate_id = Auth::user()->candidate->id;\n $record->file = $fileName;\n $record->file_public_name = $filePublicName;\n\n if ($record->save()) {\n $howMuchFile = Auth::user()->candidate->files->count();\n\n $response = [\n 'errors' => false,\n 'message' => 'Se ha guardado con éxito tu CV.',\n 'file_name' => $filePublicName,\n 'file_id' => $record->id,\n 'file_url' => url('storage/candidates/'.Auth::user()->candidate->id.'/resumes/'.$record->file),\n 'delete_upload_button' => ($howMuchFile == 3) ? true : false,\n 'file_count' => $howMuchFile\n ];\n } else {\n $response = [\n 'errors' => true,\n 'message' => 'No se ha podido guardar tu CV.',\n 'error_code' => 'cvu0001'\n ];\n }\n\n return response()->json($response);\n }", "protected function _createRequest(array $query) {\r\n // Define request\r\n $promise = $this->guzzle->getAsync('https://api.flickr.com/services/rest/', [\r\n 'query' => array_merge($query, [\r\n 'api_key' => $this->config['api'],\r\n 'format' => 'json',\r\n 'nojsoncallback' => 1\r\n ])\r\n ]);\r\n // Process data\r\n return $promise->then(function($response) {\r\n $data = json_decode($response->getBody(), true);\r\n if($data['stat'] == 'fail') {\r\n throw new Exception($data['message']);\r\n }\r\n return $data;\r\n });\r\n }", "protected function restStorageFrontendFilesGetRequest($continuation_token = null)\n {\n\n $resourcePath = '/rest/storage/frontend/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($continuation_token)) {\n $continuation_token = ObjectSerializer::serializeCollection($continuation_token, '', true);\n }\n if ($continuation_token !== null) {\n $queryParams['continuationToken'] = $continuation_token;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n 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 $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function cancelRequestOfUserForReceivedApprovedRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceivedApprovedRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "public function waitRequest(): ?Request;", "public function runRequest() {\n }", "private function getBasicFetchRequest()\n {\n $obj_request = new \\google\\appengine\\datastore\\v4\\RunQueryRequest();\n $obj_request->setSuggestedBatchSize(1000);\n $obj_request->mutableReadOptions();\n $obj_partition = $obj_request->mutablePartitionId();\n $obj_partition->setDatasetId('Dataset');\n return $obj_request;\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "protected function getSuspendedJobRequest($job_id)\n {\n // verify the required parameter 'job_id' is set\n if ($job_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling getSuspendedJob'\n );\n }\n\n $resourcePath = '/management/suspended-jobs/{jobId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($job_id !== null) {\n $resourcePath = str_replace(\n '{' . 'jobId' . '}',\n ObjectSerializer::toPathValue($job_id),\n $resourcePath\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 []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 }", "protected function ConvertToSlidesStreamRequest(Requests\\ConvertToSlidesStreamRequest $request)\n {\n\n $resourcePath = '/conversion/slides/stream';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = \"\";\n $multipart = false;\n \n\n \n \n $resourcePath = $this->_parseURL($resourcePath, $queryParams);\n\n // body params\n $_tempBody = null;\n if (isset($request->settings)) {\n if (is_string($request->settings)) {\n $_tempBody = \"\\\"\" . $request->settings . \"\\\"\"; \n } else {\n $_tempBody = $request->settings;\n }\n }\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', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = $formParams[\"data\"];\n }\n }\n \n $this->_requestToken();\n\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['x-groupdocs-client'] = $this->config->getUserAgent();\n }\n \n $defaultHeaders['x-groupdocs-client-version'] = $this->config->getClientVersion();\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n \n $req = new Request(\n 'POST',\n $this->config->getHost() . $resourcePath,\n $headers,\n $httpBody\n );\n if ($this->config->getDebug()) {\n $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody);\n }\n \n return $req;\n }", "public function update(ResumeRequest $request, Resume $resume)\n {\n $data = $request->only(['name','profession','about', 'email','phoneNo','birthday' ,'county','facebook','twitter','insta' ,\n 'resumeContent','school','qualification','dateFromEd','dateToEd','employer','position','from',\n 'to','skill1','skill2','skill3']);\n\n if($request->hasFile('image')){\n $image = $request->image->store('candidate');\n\n Storage::delete($resume->image);\n\n $data['image'] = $image;\n\n }else{\n\n $resume->update($data);\n }\n\n\n\n session()->flash('success','Your resume has been update successfuly');\n\n return redirect()->route('resume.create')->with('resume',Resume::where('user_id', '=', auth()->id())->first());\n }", "public function restoreInstanceWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->backupId)) {\n $query['BackupId'] = $request->backupId;\n }\n if (!Utils::isUnset($request->filterKey)) {\n $query['FilterKey'] = $request->filterKey;\n }\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->restoreTime)) {\n $query['RestoreTime'] = $request->restoreTime;\n }\n if (!Utils::isUnset($request->restoreType)) {\n $query['RestoreType'] = $request->restoreType;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->timeShift)) {\n $query['TimeShift'] = $request->timeShift;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'RestoreInstance',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return RestoreInstanceResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function store($id, Request $request)\n\t{\n\t\t\n\t\t$profile = Profile::findOrFail($id);\n\n\t\t$resume = new Resume;\n\t\t$resume->cv = $request->input('cv');\n\t\t$file_name = 'cv'. $profile->id . '.' . \n\t\t\t$request->file('file')->getClientOriginalExtension();\n\t\t$resume->file_path = public_path() . \"\\\\resumes\\\\\" . $file_name;\n\t\t$request->file('file')->move(\n\t\t\t'resumes', $file_name\n\t\t\t);\n\t\t/*\n\t\t$request->file('file')->move(\n\t\t\tbase_path() . '/public/resumes/', $file_name\n\t\t\t);*/\n\t\t//$resume->file_path = base_path() . '/public/resumes/' . $file_name;\n\t\t//$resume->profile_id = $id;\n\t\t\n\t\ttry {\n\t\t\t//$resume->save();\n\t\t\t$profile->resume()->save($resume);\t\t\t\n\t\t} catch(\\Exception $e) {\n\t\t\treturn redirect()->route('profile_resume.create', [$profile])->withErrors(['error' => $e->getMessage()]);\n\t\t}\n\n\t\treturn view('profile_resume.index', compact('profile'));\n\t\t\n\t}", "protected function QuickConvertToStreamRequest(Requests\\QuickConvertToStreamRequest $request)\n {\n\n $resourcePath = '/conversion/quick/stream';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = \"\";\n $multipart = false;\n \n\n \n \n $resourcePath = $this->_parseURL($resourcePath, $queryParams);\n\n // body params\n $_tempBody = null;\n if (isset($request->settings)) {\n if (is_string($request->settings)) {\n $_tempBody = \"\\\"\" . $request->settings . \"\\\"\"; \n } else {\n $_tempBody = $request->settings;\n }\n }\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', 'application/xml']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = $formParams[\"data\"];\n }\n }\n \n $this->_requestToken();\n\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['x-groupdocs-client'] = $this->config->getUserAgent();\n }\n \n $defaultHeaders['x-groupdocs-client-version'] = $this->config->getClientVersion();\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n \n $req = new Request(\n 'POST',\n $this->config->getHost() . $resourcePath,\n $headers,\n $httpBody\n );\n if ($this->config->getDebug()) {\n $this->_writeRequestLog('POST', $this->config->getHost() . $resourcePath, $headers, $httpBody);\n }\n \n return $req;\n }", "public function resumeOperation($operationName, $methodName = null)\n {\n $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : $this->getDefaultOperationDescriptor();\n $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);\n $operation->reload();\n return $operation;\n }", "public function store(ResumeRequest $request)\n {\n $image = $request->image->store('candidate');\n\n Resume::create([\n 'name'=> $request->name,\n 'profession' => $request->profession,\n 'about' => $request->about,\n 'image' => $image,\n 'email' => $request->email,\n 'phoneNo' => $request->phoneNo,\n 'birthday' => $request->birthday,\n 'county' => $request->county,\n 'facebook' => $request->facebook,\n 'twitter' => $request->twitter,\n 'insta' => $request->insta,\n 'resumeContent' => $request->resumeContent,\n 'school' => $request->school,\n 'qualification' => $request->qualification,\n 'dateFromEd' => $request->dateFromEd,\n 'dateToEd' => $request->dateToEd,\n 'employer' => $request->employer,\n 'position' => $request->position,\n 'from' => $request->from,\n 'to' => $request->to,\n 'skill1' => $request->skill1,\n 'skill2' => $request->skill2,\n 'skill3' => $request->skill3,\n 'user_id' => auth()->id(),\n ]);\n\n session()->flash('success','Your resume has been created successfuly');\n\n return view('Candidate.editResume')->with('resume',Resume::where('user_id', '=', auth()->id())->first());\n }" ]
[ "0.69439363", "0.6853983", "0.64689094", "0.63917744", "0.6296846", "0.6267364", "0.61302215", "0.6105293", "0.6004747", "0.5732967", "0.5678388", "0.5663334", "0.5576243", "0.55747175", "0.5545097", "0.5511283", "0.5364658", "0.5262826", "0.52265817", "0.51964396", "0.51933515", "0.5171826", "0.50226617", "0.5010022", "0.49994785", "0.4986915", "0.49697453", "0.49617884", "0.49608725", "0.49254498", "0.49254498", "0.4907369", "0.48647797", "0.4838021", "0.48319295", "0.48053116", "0.47915733", "0.47519022", "0.474532", "0.47228473", "0.47118568", "0.47073814", "0.46766815", "0.46682814", "0.46416092", "0.46076104", "0.46049875", "0.4577926", "0.45760837", "0.456033", "0.4558106", "0.4554197", "0.45510808", "0.45331186", "0.45277303", "0.45212287", "0.45017895", "0.44921762", "0.44841322", "0.4474072", "0.4473481", "0.4469662", "0.44571295", "0.44497812", "0.44497812", "0.44497812", "0.44497812", "0.44497812", "0.44497812", "0.44497812", "0.44497812", "0.4444814", "0.44348228", "0.44348228", "0.44348228", "0.44348228", "0.44333714", "0.4432874", "0.4431182", "0.44306377", "0.44299594", "0.44282362", "0.4417354", "0.44163948", "0.4415962", "0.44107604", "0.44105276", "0.44093183", "0.4402403", "0.43986103", "0.4394936", "0.43912348", "0.43896237", "0.4382562", "0.43786925", "0.43773195", "0.4375828", "0.43665257", "0.43418303", "0.4337262" ]
0.6989134
0
Operation update Update Subscription
public function update($id, $update_subscription_request) { list($response) = $this->updateWithHttpInfo($id, $update_subscription_request); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateSubscription($request);", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "function _updateSubscription(&$subscription) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE subscriptions\n\t\t\t\tSET\n\t\t\t\t\tjournal_id = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\ttype_id = ?,\n\t\t\t\t\tdate_start = %s,\n\t\t\t\t\tdate_end = %s,\n\t\t\t\t\tdate_reminded_before = %s,\n\t\t\t\t\tdate_reminded_after = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\treference_number = ?,\n\t\t\t\t\tnotes = ?\n\t\t\t\tWHERE subscription_id = ?',\n\t\t\t\t$this->dateToDB($subscription->getDateStart()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateEnd()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedBefore()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedAfter())\n\t\t\t), array(\n\t\t\t\t$subscription->getJournalId(),\n\t\t\t\t$subscription->getUserId(),\n\t\t\t\t$subscription->getTypeId(),\n\t\t\t\t$subscription->getStatus(),\n\t\t\t\t$subscription->getMembership(),\n\t\t\t\t$subscription->getReferenceNumber(),\n\t\t\t\t$subscription->getNotes(),\n\t\t\t\t$subscription->getId()\n\t\t\t)\n\t\t);\n\n\t\treturn $returner;\n\t}", "public function update(Request $request, SubscribedUser $subscribedUser)\n {\n //\n }", "public function update(Request $request, Subscribe $subscribe)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n $request->validate([\n 'name' => 'required',\n 'min_labels' => 'required',\n 'max_labels' => 'required'\n ]);\n \n $subscription->update($request->all());\n \n return redirect()->route('subscriptions.index')->with('success',__('success_edit_subscription'));\n }", "public function update()\n {\n return $this->putResource(sprintf('/%s', str_replace('{{subscriber_code}}', $this->subscriber_code, self::PATH)));\n }", "public function setSubscription(array $data)\n {\n $returnValue = false;\n\n // check if subscription id exists\n if (!isset($data['id'])) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'ID must be set before attempting a save'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $data['id']\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription has properties update the changed one's\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n $createdTimePropertyUri = $this->_subscriptionConfig->get($this->_propertyMatching['created_time']);\n $data['created_time'] = $subscriptionResourceProperties[$createdTimePropertyUri][0]['content'];\n\n // get the current time\n $now = new Zend_Date;\n\n // if lease seconds is set to the subscription, calculate a new expiration time\n if (isset($data['lease_seconds'])) {\n $data['expiration_time'] = $now\n ->add($data['lease_seconds'], Zend_Date::SECOND)\n ->get('yyyy-MM-dd HH:mms');\n }\n\n // generate new add and delete statements from subscriber data array\n $statements = $this->_generateStatements(\n $subscriptionResourceUri,\n $data,\n $subscriptionResourceProperties\n );\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_UPDATE_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add and delete the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n $this->_selectedModelInstance->deleteMultipleStatements($statements['deleteStatements']);\n\n $returnValue = false;\n // if the subscription has now proberties only add the properties\n } else {\n // generate the add statements\n $statements = $this->_generateStatements($subscriptionResourceUri, $data);\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_ADD_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n\n $returnValue = true;\n }\n\n // end versioning\n $this->_versioning->endAction();\n\n return $returnValue;\n }", "public function Update()\n {\n \t$rs = mysql_query(\"UPDATE subscriptions SET subscription_name_fr='\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', subscription_name_en='\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_fr='\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_en='\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_by_id='\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_date='\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t \t\t\t\t \"' WHERE subscription_id=\" . $this->subscription_id);\n \t\t\n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\n }", "public function update($id)\n\t{\n//\t\t$subscription = Subscription::findOrFail($id);\n\n//\t\t$validator = Validator::make($data = Input::all(), Subscription::$rules);\n//\n//\t\tif ($validator->fails())\n//\t\t{\n//\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n//\t\t}\n//\n//\t\t$subscription->update($data);\n\n\t\treturn Redirect::route('subscriptions.index');\n\t}", "public function postUpdate(Request $request)\n {\n // dd($request->all());\n // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription=Subscription::findOrFail($request->id);\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data updated successfully'));\n \n \n \n\n }", "public function updateRequest($id, $update_subscription_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling update'\n );\n }\n // verify the required parameter 'update_subscription_request' is set\n if ($update_subscription_request === null || (is_array($update_subscription_request) && count($update_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_subscription_request when calling update'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($update_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($update_subscription_request));\n } else {\n $httpBody = $update_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request, Subscriber $subscriber)\n {\n //\n }", "public function updated(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'renewed');\n }", "public function updateSubscription($data, $where) {\n $this->db->update($this->table, $data, $where);\n if ($this->db->affected_rows() > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function update_subscription( $data ) {\r\n global $wpdb;\r\n\r\n // leave only the required keys\r\n $data = array_intersect_key( $data, LaterPay_Helper_Subscription::get_default_options() );\r\n\r\n // fill values that weren't set from defaults\r\n $data = array_merge( LaterPay_Helper_Subscription::get_default_options(), $data );\r\n\r\n unset( $data['lp_id'] ); // unset key ( used in WP schema ) before inserting to custom table.\r\n\r\n // pass_id is a primary key, set by autoincrement\r\n $id = $data['id'];\r\n unset( $data['id'] );\r\n\r\n // format for insert and update statement\r\n $format = array(\r\n '%d', // duration\r\n '%d', // period\r\n '%d', // access_to\r\n '%d', // access_category\r\n '%f', // price\r\n '%s', // revenue_model\r\n '%s', // title\r\n '%s', // description\r\n );\r\n\r\n if ( empty( $id ) ) {\r\n $wpdb->insert(\r\n $this->table,\r\n $data,\r\n $format\r\n );\r\n $data['id'] = $wpdb->insert_id;\r\n } else {\r\n $wpdb->update(\r\n $this->table,\r\n $data,\r\n array( 'id' => $id ),\r\n $format,\r\n array( '%d' ) // pass_id\r\n );\r\n $data['id'] = $id;\r\n }\r\n\r\n // purge cache\r\n LaterPay_Helper_Cache::purge_cache();\r\n\r\n return $data;\r\n }", "public function update(Request $request, ClassSubscription $classSubscription)\n {\n //\n }", "public function update(manageUserSubscriptionRequest $request, $id)\n {\n $data = Input::all();\n $user_subscription = $this->user_subscription->find($id);\n $data['id'] = $id;\n\n if($user_subscription){\n\n $update = $this->user_subscription->update($data);\n\n if(!$update){\n return response()->json(['error'=>'Server error'],500); \n }else{\n $user_subscription = $this->user_subscription->find($id);\n return response()->json(['success'=>$user_subscription],200);\n }\n\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function edit(Subscription $subscription)\n {\n //\n }", "public function postEdit($subscriptionId) {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ( $subscriptionId )) {\n $isCreated = true;\n $this->request->session ()->flash ( 'success', trans ( 'customer::subscription.update.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.update.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::subscription.update.error' ) );\n }", "public function update(Request $request, $id)\n {\n\n $brands = Subscriptions::findOrFail($id);\n\n\n $brands->update($request->all());\n\n\n\n return redirect()->back();\n\n\n \n }", "protected function handleSubscriptionUpdated(array $data): void\n {\n $this->configureStripeClient();\n $stripeSubscription = $data['data']['object'];\n $subscription = Subscription::find()->status(null)->reference($stripeSubscription['id'])->one();\n\n if (!$subscription) {\n Craft::warning('Subscription with the reference “' . $stripeSubscription['id'] . '” not found when processing webhook ' . $data['id'], 'stripe');\n\n return;\n }\n\n // See if we care about this subscription at all\n $subscription->setSubscriptionData($data['data']['object']);\n\n $this->setSubscriptionStatusData($subscription);\n\n if (empty($data['data']['object']['plan'])) {\n Craft::warning($subscription->reference . ' contains multiple plans, which is not supported. (event \"' . $data['id'] . '\")', 'stripe');\n } else {\n $planReference = $data['data']['object']['plan']['id'];\n $plan = Commerce::getInstance()->getPlans()->getPlanByReference($planReference);\n\n if ($plan) {\n $subscription->planId = $plan->id;\n } else {\n Craft::warning($subscription->reference . ' was switched to a plan on Stripe that does not exist on this Site. (event \"' . $data['id'] . '\")', 'stripe');\n }\n }\n\n Commerce::getInstance()->getSubscriptions()->updateSubscription($subscription);\n }", "function set_subscriber($data, $oldId){\n $query = updateRecord(TAB_SUBSCRIBERS, $data, \"id = $oldId\");\n return $query;\n}", "public function UpdatePayment($data)\n { \n \n \n $metadata=$data['data']['metadata']; \n $type_id=Subscription::where('user_id',$metadata['user_id'])\n ->orderBy('id', 'desc')\n ->first(); \n \n \n // Store Payment \n $payment= Payment::create([\n 'user_id'=>$metadata['user_id'],\n 'type'=> 'Subscription',\n 'type_id'=>$type_id->id,\n 'reference'=>$data['data']['reference'],\n 'currency'=>$data['data']['currency'],\n 'channel'=>$data['data']['channel'],\n 'amount'=>$data['data']['amount'],\n 'status'=>$data['data']['status'], \n 'gateway'=>\"PAYSTACK\", \n 'transaction_date'=>$data['data']['transaction_date'],\n ]);\n \n // update the subscribtion plan previously created with active status\n Subscription::where('user_id',$metadata['user_id'])\n ->where('id',$type_id->id)\n ->update([\n 'status'=>'active'\n ]); \n }", "function lb_subscription_set_subscription($account, $subscription) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n $entity = entity_load_single('user', $account->uid);\n if ($account_subscription_data['subscriptions']) {\n $index = count($entity->field_subscription[LANGUAGE_NONE]);\n }\n else {\n $index = 0;\n }\n $entity->field_subscription[LANGUAGE_NONE][$index] = array(\n 'field_subscription_reference' => array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'target_id' => $subscription->nid,\n ),\n ),\n ),\n );\n entity_save('user', $entity);\n }\n}", "public function update(Request $request, $id)\n {\n $subscriber = Subscriber::findOrFail($id);\n $data = $request->all();\n $subscriber->update($data);\n\n return redirect('subscriber')->with('message','Subscriber Updated !');\n }", "protected function _actionEditsubscription( KCommandContext $context )\n {\n if( $subscription = $this->_subscriber->changeSubscriptionTo( $this->getItem() ) )\n {\n $subscription->endDate = $context->data->endDate;\n }\n }", "public function updateSubscriptionBilling(Subscription &$subscription, $data)\r\n {\r\n $subscription->setProductId($data['productId']);\r\n $subscription->setPurchasedToken($data['purchasedToken']);\r\n\r\n $this->entityManager->merge($subscription);\r\n $this->entityManager->flush();\r\n return $subscription;\r\n }", "public function edit(Subscribe $subscribe)\n {\n //\n }", "public function update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function update($TenantID,updateTenantRequest $request){\n DB::beginTransaction();\n try {\n $Tenant = Tenant::where('id',$TenantID)->firstOrFail();\n // if the subscription_date was null it means its a new tenant and we shall send activation email\n if($Tenant->subscription_date == null && $request['status'] == 'active'){\n MailController::SendRequestApprovedEmail($Tenant);\n }\n $Tenant->update([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request['password']),\n 'status' => $request->status,\n 'number_of_branches' => $request->number_of_branches,\n 'subscription_price' => $request->subscription_price,\n 'subscription_date' => $request->subscription_date,\n 'subscription_end_date' => $request->subscription_end_date,\n ]);\n return response()->json(['UpdatedSubscriber'=>$Tenant],200);\n\n DB::commit();\n } catch (\\Exception $e) {\n return response()->json(['Error'=>$e],500);\n\n DB::rollback();\n }\n }", "public function updateSubscription( $email )\n\t {\n\t \t$obj = Doctrine_Core::getTable ( 'User' )->findOneByemail ( $email );\n\t \t$obj->downloadStatus = \"paid\";\n\t \t$obj->save();\n\t \treturn $obj->id;\n\t }", "public function update(Request $request, $id)\n {\n $data=$request->except('_token');\n $subscriber=Subscriber::find($id);\n\n $subscriber->fill($data);\n $subscriber->save();\n return redirect('admin/subscribers')->with('request', $subscriber)->with('success', 'Subscriber Updated Successfully.');\n }", "function ihc_update_stripe_subscriptions(){\n\tglobal $wpdb;\n\t$data = $wpdb->get_results(\"SELECT id, txn_id, payment_data FROM \" . $wpdb->prefix . \"indeed_members_payments\n\t\t\t\t\t\t\t\t\tWHERE txn_id LIKE 'ch_%';\");\n\tif (count($data)){\n\n\t\t//loading stripe libs\n\t\trequire_once IHC_PATH . 'classes/stripe/init.php';\n\t\t$secret_key = get_option('ihc_stripe_secret_key');\n\t\t\\Stripe\\Stripe::setApiKey($secret_key);\n\n\t\tforeach ($data as $obj){\n\t\t\t$payment_data = json_decode($obj->payment_data);\n\t\t\tif (!empty($payment_data->customer)){\n\t\t\t\t$replace_txn_id = $payment_data->customer;\n\t\t\t} else {\n\t\t\t\t$stripe_obj = \\Stripe\\Charge::retrieve($obj->txn_id);\n\t\t\t\tif (!empty($stripe_obj->customer)){\n\t\t\t\t\t$replace_txn_id = $stripe_obj->customer;\n\t\t\t\t}\n\t\t\t\tunset($stripe_obj);\n\t\t\t}\n\t\t\tif (!empty($replace_txn_id)){\n\t\t\t\t$wpdb->query(\"UPDATE \" . $wpdb->prefix . \"indeed_members_payments\n\t\t\t\t\t\t\t\tSET txn_id='\" . $replace_txn_id . \"'\n\t\t\t\t\t\t\t\tWHERE id= '\" . $obj->id . \"';\n\t\t\t\t\t\t\");\n\t\t\t\tunset($replace_txn_id);\n\t\t\t}\n\t\t}//end foreach\n\t}\n}", "public function update(Request $request,$id)\n {\n $SubscriptionAppointment = SubscriptionAppointment::find($id);\n $SubscriptionAppointment->update($request->all());\n return response(\n [\n 'error'=> false,\n 'data'=> $SubscriptionAppointment\n ]\n ,201);\n }", "public function update(Request $request, $id)\n {\n $request->discount = $this->addDigits($request->discount);\n $request->price = $this->addDigits($request->price);\n\n $validator = Validator::make($request->all(), RulesController::SubscriptionAdminUpdate());\n\n if($validator->fails()){\n return redirect()\n ->route('admin.subs.subscriptiontype.view', $id)\n ->withErrors($validator)\n ->withInput();\n }\n\n $sub = $this->subscriptionType->find($id);\n $sub->name = $request->name;\n $sub->price = str_replace(',', '.', $request->price);\n $sub->discount = str_replace(',', '.', $request->discount);\n $sub->duration = $request->duration . ' maanden';\n $sub->save();\n\n Session::flash('success_message', 'Gegevens opgeslagen');\n\n return redirect()->route('admin.subs.subscriptiontype.view', $id);\n }", "public function actionUpdate($id) {\n //echo '<pre>'; print_r($_POST);die;\n /*if (substr_count(Yii::app()->session['premission_info']['module_info']['subscribedProduct'], 'U') == 0) {\n Yii::app()->user->setFlash('permission_error', 'You have not permission to access');\n Yii::app()->controller->redirect(\"index.php?r=DashboardPage/index\");\n }*/\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n if (isset($_POST['SubscribedProduct'])) {\n $model->attributes = $_POST['SubscribedProduct'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->subscribed_product_id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function getUpdate($id)\n {\n // dd($id);\n\n $subscription=Subscription::findOrFail($id);\n \n return view('plan.update',compact('subscription'));\n }", "function updateApiSubscriptions() {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n try {\n $subscriptions_table = TABLE_PREFIX . 'api_client_subscriptions';\n $users_table = TABLE_PREFIX . 'users';\n\n DB::execute(\"CREATE TABLE $subscriptions_table (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'ApiClientSubscription',\n user_id int(10) unsigned NOT NULL DEFAULT '0',\n token varchar(40) DEFAULT NULL,\n client_name varchar(100) DEFAULT NULL,\n client_vendor varchar(100) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n last_used_on datetime DEFAULT NULL,\n is_enabled tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n INDEX type (type),\n UNIQUE token (token)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::beginWork('Moving token data to new API subscriptions table @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, token, created_on FROM $users_table\");\n if($rows) {\n foreach($rows as $row) {\n if($row['token']) {\n DB::execute(\"INSERT INTO $subscriptions_table (type, user_id, token, client_name, client_vendor, created_on, is_enabled) VALUES ('ApiClientSubscription', ?, ?, ?, ?, ?, '1')\", $row['id'], $row['token'], 'activeCollab Legacy Token', 'A51', $row['created_on']);\n } // if\n } // foreach\n } // if\n\n DB::commit('Token data moved to new API subscriptions table @ ' . __CLASS__);\n\n DB::execute(\"ALTER TABLE $users_table DROP token\");\n } catch(Exception $e) {\n DB::rollback('Failed to move token data to new API subscriptions table @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function update(Request $request, Prescription $prescription)\n {\n //\n }", "public function update(Request $request, Prescription $prescription)\n {\n //\n }", "public function update($data = array()) {\n if(count($data)) {\n // if subscriber not exist add error and return false \n if(!$this->exist($data['u_id'])) {\n $this->_errors[] = \"this Subscriber is not exist\";\n return false;\n }\n // update subscriber\n if($this->_db->update('subscribers', $data,\n array('u_id', '=', $data['u_id']))) {\n return true;\n }\n }\n\n // if cant update record add this error\n $this->_errors[] = \"Unknow Error\";\n return false;\n }", "public function subscribe(SubscriptionRequestEntity $requestEntity);", "public function update(Request $request, $id)\n {\n \t\n if(Auth::user()->role_id == '3')\n\t\t\t{\n\t\t\t\t $parent_id = Auth::user()->id;\t\t\t\n\t\t\t}else{\n\t\t\t\t $parent_id = Auth::user()->parent_id;\t\t\t\n\t\t\t}\n \n\t\t \n\t\t\t$subscribe = SubscribeUsers::find($id);\n $subscribe->user_id = $request->input('user_id');\n\t\t\t$subscribe->subscribe_id = $request->input('subscribe_id');\n\t\t $subscribe->user_created = $request->input('user_created');\n $subscribe->user_updated = $request->input('user_updated');\t\n $subscribe->save();\n\t\t\t\t\t$request->session()->flash('alert-success', 'Subscribe was successfully Updated!');\n\t\t\treturn redirect('subscribeusers');\n }", "public function save(array $data) {\n $subscription = new Subscriptions();\n \n $subscription->user()->associate($data['customer']);\n $subscription->service()->associate($data['service']);\n $subscription->status()->associate($data['status']);\n $subscription->status_change = $data['date'];\n \n if (isset($data['previousStatus'])) {\n $subscription->previousStatus()->associate($data['previousStatus']);\n }\n \n $subscription->save();\n\n return $subscription;\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n // UPDATE\n }", "public function updatesubscription($slug) {\n $paymentData = $this->repository->proccessSubscriptionPayment ( $slug );\n\n if (isset ( $paymentData )) {\n return view ( 'payment::customer.payment.ccavRequestHandler' )->with ( 'encrypted_data', $paymentData );\n } else {\n return false;\n }\n }", "public function update($bunch_id , $subscriber_id, SubscriberRequest $request) {\n\n\n $update = Subscriber::find($subscriber_id);\n\n $update->update($request->all());\n\n return redirect()->route('subscriber.index',[$bunch_id]);\n\n }", "public function update(UpdateSubscriptionOptionRequest $request)\n {\n try {\n $subscriptionOption = $this->subscriptionOption->update($request->subscriptionOption, $request->validated());\n\n return $this->responseOk(new SubscriptionPlanOptionResource($subscriptionOption));\n } catch (Exception $e) {\n return $this->responseInternalError($e->getMessage());\n }\n }", "public function update(Request $request, ResourceSubject $resourceSubject)\n {\n //\n }", "function pgm_add_subscription( $subscriber_id, $list_id ) {\n\n // setup default return value\n $subscription_saved = false;\n\n // IF the subscriber does NOT have the current list subscription\n if( !pgm_subscriber_has_subscription( $subscriber_id, $list_id ) ){\n\n // get subscriptions and append new $list_id\n $subscriptions = pgm_get_subscriptions( $subscriber_id );\n $subscriptions[]=$list_id;\n\n // update pgm_subscriptions\n update_field( pgm_get_acf_key('pgm_subscriptions'), $subscriptions, $subscriber_id );\n\n // subscriptions updated!\n $subscription_saved = true;\n\n }\n\n // return result\n return $subscription_saved;\n\n}", "public function updated(PlanSubscription $planSubscription)\n {\n\n if($planSubscription->status==\"PENDING\"){\n $planSubscription->is_paid = false;\n $planSubscription->save();\n }\n if($planSubscription->status==\"SUSPENDED\"){\n $planSubscription->is_paid = false;\n $planSubscription->save();\n }\n if($planSubscription->status==\"CANCELLED\"){\n $planSubscription->is_paid = false;\n $planSubscription->cancelled_on = Carbon::now();\n $planSubscription->save();\n }\n if($planSubscription->status==\"CANCELLED_BY_RECEIVER\"){\n $planSubscription->is_paid = false;\n $planSubscription->cancelled_on = Carbon::now();\n $planSubscription->save();\n }\n if($planSubscription->status==\"CANCELLED_BY_SENDER\"){\n $planSubscription->is_paid = false;\n $planSubscription->cancelled_on = Carbon::now();\n $planSubscription->save();\n }\n }", "public function update(Request $request)\n {\n $data = $request->all();\n\n try{ \n\n DB::table('subscriptions')->truncate();\n DB::table('subscription_payments')->truncate();\n\n $subsription_title = $data['subsription_title'];\n $countname = sizeof($subsription_title);\n for($i = 0; $i < $countname; $i++){\n \n if($data['subsription_title'][$i]){\n\n $packageData['subsription_title'] = $data['subsription_title'][$i];\n $packageData['is_one_month'] = $data['is_one_month'][$i];\n $packageData['one_month_feature'] = $data['one_month_feature'][$i];\n $packageData['is_three_month'] = $data['is_three_month'][$i];\n $packageData['three_month_feature'] = $data['three_month_feature'][$i];\n $packageData['is_six_month'] = $data['is_six_month'][$i];\n $packageData['six_month_feature'] = $data['six_month_feature'][$i];\n $packageData['is_one_year'] = $data['is_one_year'][$i];\n $packageData['one_year_feature'] = $data['one_year_feature'][$i];\n\n $this->subscription->save($packageData);\n }\n }\n\n $paymentData = array(\n 'one_month_payment' => $data['one_month_payment'],\n 'three_month_payment' => $data['three_month_payment'],\n 'six_month_payment' => $data['six_month_payment'],\n 'one_year_payment' => $data['one_year_payment'],\n ); \n \n $this->subscription->savePayment($paymentData);\n \n alertify()->success('Subscription Updated Successfully');\n }catch(\\Throwable $e){\n alertify($e->getMessage())->error();\n }\n \n return redirect(route('subscription.index'));\n\n }", "public function updateSubscription(string $subscriptionId, string $paymentMethodToken)\n {\n $response = $this->request('PUT', 'billing/subscriptions/'.$subscriptionId.'/paymentmethod/'.$paymentMethodToken);\n\n return \\harmonic\\Ezypay\\Resources\\Subscription::make($response)->resolve();\n }", "public function api_entry_subscribeAPN() {\n parent::validateParams(array('user', 'udid', 'devicetoken'));\n\n $users = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if (!$this->Mdl_Users->get($_POST[\"user\"])) parent::returnWithErr(\"User id is not valid.\");\n\n $user = $this->Mdl_Users->update(array(\n 'id' => $_POST[\"user\"],\n 'udid' => $_POST[\"udid\"],\n 'devicetoken' => $_POST[\"devicetoken\"]\n ));\n\n parent::returnWithoutErr(\"Subscription has been done successfully.\", $user);\n }", "public function update(Request $request, Subasta $subasta)\n {\n //\n }", "function createNewSubscription(array $data){\nreturn $this->post($data, \"/subscription\");\n}", "public function update($subscriberID, $subscriberListID, $emailAddress, $fields, $access)\n\t{\n\n\t\t$command = \"Command=Subscriber.Update\";\n\t\t$subscriberID = \"SubscriberID=\".$subscriberID;\n\t\t$subscriberListID = \"SubscriberListID=\".$subscriberListID;\n\t\t$emailAddress = \"EmailAddress=\".$emailAddress;\n\t\t$fields = \"Fields=\".$fields;\n\t\t$access = \"Access=\".$access;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$subscriberID\n\t\t\t\t\t\t.'&'.$subscriberListID\n\t\t\t\t\t\t.'&'.$emailAddress\n\t\t\t\t\t\t.'&'.$fields\n\t\t\t\t\t\t.'&'.$access\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "function update($email, $subscriber) {\n return $this->put_request($this->_subscribers_base_route.'.json?email='.urlencode($email), $subscriber);\n }", "abstract public function add_subscription( Payment_Subscription $subscription );", "public function update(Request $request, Renew $renew)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter) {\n //\n }", "public function handleCustomerSubscriptionUpdated($payload)\n {\n // Handle The Event\n $user = $this->getUserByStripeId($payload['data']['object']['customer']);\n if ( $user ) {\n $subscription = $user->subscriptions->filter(function ($subscription) use ($payload) {\n return $subscription->stripe_id === $payload['data']['object']['id'];\n })->first();\n $subscription->current_period_start = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_start']);\n $subscription->current_period_end = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_end']);\n $subscription->status = $payload['data']['object']['status'];\n $subscription->name = $payload['data']['object']['plan']['name'];\n\n\n try{\n $client = new Client;\n $result = $client->request('POST', 'https://api2.autopilothq.com/v1/contact', [\n 'headers' => [\n 'autopilotapikey' => env('AUTOP'),\n 'Content-Type' => 'application/json'\n ],\n 'json' => [\n 'contact' => [\n 'Email' => $user->email,\n 'custom' => [\n 'string--Subscription--Status' => $payload['data']['object']['status'],\n 'string--Subscription--Plan' => $payload['data']['object']['plan']['name'],\n ],\n '_autopilot_list' => '9ECC7B84-9EB3-43EB-8C08-72A20E2573EA'\n ]\n ]\n ]);\n \n } catch (RequestException $e) {\n \n } catch (ClientException $e) {\n \n }\n\n\n $subscription->save();\n return $subscription;\n }\n\n }", "public function update(Request $request)\n {\n $id = $request->id;\n $key = Session::get('apiKeySession');\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, 'https://api.mailerlite.com/api/v2/subscribers/'.$id);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"fields\\\": {\\\"name\\\": \\\"$request->name\\\", \\\"country\\\": \\\"$request->country\\\"}}\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n \n $headers = [\n 'Content-Type: application/json',\n 'X-Mailerlite-Apikey: '.$key\n ];\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n $result = curl_exec($ch);\n\n if (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n }\n\n curl_close ($ch);\n return redirect('/list');\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function update(Request $request, Preinscription $preinscription)\n {\n //\n }", "public function update(Request $request, Subscriber $subscriber)\n {\n $this->validate($request, [\n 'topic_id' => 'required',\n 'url' => [\n 'required', 'string', 'max:255',\n Rule::unique('subscribers', 'url')->ignore($subscriber->url, 'url'),\n ],\n ]);\n $subscriber->topic_id = $request->topic_id;\n $subscriber->url = $request->url;\n if ($subscriber->update()){\n return back()->with('success', 'Updated Successfully.');\n } else {\n return back()->with('failed','Failed something went wrong!');\n }\n }", "public function update(Request $request, $id)\n {\n // dd($request->toArray());\n\n $this->validate($request,[\n\n 'name' => 'required',\n 'email' => 'required|email',\n 'ph_no' => 'required|',\n 'subscription' => 'required',\n ]);\n\n $user = User::find($id);\n\n if ($request->hasFile('file')) \n {\n $image = $request->file;\n\n $new_image = time().$image->getClientOriginalName();\n\n $image->move('uploads/user_images',$new_image);\n\n $user->image = 'uploads/user_images/'.$new_image;\n }\n\n $user->name = $request->name;\n $user->email = $request->email;\n $user->phone_number = $request->ph_no;\n $user->latitude = $request->lat;\n $user->longitude = $request->log;\n $user->address = $request->address;\n\n $user->save(); \n \n\n $subscription = Subscription::where('detailer_id', $id)->first();\n\n $subscription->detailer_subscriptions = $request->subscription;\n $subscription->remaining_subscriptions = $request->subscription - $request->used_subscription;\n\n DB::table('warranty_codes')\n ->where('car_details_id',$subscription->id)\n ->where('status',0)\n ->delete();\n\n for($i=1; $i<=$request->subscription; $i++)\n {\n DB::table('warranty_codes')->insert([\n\n 'car_details_id' => $subscription->id,\n 'status' => 0,\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }\n\n $subscription->save();\n\n\n\n Session::flash('success','Deatailer Updated Successfully');\n\n return redirect()->route('detailers');\n }", "public function setSubscriptionForChange( $changeId, $subscriptionId )\n {\n $query = 'UPDATE {changes} SET subscription_id = %d WHERE change_id = %d';\n $this->connection->execute( $query, $subscriptionId, $changeId );\n }", "public function update(SplSubject $publisher){\r\n \r\n }", "private function editSubscriber($params){\n $client = new SoapClient('http://api.e-goi.com/v2/soap.php?wsdl');\n $result = $client->editSubscriber($params);\n return $result;\n }", "public function update(Request $request, HashtagSubscriber $hashtagSubscriber)\n {\n //\n }", "public function update(Request $request, $subdomain,$id)\n {\n //\n }", "public function updateSubscriptionSettings(){\n if( Request::isMethod('post') && Session::token() == Input::get('_token') ){\n $get_subscription_settings_option = Option :: where('option_name', '_subscription_settings_data')->first();\n \n if(!empty($get_subscription_settings_option)){\n $subscription_settings_data = unserialize($get_subscription_settings_option->option_value);\n \n $visibility = (Input::has('subscriptions_visibility')) ? true : false;\n $cookie_visibility = (Input::has('subscribe_popup_cookie_set')) ? true : false;\n \n if(isset($subscription_settings_data['subscription_visibility'])){\n $subscription_settings_data['subscription_visibility'] = $visibility; \n }\n \n if(isset($subscription_settings_data['subscribe_type'])){\n $subscription_settings_data['subscribe_type'] = Input::get('subscriptions_type'); \n }\n \n if(isset($subscription_settings_data['subscribe_options'])){\n $subscription_settings_data['subscribe_options'] = Input::get('subscribe_options'); \n }\n \n if(isset($subscription_settings_data['popup_bg_color'])){\n $subscription_settings_data['popup_bg_color'] = Input::get('subscriptions_popup_bg_color'); \n }\n \n if(isset($subscription_settings_data['popup_content'])){\n $subscription_settings_data['popup_content'] = string_encode(Input::get('subscription_content_editor')); \n }\n \n $subscription_settings_data['popup_display_page'] = Input::get('popup_display'); \n \n if(isset($subscription_settings_data['subscribe_btn_text'])){\n $subscription_settings_data['subscribe_btn_text'] = Input::get('subscribe_btn_text'); \n }\n \n if(isset($subscription_settings_data['subscribe_popup_cookie_set_visibility'])){\n $subscription_settings_data['subscribe_popup_cookie_set_visibility'] = $cookie_visibility; \n }\n \n if(isset($subscription_settings_data['subscribe_popup_cookie_set_text'])){\n $subscription_settings_data['subscribe_popup_cookie_set_text'] = Input::get('subscribe_popup_cookie_set_text'); \n }\n\n $data = array(\n 'option_value' => serialize($subscription_settings_data)\n );\n\n if( Option::where('option_name', '_subscription_settings_data')->update($data))\n {\n Session::flash('success-message', Lang::get('admin.successfully_updated_msg'));\n return redirect()->back();\n }\n } \n }\n }", "public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }", "public function updateSubscription($oldSubscription, $newSubscription)\n {\n $oldSubscription->plan = $newSubscription->plan_level;\n\n return $oldSubscription;\n }", "public function update(Request $request, $id)\n {\n $adminsubs = Subject::findOrFail($id);\n $adminsubs->fill($request->all());\n $adminsubs->save();\n\n session()->flash('mensagem', 'Cidade atualizada com sucesso!');\n return redirect()->route('admin.index');\n\n /*$s = Subject::findOrFail($id);\n $s->fill([\n 'name' => $request->name,\n 'price' => $request->price\n ]);*/\n \n //$subject->fill($request->all());\n //$subject->save();\n\n }", "function og_simplenews_save_subscriptions($tid, $emails) {\n // First, delete all subscriptions.\n db_query('DELETE FROM {simplenews_snid_tid} WHERE tid = %d', $tid);\n\n // And now add new. Simplenews sucks.\n require_once drupal_get_path('module', 'simplenews') . '/includes/simplenews.admin.inc';\n $form_state['values'] = array(\n 'emails' => $emails,\n 'newsletters' => array(\n $tid => $tid,\n ),\n );\n drupal_execute('simplenews_subscription_list_add', $form_state);\n}", "public function update(Request $request, Purchase $purchase)\n {\n //\n }", "public function update(Request $request, Purchase $purchase)\n {\n //\n }", "public function update(Request $request, Purchase $purchase)\n {\n //\n }", "public function update(Request $request, Purchase $purchase)\n {\n //\n }", "public function edit(SubscribedUser $subscribedUser)\n {\n //\n }", "private function calculateSubscription()\n {\n $subscription = new Subscription();\n $result = $subscription->getById($this->subscription['name'])[0];\n if ($result === FALSE) {\n $this->subscription['final_price'] = \"0.00\";\n } else {\n $result['date'] = $this->subscription['date'];\n $result['days'] = $subscription->calculateAmountOfDays($this->subscription['date']);\n $result['total'] += $result['price_per_day'] * $result['days'];\n $this->subtotal += $result['total'];\n }\n\n $this->subscription = $result;\n\n }", "function it_exchange_paypal_pro_addon_update_subscriber_id( $paypal_pro_id, $subscriber_id ) {\n\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id( $paypal_pro_id );\n\tforeach( $transactions as $transaction ) { //really only one\n\t\tdo_action( 'it_exchange_update_transaction_subscription_id', $transaction, $subscriber_id );\n\t}\n}", "function renewSubscription(&$subscription) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}", "public function update(Request $request, ss $ss)\n {\n App\\ss::where('active',1)\n ->where('prijs','500')\n ->update('rented');\n }", "public function saveSubscription($subscription)\n {\n $payments = new SubscriptionPayments;\n $payments->recruiter_id = Auth::user()->id;\n $payments->expiryDate = date('Y-m-d H:i:s', $subscription['current_period_end']);\n $payments->trialEnd = $payments->expiryDate;\n if ($subscription['trial_end'] != null) {\n $payments->trialEnd = date('Y-m-d H:i:s', $subscription['trial_end']);\n }\n $payments->paymentId = $subscription['id'];\n $payments->paymentResponse = json_encode($subscription);\n $payments->save();\n }", "public function update($data) {}", "public function update($data) {}", "public function update(\\SplSubject $subject) {}", "public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }", "public function updateSubscriptionStamp( $subscription )\n {\n $subscriptionId = $subscription[ 'subscription_id' ];\n $issueId = $subscription[ 'issue_id' ];\n\n $query = 'UPDATE {subscriptions}'\n . ' SET stamp_id = ( SELECT stamp_id FROM {issues} AS i WHERE i.issue_id = %d )'\n . ' WHERE subscription_id = %d';\n\n $this->connection->execute( $query, $issueId, $subscriptionId );\n }", "public function update($id) //CreateRecurringTransactionRequest $request,\n {\n \\DB::transaction(function() use ($id) {\n $transaction = RecurringTransaction::find($id);\n\n if(Gate::denies('has-transaction', $transaction)) {\n abort(403, 'Thats not yours!');\n }\n\n $transaction->update($this->input);\n });\n }", "public function renewSubscription(){\n $payload = \\file_get_contents(\"php://input\");\n $payload = json_decode($payload);\n \n //$this->db->insert(\"data_logs\",array(\"data\"=>json_encode($payload)));\n $sig_header = $_SERVER[\"HTTP_STRIPE_SIGNATURE\"];\n\n $event = null;\n \n $endpoint_secret = \"whsec_fTUGlyFGWCksjdBMBSRarWFGmCNSdqBb\";\n \n try {\n //$event = \\Stripe\\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); \n //$event = $stripe->events()->find(str_replace(\"&#039;\", \"\", $payload->id));\n //print_r($event);\n //die();\n //if (isset($event) && $event->type == \"invoice.payment_failed\") {\n if(isset($payload) && $payload->type== \"invoice.payment_failed\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n\t\t\t\t$this->Users_model->updateUserDetail($id,array('is_premium'=>0));\n\n\t\t\t\tif($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 0,\n ]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n $status = $stripe->subscriptions()->cancel($subscription->customer_id, $subscription->subscription_id);\n $cancelCard = CreditCards::where('user_id', $order->user_id)->delete();\n \n $subscription->update([\n 'is_cancelled' => 1,\n \"is_premium\" => 0\n ]);*/\n \n }else if(isset($payload) && $payload->type == \"invoice.payment_succeeded\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n $next_recharge_date = next_recharge_date($user['plan_duration']);\n \t$array_payment_log = array(\n\t \"user_id\" => $id,\n\t \"plan_id\" => $user['plan_id'],\n\t \"merchant_response\" => json_encode($payload),\n\t \"charge_date\" => date(\"Y-m-d\"),\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\n\t $insert = array(\n\t 'user_id' => $id,\n\t 'plan_name' => $user['plan_heading'],\n\t 'date' => date('Y-m-d'),\n\t 'next_recharge_date' => $next_recharge_date,\n\t 'plan_id' => $user['plan_id'],\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\t if($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\t\n\t $this->Users_model->insertpaymentLogs($array_payment_log);\n\t $this->Users_model->insertChannelSubscriptionDetail($insert);\n\t $this->Users_model->updateUserDetail($id,array('is_premium'=>1));\n\n //$subscription_duration = $this->config->getByName('subscription_duration');\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 1,\n 'premium_start_date' => Carbon::now(),\n 'premium_end_date' => Carbon::now()->addDays($subscription_duration->value)\n ]);\n \n $order->update(['status' => 'success', 'expiry_date' => Carbon::now()->addDays($subscription_duration->value)]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n \n $subscription->update([\n 'is_cancelled' => 0,\n 'start_date' => Carbon::now(),\n 'end_date' => Carbon::now()->addDays($subscription_duration->value),\n 'plan_name' => 'Your next billing date at \n '.Carbon::now()->addDays($subscription_duration->value)->toDateString()\n ]);*/ \n }\n }catch(\\Cartalyst\\Stripe\\Exception\\UnexpectedValueException $e) {\n // Invalid payload\n print_r($e);\n http_response_code(400); // PHP 5.4 or greater\n exit();\n }\n\n \n }", "private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }", "public function createSubscription($request);", "function update_sub_Customer ($cust) {\n $data = array(\n 'cust_sub_id' => $cust['sub_id']\n );\n $this->db->where('cust_rp_id', $cust['cust_rp_id']);\n $this->db->update('customer', $data); \n }", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }" ]
[ "0.82198447", "0.77688706", "0.77688706", "0.72326773", "0.71456295", "0.7139151", "0.69506", "0.69487906", "0.68895733", "0.6749014", "0.6696416", "0.66491455", "0.66464925", "0.6644341", "0.6602647", "0.65862894", "0.65109265", "0.6499283", "0.64878166", "0.64685255", "0.6447775", "0.6419217", "0.62833464", "0.6277668", "0.6276681", "0.6264373", "0.623735", "0.62145984", "0.6200777", "0.6167495", "0.61673206", "0.61550736", "0.61265844", "0.6098767", "0.6053165", "0.601681", "0.6016245", "0.6015823", "0.6004463", "0.59961015", "0.5987668", "0.5987668", "0.5940233", "0.5924882", "0.59034055", "0.5903225", "0.5864317", "0.5857268", "0.5839123", "0.58278954", "0.5813552", "0.5799924", "0.5781208", "0.5774008", "0.57583815", "0.57433546", "0.5735458", "0.57342356", "0.57328904", "0.57290304", "0.57250947", "0.57160455", "0.5713139", "0.571076", "0.5694852", "0.5693207", "0.5693207", "0.5693059", "0.56921", "0.56767535", "0.5674268", "0.56648546", "0.56623846", "0.56073564", "0.5606219", "0.5606154", "0.5601167", "0.55956566", "0.55922514", "0.5591752", "0.5588143", "0.5588143", "0.5588143", "0.5588143", "0.55834574", "0.55815446", "0.55716825", "0.55679667", "0.55554223", "0.553543", "0.55281854", "0.55281854", "0.5526756", "0.55246216", "0.55229676", "0.5518165", "0.55160123", "0.5514414", "0.5514048", "0.55059636", "0.5500456" ]
0.0
-1
Operation updateWithHttpInfo Update Subscription
public function updateWithHttpInfo($id, $update_subscription_request) { $request = $this->updateRequest($id, $update_subscription_request); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); } catch (RequestException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } catch (ConnectException $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", (int) $e->getCode(), null, null ); } $statusCode = $response->getStatusCode(); if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, (string) $request->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Subscription' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ('\OpenAPI\Client\Model\Subscription' !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Subscription', []), $response->getStatusCode(), $response->getHeaders() ]; } $returnType = '\OpenAPI\Client\Model\Subscription'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\OpenAPI\Client\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); break; } throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function updateSubscription($request);", "public function updateRequest($id, $update_subscription_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling update'\n );\n }\n // verify the required parameter 'update_subscription_request' is set\n if ($update_subscription_request === null || (is_array($update_subscription_request) && count($update_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_subscription_request when calling update'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($update_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($update_subscription_request));\n } else {\n $httpBody = $update_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function update(Request $request, Subscribe $subscribe)\n {\n //\n }", "public function update(Request $request, SubscribedUser $subscribedUser)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n $request->validate([\n 'name' => 'required',\n 'min_labels' => 'required',\n 'max_labels' => 'required'\n ]);\n \n $subscription->update($request->all());\n \n return redirect()->route('subscriptions.index')->with('success',__('success_edit_subscription'));\n }", "public function updateAsyncWithHttpInfo($id, $update_subscription_request)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\n $request = $this->updateRequest($id, $update_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 update(Request $request, Subscriber $subscriber)\n {\n //\n }", "function _updateSubscription(&$subscription) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE subscriptions\n\t\t\t\tSET\n\t\t\t\t\tjournal_id = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\ttype_id = ?,\n\t\t\t\t\tdate_start = %s,\n\t\t\t\t\tdate_end = %s,\n\t\t\t\t\tdate_reminded_before = %s,\n\t\t\t\t\tdate_reminded_after = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\treference_number = ?,\n\t\t\t\t\tnotes = ?\n\t\t\t\tWHERE subscription_id = ?',\n\t\t\t\t$this->dateToDB($subscription->getDateStart()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateEnd()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedBefore()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedAfter())\n\t\t\t), array(\n\t\t\t\t$subscription->getJournalId(),\n\t\t\t\t$subscription->getUserId(),\n\t\t\t\t$subscription->getTypeId(),\n\t\t\t\t$subscription->getStatus(),\n\t\t\t\t$subscription->getMembership(),\n\t\t\t\t$subscription->getReferenceNumber(),\n\t\t\t\t$subscription->getNotes(),\n\t\t\t\t$subscription->getId()\n\t\t\t)\n\t\t);\n\n\t\treturn $returner;\n\t}", "public function update(Request $request, ClassSubscription $classSubscription)\n {\n //\n }", "public function update(manageUserSubscriptionRequest $request, $id)\n {\n $data = Input::all();\n $user_subscription = $this->user_subscription->find($id);\n $data['id'] = $id;\n\n if($user_subscription){\n\n $update = $this->user_subscription->update($data);\n\n if(!$update){\n return response()->json(['error'=>'Server error'],500); \n }else{\n $user_subscription = $this->user_subscription->find($id);\n return response()->json(['success'=>$user_subscription],200);\n }\n\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function postUpdate(Request $request)\n {\n // dd($request->all());\n // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription=Subscription::findOrFail($request->id);\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data updated successfully'));\n \n \n \n\n }", "public function update()\n {\n return $this->putResource(sprintf('/%s', str_replace('{{subscriber_code}}', $this->subscriber_code, self::PATH)));\n }", "public function update(Request $request, $id)\n {\n $subscriber = Subscriber::findOrFail($id);\n $data = $request->all();\n $subscriber->update($data);\n\n return redirect('subscriber')->with('message','Subscriber Updated !');\n }", "public function updated(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'renewed');\n }", "public function update(UpdateRequest $request, $id)\n {\n $chartOfAccount = ChartOfAccount::findOrFail($id);\n $chartOfAccount->type_id = $request->get('type_id');\n $chartOfAccount->sub_ledger = $request->get('sub_ledger') ?? null;\n $chartOfAccount->position = $request->get('position');\n $chartOfAccount->cash_flow = $request->get('cash_flow');\n if ($request->get('cash_flow')) {\n $chartOfAccount->cash_flow_position = $request->get('cash_flow_position') ?? null;\n }\n $chartOfAccount->number = $request->get('number') ?? null;\n $chartOfAccount->alias = $request->get('alias');\n $chartOfAccount->save();\n\n return new ApiResource($chartOfAccount->load(['type', 'group']));\n }", "public function update(Request $request,$id)\n {\n $SubscriptionAppointment = SubscriptionAppointment::find($id);\n $SubscriptionAppointment->update($request->all());\n return response(\n [\n 'error'=> false,\n 'data'=> $SubscriptionAppointment\n ]\n ,201);\n }", "public function update(Request $request, $id)\n {\n $request->discount = $this->addDigits($request->discount);\n $request->price = $this->addDigits($request->price);\n\n $validator = Validator::make($request->all(), RulesController::SubscriptionAdminUpdate());\n\n if($validator->fails()){\n return redirect()\n ->route('admin.subs.subscriptiontype.view', $id)\n ->withErrors($validator)\n ->withInput();\n }\n\n $sub = $this->subscriptionType->find($id);\n $sub->name = $request->name;\n $sub->price = str_replace(',', '.', $request->price);\n $sub->discount = str_replace(',', '.', $request->discount);\n $sub->duration = $request->duration . ' maanden';\n $sub->save();\n\n Session::flash('success_message', 'Gegevens opgeslagen');\n\n return redirect()->route('admin.subs.subscriptiontype.view', $id);\n }", "public function update(Request $request, $id)\n {\n $data=$request->except('_token');\n $subscriber=Subscriber::find($id);\n\n $subscriber->fill($data);\n $subscriber->save();\n return redirect('admin/subscribers')->with('request', $subscriber)->with('success', 'Subscriber Updated Successfully.');\n }", "public function update($TenantID,updateTenantRequest $request){\n DB::beginTransaction();\n try {\n $Tenant = Tenant::where('id',$TenantID)->firstOrFail();\n // if the subscription_date was null it means its a new tenant and we shall send activation email\n if($Tenant->subscription_date == null && $request['status'] == 'active'){\n MailController::SendRequestApprovedEmail($Tenant);\n }\n $Tenant->update([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request['password']),\n 'status' => $request->status,\n 'number_of_branches' => $request->number_of_branches,\n 'subscription_price' => $request->subscription_price,\n 'subscription_date' => $request->subscription_date,\n 'subscription_end_date' => $request->subscription_end_date,\n ]);\n return response()->json(['UpdatedSubscriber'=>$Tenant],200);\n\n DB::commit();\n } catch (\\Exception $e) {\n return response()->json(['Error'=>$e],500);\n\n DB::rollback();\n }\n }", "public function edit(Subscription $subscription)\n {\n //\n }", "public function update(UpdateAccountPayableRequest $request, $id)\n {\n DB::connection('tenant')->beginTransaction();\n\n $cutOffAccountPayable = CutOffAccountPayable::findOrFail($id);\n $cutOffAccountPayable->chart_of_account_id = $request->get('chart_of_account_id');\n $cutOffAccountPayable->supplier_id = $request->get('supplier_id');\n $cutOffAccountPayable->notes = $request->get('notes');\n $cutOffAccountPayable->amount = $request->get('amount');\n $cutOffAccountPayable->save();\n\n DB::connection('tenant')->commit();\n\n return new ApiResource($cutOffAccountPayable);\n }", "public function update(Request $request, ResourceSubject $resourceSubject)\n {\n //\n }", "public function update(Request $request)\n {\n $id = $request->id;\n $key = Session::get('apiKeySession');\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, 'https://api.mailerlite.com/api/v2/subscribers/'.$id);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"fields\\\": {\\\"name\\\": \\\"$request->name\\\", \\\"country\\\": \\\"$request->country\\\"}}\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n \n $headers = [\n 'Content-Type: application/json',\n 'X-Mailerlite-Apikey: '.$key\n ];\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n $result = curl_exec($ch);\n\n if (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n }\n\n curl_close ($ch);\n return redirect('/list');\n }", "public function update(UpdateSubscriptionOptionRequest $request)\n {\n try {\n $subscriptionOption = $this->subscriptionOption->update($request->subscriptionOption, $request->validated());\n\n return $this->responseOk(new SubscriptionPlanOptionResource($subscriptionOption));\n } catch (Exception $e) {\n return $this->responseInternalError($e->getMessage());\n }\n }", "public function updateTenant($tenantId, $request)\n {\n return $this->start()->uri(\"/api/tenant\")\n ->urlSegment($tenantId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function update(Request $request, $subdomain,$id)\n {\n //\n }", "public function update(Request $request, HashtagSubscriber $hashtagSubscriber)\n {\n //\n }", "public function update(Request $request, Subasta $subasta)\n {\n //\n }", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function update($id)\n\t{\n//\t\t$subscription = Subscription::findOrFail($id);\n\n//\t\t$validator = Validator::make($data = Input::all(), Subscription::$rules);\n//\n//\t\tif ($validator->fails())\n//\t\t{\n//\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n//\t\t}\n//\n//\t\t$subscription->update($data);\n\n\t\treturn Redirect::route('subscriptions.index');\n\t}", "public function update(Request $request, $id): Response\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'string',\n 'body' => 'string',\n ]);\n\n\n // Sending error if validation failed\n if ($validator->fails()) {\n return $this->errorApiReponse($validator->errors()->messages(), 400);\n }\n\n $fields = $request->request->all();\n\n $topic = Topic::where('id', $id)->first();\n\n $topic->update($fields);\n $topic->save();\n\n return $this->apiResponse('Topic modified', $topic);\n }", "public function update(InfoRequest $request, Info $info)\n {\n //\n }", "public function update($subscriberID, $subscriberListID, $emailAddress, $fields, $access)\n\t{\n\n\t\t$command = \"Command=Subscriber.Update\";\n\t\t$subscriberID = \"SubscriberID=\".$subscriberID;\n\t\t$subscriberListID = \"SubscriberListID=\".$subscriberListID;\n\t\t$emailAddress = \"EmailAddress=\".$emailAddress;\n\t\t$fields = \"Fields=\".$fields;\n\t\t$access = \"Access=\".$access;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$subscriberID\n\t\t\t\t\t\t.'&'.$subscriberListID\n\t\t\t\t\t\t.'&'.$emailAddress\n\t\t\t\t\t\t.'&'.$fields\n\t\t\t\t\t\t.'&'.$access\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "public function update( $data ){\n\t\t$response = $this->curl->put( $this->api_url . '/' . $data['id'], [ \n\t\t\t'access_token' \t\t\t\t=> $this->token,\n\t\t\t'name'\t\t\t\t\t\t=> $data['name'],\n\t\t\t'url'\t\t\t\t\t\t=> $data['url'],\n\t\t\t'price'\t\t\t\t\t\t=> $data['price'],\n\t\t\t'description'\t\t\t\t=> $data['description'],\n\t\t\t'preview_url'\t\t\t\t=> $data['preview_url'],\n\t\t\t'countries_available'\t\t=> $data['countries_available'],\n\t\t\t'max_purchase_count'\t\t=> $data['max_purchase_count'],\n\t\t\t'customizable_price'\t\t=> $data['customizable_price'],\n\t\t\t'webhook'\t\t\t\t\t=> $data['webhook'],\n\t\t\t'require_shipping'\t\t\t=> $data['require_shipping'],\n\t\t\t'shown_on_profile'\t\t\t=> $data['shown_on_profile'],\n\t\t\t'custom_receipt'\t\t\t=> $data['custom_receipt'],\n\t\t\t'custom_summary'\t\t\t=> $data['custom_summary'],\n\t\t\t'custom_product_type'\t\t=> $data['custom_product_type'],\n\t\t\t'custom_filetype'\t\t\t=> $data['custom_filetype'],\n\t\t\t'custom_permalink'\t\t\t=> $data['custom_permalink']\n\t\t]);\n\t\t\n\t\treturn $response;\n \t}", "public function pauseWithHttpInfo($id, $pause_subscription_request = null)\n {\n $request = $this->pauseRequest($id, $pause_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }", "public function update(int $id, array $data): \\Psr\\Http\\Message\\ResponseInterface\n {\n return $this->data = $this->service->http->put($this->service->host . \"$this->endpoint/$id\", [\n 'form_params' => $data\n ]);\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n // UPDATE\n }", "public function update($id, $update_subscription_request)\n {\n list($response) = $this->updateWithHttpInfo($id, $update_subscription_request);\n return $response;\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function update(string $slug, int $id, array $attributes): ResponseInterface;", "public function updateSubscriptionBilling(Subscription &$subscription, $data)\r\n {\r\n $subscription->setProductId($data['productId']);\r\n $subscription->setPurchasedToken($data['purchasedToken']);\r\n\r\n $this->entityManager->merge($subscription);\r\n $this->entityManager->flush();\r\n return $subscription;\r\n }", "public function postEdit($subscriptionId) {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ( $subscriptionId )) {\n $isCreated = true;\n $this->request->session ()->flash ( 'success', trans ( 'customer::subscription.update.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.update.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::subscription.update.error' ) );\n }", "public function update(Request $request, $id)\n {\n $service = Service::findOrFail($id);\n $validator = Validator::make($request->all(),[\n \"customer_name\" => \"required|min:1|string\",\n \"unit\" => \"required\",\n \"dp\" => \"required\",\n ]);\n\n if ($validator->fails()) {\n return response()->json([\"errors\" => $validator->errors()], 422);\n }\n\n $service->update([\n \"customer_name\" => $request->customer_name,\n \"dp\" => $request->dp,\n \"unit\" => $request->unit,\n ]);\n \n return response()->json([\"msg\", \"Berhasil di update\" ]);\n }", "public function update(Request $request, TiendaApi $tiendaApi)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter) {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, BotSpeak $botSpeak)\n {\n //\n }", "public function updateSubtag(Request $request, int $id)\n {\n $this->repository->updateSubtag($id, $request->all());\n return response()->json(['message' => 'update subtag successfully'], 200);\n }", "public function update(Request $request, Account $account) {\n //\n }", "public function update(Request $request, Sublivres $sublivres)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function updateApiInfo(Request $request)\n {\n\n $v = \\Validator::make($request->all(), [\n 'api_key' => 'required', 'sms_gateway' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('user/sms-api/info')->withErrors($v->errors());\n }\n\n if ($request->api_key != '') {\n Client::where('id', Auth::guard('client')->user()->id)->where('api_access', 'Yes')->update([\n 'api_key' => $request->api_key,\n 'api_gateway' => $request->sms_gateway\n ]);\n }\n\n\n return redirect('user/sms-api/info')->with([\n 'message' => language_data('API information updated successfully', Auth::guard('client')->user()->lan_id)\n ]);\n\n }", "public function update_subscription( $data ) {\r\n global $wpdb;\r\n\r\n // leave only the required keys\r\n $data = array_intersect_key( $data, LaterPay_Helper_Subscription::get_default_options() );\r\n\r\n // fill values that weren't set from defaults\r\n $data = array_merge( LaterPay_Helper_Subscription::get_default_options(), $data );\r\n\r\n unset( $data['lp_id'] ); // unset key ( used in WP schema ) before inserting to custom table.\r\n\r\n // pass_id is a primary key, set by autoincrement\r\n $id = $data['id'];\r\n unset( $data['id'] );\r\n\r\n // format for insert and update statement\r\n $format = array(\r\n '%d', // duration\r\n '%d', // period\r\n '%d', // access_to\r\n '%d', // access_category\r\n '%f', // price\r\n '%s', // revenue_model\r\n '%s', // title\r\n '%s', // description\r\n );\r\n\r\n if ( empty( $id ) ) {\r\n $wpdb->insert(\r\n $this->table,\r\n $data,\r\n $format\r\n );\r\n $data['id'] = $wpdb->insert_id;\r\n } else {\r\n $wpdb->update(\r\n $this->table,\r\n $data,\r\n array( 'id' => $id ),\r\n $format,\r\n array( '%d' ) // pass_id\r\n );\r\n $data['id'] = $id;\r\n }\r\n\r\n // purge cache\r\n LaterPay_Helper_Cache::purge_cache();\r\n\r\n return $data;\r\n }", "public function update(UpdateRequest $request, $id)\n {\n //\n }", "public function getUpdate($id)\n {\n // dd($id);\n\n $subscription=Subscription::findOrFail($id);\n \n return view('plan.update',compact('subscription'));\n }", "public function update(Classes\\UpdateRequest $arg) {\n\t\treturn $this->makeSoapCall(\"update\", $arg);\n\t}", "public function createWithHttpInfo($create_subscription_request)\n {\n $request = $this->createRequest($create_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function update(Request $request, Topic $topic)\n {\n //\n }", "public function update(\n string $id,\n array $body,\n ?RequestOptions $options = null,\n ): ResponseInterface;", "public static function updateIt(int $id, array $request);", "public function update(Request $request, InvoicesDetails $invoicesDetails)\n {\n //\n }", "public function update(Request $request, $id)\n {\n try{\n\n $events = Customer::find($id)->update($request->All());\n $data = Customer::find($id);\n $response = $this->generateItem($data);\n return $this->sendResponse($response, 201);\n\n\n }catch (\\Exception $e) {\n return $this->sendIseResponse($e->getMessage());\n }\n }", "public function update($account, $id, Request $request)\n {\n $this->service->update($id, Input::get('data'), Input::get('view_name'), Input::get('published'));\n return $request->all();\n }", "public function update(Request $request, Ac $ac)\n {\n //\n }", "public function update(Request, $request)\n {\n \n\n }", "public function updateSubscription($data, $where) {\n $this->db->update($this->table, $data, $where);\n if ($this->db->affected_rows() > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function update(Request $request, SubTopic $subTopic)\n {\n $request->validate([\n 'course_id' => 'required',\n 'title' => 'required',\n 'content' => 'required',\n ]);\n\n $slug = Str::slug($request->title);\n\n $subTopic->update([\n 'title' => $request->title, 'slug' => $slug\n ]);\n\n $content = ModelsContent::whereSubTopicId($subTopic->id)->first();\n $content->update(['content' => $request->content]);\n\n $sub_topic = $subTopic->load('contents');\n\n return response()->json([\n 'success' => true,\n 'data' => [\n 'data' => $sub_topic,\n ]\n ], 200);\n }", "public function nspiUpdate(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n\n $fields = [\n 'time' => 'is_numeric',\n 'nonce' => 'is_string',\n 'hash' => 'is_string',\n ];\n $result = $this->basicAuthenticator($fields, $data);\n\n if (!empty($result['error'])) {\n return new JsonResponse($result);\n }\n if (!empty($data['authenticator']['identifier'])) {\n if ($data['authenticator']['identifier'] != self::ACQTEST_ID && $data['authenticator']['identifier'] != self::ACQTEST_ERROR_ID) {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Subscription not found')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n if ($data['authenticator']['identifier'] == self::ACQTEST_ERROR_ID) {\n return new JsonResponse(FALSE);\n }\n else {\n $result = $this->validateAuthenticator($data);\n // Needs for update definition.\n $data['body']['spi_def_update'] = TRUE;\n $spi_data = $data['body'];\n\n $result['body'] = ['spi_data_received' => TRUE];\n if (isset($spi_data['spi_def_update'])) {\n $result['body']['update_spi_definition'] = TRUE;\n }\n\n // Reflect send_method as nspi_messages if set.\n if (isset($spi_data['send_method'])) {\n $result['body']['nspi_messages'][] = $spi_data['send_method'];\n }\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n if (isset($spi_data['test_validation_error'])) {\n // Force a validation fail.\n $result['authenticator']['nonce'] = 'TEST';\n }\n\n $site_action = $spi_data['env_changed_action'];\n // First connection.\n if (empty($spi_data['site_uuid'])) {\n $site_action = 'create';\n }\n\n switch ($site_action) {\n case 'create':\n $result['body']['site_uuid'] = self::ACQTEST_SITE_UUID;\n // Set machine name.\n \\Drupal::state()->set('acqtest_site_machine_name', $spi_data['machine_name']);\n // Set name.\n \\Drupal::state()->set('acqtest_site_name', $spi_data['name']);\n $acquia_hosted = (int) filter_var($spi_data['acquia_hosted'], FILTER_VALIDATE_BOOLEAN);\n \\Drupal::state()->set('acqtest_site_acquia_hosted', $acquia_hosted);\n\n $result['body']['nspi_messages'][] = t('This is the first connection from this site, it may take awhile for it to appear on the Acquia Network.');\n return new JsonResponse($result);\n\n break;\n case 'update':\n $update = $this->updateNspiSite($spi_data);\n $result['body']['nspi_messages'][] = $update;\n break;\n\n case 'unblock':\n \\Drupal::state()->delete('acqtest_site_blocked');\n $result['body']['spi_error'] = '';\n $result['body']['nspi_messages'][] = t('Your site has been unblocked and is sending data to Acquia Cloud.');\n return new JsonResponse($result);\n\n break;\n case 'block':\n \\Drupal::state()->set('acqtest_site_blocked', TRUE);\n $result['body']['spi_error'] = '';\n $result['body']['nspi_messages'][] = t('You have blocked your site from sending data to Acquia Cloud.');\n return new JsonResponse($result);\n\n break;\n }\n\n // Update site name if it has changed.\n $tacqtest_site_name = \\Drupal::state()->get('acqtest_site_name');\n if (isset($spi_data['name']) && $spi_data['name'] != $tacqtest_site_name) {\n if (!empty($tacqtest_site_name)) {\n $name_update_message = t('Site name updated (from @old_name to @new_name).', [\n '@old_name' => $tacqtest_site_name,\n '@new_name' => $spi_data['name'],\n ]);\n\n \\Drupal::state()->set('acqtest_site_name', $spi_data['name']);\n }\n $result['body']['nspi_messages'][] = $name_update_message;\n }\n\n // Detect Changes.\n if ($changes = $this->detectChanges($spi_data)) {\n $result['body']['nspi_messages'][] = $changes['response'];\n $result['body']['spi_error'] = TRUE;\n $result['body']['spi_environment_changes'] = json_encode($changes['changes']);\n return new JsonResponse($result);\n }\n\n unset($result['secret']);\n return new JsonResponse($result);\n }\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Invalid arguments')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }", "public function update(Request $request, string $id): Response\n {\n return $this->_notimplemented();\n }", "public function update($id)\n {\n $tax = CustomTax::whereCompanyId($this->scope->id())->whereId($id)->firstOrFail();\n $input = Request::onlyLegacy('title', 'tax_rate');\n $validator = Validator::make($input, ['title' => 'required']);\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n try {\n $tax->title = $input['title'];\n $tax->tax_rate = $input['tax_rate'];\n $tax->save();\n\n return ApiResponse::success([\n 'message' => trans('response.success.updated', ['attribute' => 'Tax']),\n 'custom_tax' => $this->response->item($tax, new CustomTaxesTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function Update()\n {\n \t$rs = mysql_query(\"UPDATE subscriptions SET subscription_name_fr='\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', subscription_name_en='\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_fr='\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_en='\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_by_id='\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_date='\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t \t\t\t\t \"' WHERE subscription_id=\" . $this->subscription_id);\n \t\t\n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\n }", "public function update(Request $request, Prescription $prescription)\n {\n //\n }", "public function update(Request $request, Prescription $prescription)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //put (post+get)\n }", "public function updateAsync($id, $update_subscription_request)\n {\n return $this->updateAsyncWithHttpInfo($id, $update_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function update(Request $request) {\n \n \n }", "protected function handleSubscriptionUpdated(array $data): void\n {\n $this->configureStripeClient();\n $stripeSubscription = $data['data']['object'];\n $subscription = Subscription::find()->status(null)->reference($stripeSubscription['id'])->one();\n\n if (!$subscription) {\n Craft::warning('Subscription with the reference “' . $stripeSubscription['id'] . '” not found when processing webhook ' . $data['id'], 'stripe');\n\n return;\n }\n\n // See if we care about this subscription at all\n $subscription->setSubscriptionData($data['data']['object']);\n\n $this->setSubscriptionStatusData($subscription);\n\n if (empty($data['data']['object']['plan'])) {\n Craft::warning($subscription->reference . ' contains multiple plans, which is not supported. (event \"' . $data['id'] . '\")', 'stripe');\n } else {\n $planReference = $data['data']['object']['plan']['id'];\n $plan = Commerce::getInstance()->getPlans()->getPlanByReference($planReference);\n\n if ($plan) {\n $subscription->planId = $plan->id;\n } else {\n Craft::warning($subscription->reference . ' was switched to a plan on Stripe that does not exist on this Site. (event \"' . $data['id'] . '\")', 'stripe');\n }\n }\n\n Commerce::getInstance()->getSubscriptions()->updateSubscription($subscription);\n }", "public function update(Request $request, NoteInformation $noteInformation)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $subcategory = SubCategory::where('id', $id)->first();\n\n $subcategory->name = request('name') ?? $subcategory->name;\n $subcategory->category_id = request('category_id') ?? $subcategory->category_id;\n $subcategory->update();\n return response()->json([\n 'status' => 'done',\n 'message' => 'Successfully sub_category updated '\n ]);\n }", "public function update(Request $request, $id){\n $purchase = Purchase::findOrFail($id);\n $purchase->update($request->all());\n return response()->json($purchase);\n }", "public function update(int $id, Request $request): \\Illuminate\\Http\\JsonResponse\n {\n $client = $this->client->find($id);\n if(!$client) {\n abort(404);\n }\n $client->update($request->all());\n \n return response()->json($client);\n }", "private function editSubscriber($params){\n $client = new SoapClient('http://api.e-goi.com/v2/soap.php?wsdl');\n $result = $client->editSubscriber($params);\n return $result;\n }", "public function update(Request $request, Informacion $informacion)\n {\n //\n }", "public function update(Request $request, $id)\n {\n if ($request->is('api/*')) {\n $data = json_decode($request->getContent());\n $notif = Notification::find($id);\n $notif->viewed = $data->viewed;\n $notif->save();\n }\n }", "public function update(Request $request, Info $info)\n {\n Info::find($info->id)->update($request->except('_token', '_method'));\n return back()->with('update_info', 'Info updated successfully!!');\n }", "public function update($request, $id);", "public function update(Request $request, Subscriber $subscriber)\n {\n $this->validate($request, [\n 'topic_id' => 'required',\n 'url' => [\n 'required', 'string', 'max:255',\n Rule::unique('subscribers', 'url')->ignore($subscriber->url, 'url'),\n ],\n ]);\n $subscriber->topic_id = $request->topic_id;\n $subscriber->url = $request->url;\n if ($subscriber->update()){\n return back()->with('success', 'Updated Successfully.');\n } else {\n return back()->with('failed','Failed something went wrong!');\n }\n }", "public function update(Request $request, invoices_details $invoices_details)\n {\n //\n }", "public function update(Request $request) {\n }", "public function update(Request $request) {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }" ]
[ "0.7103837", "0.7103837", "0.70533293", "0.66914254", "0.6451099", "0.63787127", "0.6062708", "0.60579354", "0.60464174", "0.6010428", "0.58038044", "0.5790607", "0.56669056", "0.5580175", "0.55344015", "0.551715", "0.5515798", "0.5436458", "0.54261744", "0.5408889", "0.5368697", "0.5361135", "0.5342592", "0.5337332", "0.53361356", "0.5331425", "0.5305717", "0.529787", "0.5296311", "0.5284838", "0.5281994", "0.5244189", "0.52432656", "0.5232017", "0.5227431", "0.5211424", "0.5198412", "0.51719606", "0.5171299", "0.5143961", "0.51418257", "0.5141032", "0.51080734", "0.5105003", "0.50876653", "0.5075769", "0.506991", "0.5068125", "0.50606227", "0.5059205", "0.5059205", "0.5059205", "0.5059205", "0.5051922", "0.5048993", "0.5048827", "0.504768", "0.504568", "0.504568", "0.5029437", "0.5026227", "0.50043976", "0.50027627", "0.49801925", "0.49794778", "0.49731752", "0.49560633", "0.49536353", "0.49520424", "0.4947327", "0.49455595", "0.4924704", "0.49199817", "0.49191046", "0.49132523", "0.49077138", "0.49071762", "0.49050322", "0.4901795", "0.49007884", "0.49007884", "0.48969656", "0.4895586", "0.488351", "0.48758873", "0.48729938", "0.48702377", "0.48700643", "0.4869006", "0.48501214", "0.48456782", "0.4845263", "0.48434156", "0.48420548", "0.4836572", "0.48357958", "0.4827986", "0.4827986", "0.48213515", "0.48213515" ]
0.6803221
3
Operation updateAsync Update Subscription
public function updateAsync($id, $update_subscription_request) { return $this->updateAsyncWithHttpInfo($id, $update_subscription_request) ->then( function ($response) { return $response[0]; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateSubscription($request);", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update()\n {\n return $this->putResource(sprintf('/%s', str_replace('{{subscriber_code}}', $this->subscriber_code, self::PATH)));\n }", "public function update(Request $request, Subscribe $subscribe)\n {\n //\n }", "public function update(Request $request, SubscribedUser $subscribedUser)\n {\n //\n }", "public function update(Request $request, Subscriber $subscriber)\n {\n //\n }", "public function updateRequest($id, $update_subscription_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling update'\n );\n }\n // verify the required parameter 'update_subscription_request' is set\n if ($update_subscription_request === null || (is_array($update_subscription_request) && count($update_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_subscription_request when calling update'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($update_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($update_subscription_request));\n } else {\n $httpBody = $update_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function _updateSubscription(&$subscription) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE subscriptions\n\t\t\t\tSET\n\t\t\t\t\tjournal_id = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\ttype_id = ?,\n\t\t\t\t\tdate_start = %s,\n\t\t\t\t\tdate_end = %s,\n\t\t\t\t\tdate_reminded_before = %s,\n\t\t\t\t\tdate_reminded_after = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\treference_number = ?,\n\t\t\t\t\tnotes = ?\n\t\t\t\tWHERE subscription_id = ?',\n\t\t\t\t$this->dateToDB($subscription->getDateStart()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateEnd()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedBefore()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedAfter())\n\t\t\t), array(\n\t\t\t\t$subscription->getJournalId(),\n\t\t\t\t$subscription->getUserId(),\n\t\t\t\t$subscription->getTypeId(),\n\t\t\t\t$subscription->getStatus(),\n\t\t\t\t$subscription->getMembership(),\n\t\t\t\t$subscription->getReferenceNumber(),\n\t\t\t\t$subscription->getNotes(),\n\t\t\t\t$subscription->getId()\n\t\t\t)\n\t\t);\n\n\t\treturn $returner;\n\t}", "public function postUpdate(Request $request)\n {\n // dd($request->all());\n // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription=Subscription::findOrFail($request->id);\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data updated successfully'));\n \n \n \n\n }", "public function update(Request $request, Subscription $subscription)\n {\n $request->validate([\n 'name' => 'required',\n 'min_labels' => 'required',\n 'max_labels' => 'required'\n ]);\n \n $subscription->update($request->all());\n \n return redirect()->route('subscriptions.index')->with('success',__('success_edit_subscription'));\n }", "public function update(Request $request, ClassSubscription $classSubscription)\n {\n //\n }", "public function update(manageUserSubscriptionRequest $request, $id)\n {\n $data = Input::all();\n $user_subscription = $this->user_subscription->find($id);\n $data['id'] = $id;\n\n if($user_subscription){\n\n $update = $this->user_subscription->update($data);\n\n if(!$update){\n return response()->json(['error'=>'Server error'],500); \n }else{\n $user_subscription = $this->user_subscription->find($id);\n return response()->json(['success'=>$user_subscription],200);\n }\n\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function update($id)\n\t{\n//\t\t$subscription = Subscription::findOrFail($id);\n\n//\t\t$validator = Validator::make($data = Input::all(), Subscription::$rules);\n//\n//\t\tif ($validator->fails())\n//\t\t{\n//\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n//\t\t}\n//\n//\t\t$subscription->update($data);\n\n\t\treturn Redirect::route('subscriptions.index');\n\t}", "public function update(Request $request, $id)\n {\n\n $brands = Subscriptions::findOrFail($id);\n\n\n $brands->update($request->all());\n\n\n\n return redirect()->back();\n\n\n \n }", "public function setSubscription(array $data)\n {\n $returnValue = false;\n\n // check if subscription id exists\n if (!isset($data['id'])) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'ID must be set before attempting a save'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $data['id']\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription has properties update the changed one's\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n $createdTimePropertyUri = $this->_subscriptionConfig->get($this->_propertyMatching['created_time']);\n $data['created_time'] = $subscriptionResourceProperties[$createdTimePropertyUri][0]['content'];\n\n // get the current time\n $now = new Zend_Date;\n\n // if lease seconds is set to the subscription, calculate a new expiration time\n if (isset($data['lease_seconds'])) {\n $data['expiration_time'] = $now\n ->add($data['lease_seconds'], Zend_Date::SECOND)\n ->get('yyyy-MM-dd HH:mms');\n }\n\n // generate new add and delete statements from subscriber data array\n $statements = $this->_generateStatements(\n $subscriptionResourceUri,\n $data,\n $subscriptionResourceProperties\n );\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_UPDATE_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add and delete the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n $this->_selectedModelInstance->deleteMultipleStatements($statements['deleteStatements']);\n\n $returnValue = false;\n // if the subscription has now proberties only add the properties\n } else {\n // generate the add statements\n $statements = $this->_generateStatements($subscriptionResourceUri, $data);\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_ADD_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n\n $returnValue = true;\n }\n\n // end versioning\n $this->_versioning->endAction();\n\n return $returnValue;\n }", "public function update()\n {\n # code...\n }", "public function Update()\n {\n \t$rs = mysql_query(\"UPDATE subscriptions SET subscription_name_fr='\" . scrub($this->subscription_name_fr) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', subscription_name_en='\" . scrub($this->subscription_name_en) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_fr='\" . scrub($this->subscription_desc_fr) .\n\t\t\t\t\t\t\t\t\t \t\t\t \"', subscription_desc_en='\" . scrub($this->subscription_desc_en) .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_by_id='\" . $this->modified_by_id .\n\t\t\t\t\t\t\t\t \t\t\t\t \"', modified_date='\" . date(\"Y-m-d H:i:s\") .\n\t\t\t\t\t\t\t\t \t\t\t\t \"' WHERE subscription_id=\" . $this->subscription_id);\n \t\t\n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n \t\n }", "public function update() {\r\n }", "public function update($data) {}", "public function update($data) {}", "public function updated(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'renewed');\n }", "public function update() {\n \n }", "public function updateSubscription($data, $where) {\n $this->db->update($this->table, $data, $where);\n if ($this->db->affected_rows() > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update(Request $request, $id)\n {\n $subscriber = Subscriber::findOrFail($id);\n $data = $request->all();\n $subscriber->update($data);\n\n return redirect('subscriber')->with('message','Subscriber Updated !');\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public function postEdit($subscriptionId) {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ( $subscriptionId )) {\n $isCreated = true;\n $this->request->session ()->flash ( 'success', trans ( 'customer::subscription.update.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.update.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::subscription.update.error' ) );\n }", "public function update(Request $request, HashtagSubscriber $hashtagSubscriber)\n {\n //\n }", "public function update () {\n\n }", "public function update() {\r\n\r\n\t}", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "protected function update() {}", "public function update()\n {\n }", "protected function handleSubscriptionUpdated(array $data): void\n {\n $this->configureStripeClient();\n $stripeSubscription = $data['data']['object'];\n $subscription = Subscription::find()->status(null)->reference($stripeSubscription['id'])->one();\n\n if (!$subscription) {\n Craft::warning('Subscription with the reference “' . $stripeSubscription['id'] . '” not found when processing webhook ' . $data['id'], 'stripe');\n\n return;\n }\n\n // See if we care about this subscription at all\n $subscription->setSubscriptionData($data['data']['object']);\n\n $this->setSubscriptionStatusData($subscription);\n\n if (empty($data['data']['object']['plan'])) {\n Craft::warning($subscription->reference . ' contains multiple plans, which is not supported. (event \"' . $data['id'] . '\")', 'stripe');\n } else {\n $planReference = $data['data']['object']['plan']['id'];\n $plan = Commerce::getInstance()->getPlans()->getPlanByReference($planReference);\n\n if ($plan) {\n $subscription->planId = $plan->id;\n } else {\n Craft::warning($subscription->reference . ' was switched to a plan on Stripe that does not exist on this Site. (event \"' . $data['id'] . '\")', 'stripe');\n }\n }\n\n Commerce::getInstance()->getSubscriptions()->updateSubscription($subscription);\n }", "public function update(Request $request, $id)\n {\n $data=$request->except('_token');\n $subscriber=Subscriber::find($id);\n\n $subscriber->fill($data);\n $subscriber->save();\n return redirect('admin/subscribers')->with('request', $subscriber)->with('success', 'Subscriber Updated Successfully.');\n }", "public function update()\r\n {\r\n //\r\n }", "public function update($TenantID,updateTenantRequest $request){\n DB::beginTransaction();\n try {\n $Tenant = Tenant::where('id',$TenantID)->firstOrFail();\n // if the subscription_date was null it means its a new tenant and we shall send activation email\n if($Tenant->subscription_date == null && $request['status'] == 'active'){\n MailController::SendRequestApprovedEmail($Tenant);\n }\n $Tenant->update([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request['password']),\n 'status' => $request->status,\n 'number_of_branches' => $request->number_of_branches,\n 'subscription_price' => $request->subscription_price,\n 'subscription_date' => $request->subscription_date,\n 'subscription_end_date' => $request->subscription_end_date,\n ]);\n return response()->json(['UpdatedSubscriber'=>$Tenant],200);\n\n DB::commit();\n } catch (\\Exception $e) {\n return response()->json(['Error'=>$e],500);\n\n DB::rollback();\n }\n }", "public function update(Request $request, BotSpeak $botSpeak)\n {\n //\n }", "public function getUpdate($id)\n {\n // dd($id);\n\n $subscription=Subscription::findOrFail($id);\n \n return view('plan.update',compact('subscription'));\n }", "public function update(){\n\n }", "public function update(){\n\n }", "public function update(array $update);", "public function update(Request $request) {\n \n \n }", "public function update(UpdateSubscriptionOptionRequest $request)\n {\n try {\n $subscriptionOption = $this->subscriptionOption->update($request->subscriptionOption, $request->validated());\n\n return $this->responseOk(new SubscriptionPlanOptionResource($subscriptionOption));\n } catch (Exception $e) {\n return $this->responseInternalError($e->getMessage());\n }\n }", "public function update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function update(Request $request,$id)\n {\n $SubscriptionAppointment = SubscriptionAppointment::find($id);\n $SubscriptionAppointment->update($request->all());\n return response(\n [\n 'error'=> false,\n 'data'=> $SubscriptionAppointment\n ]\n ,201);\n }", "public function update(Request $request, Subasta $subasta)\n {\n //\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n // UPDATE\n }", "public function update(Request $request)\n {\n \n\n \n }", "public function update()\r\n {\r\n \r\n }", "public function update(Request $request, Prescription $prescription)\n {\n //\n }", "public function update(Request $request, Prescription $prescription)\n {\n //\n }", "public function update($data = array()) {\n if(count($data)) {\n // if subscriber not exist add error and return false \n if(!$this->exist($data['u_id'])) {\n $this->_errors[] = \"this Subscriber is not exist\";\n return false;\n }\n // update subscriber\n if($this->_db->update('subscribers', $data,\n array('u_id', '=', $data['u_id']))) {\n return true;\n }\n }\n\n // if cant update record add this error\n $this->_errors[] = \"Unknow Error\";\n return false;\n }", "public function update(Request $request, ResourceSubject $resourceSubject)\n {\n //\n }", "public function Update($data) {\n\n }", "public function update();", "public function update();", "public function update();", "public function update();", "public function update(Request $request)\n {\n $id = $request->id;\n $key = Session::get('apiKeySession');\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, 'https://api.mailerlite.com/api/v2/subscribers/'.$id);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"fields\\\": {\\\"name\\\": \\\"$request->name\\\", \\\"country\\\": \\\"$request->country\\\"}}\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n \n $headers = [\n 'Content-Type: application/json',\n 'X-Mailerlite-Apikey: '.$key\n ];\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n $result = curl_exec($ch);\n\n if (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n }\n\n curl_close ($ch);\n return redirect('/list');\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "private function update(){\n\t\t$q = Queries::update($this->authkey);\n\t\t$this->internalQuery($q);\n\t}", "public function updateAction()\n {\n }", "function update($email, $subscriber) {\n return $this->put_request($this->_subscribers_base_route.'.json?email='.urlencode($email), $subscriber);\n }", "public function update(Request $request)\n {\n \n }", "public function update($bunch_id , $subscriber_id, SubscriberRequest $request) {\n\n\n $update = Subscriber::find($subscriber_id);\n\n $update->update($request->all());\n\n return redirect()->route('subscriber.index',[$bunch_id]);\n\n }", "public function update()\n\t{\n\n\t}", "public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }", "public function testUpdate(): void { }", "public function updating()\n {\n # code...\n }", "public function update(Request $request, Newsletter $newsletter) {\n //\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "function updateApiSubscriptions() {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n try {\n $subscriptions_table = TABLE_PREFIX . 'api_client_subscriptions';\n $users_table = TABLE_PREFIX . 'users';\n\n DB::execute(\"CREATE TABLE $subscriptions_table (\n id int unsigned NOT NULL auto_increment,\n type varchar(50) NOT NULL DEFAULT 'ApiClientSubscription',\n user_id int(10) unsigned NOT NULL DEFAULT '0',\n token varchar(40) DEFAULT NULL,\n client_name varchar(100) DEFAULT NULL,\n client_vendor varchar(100) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n last_used_on datetime DEFAULT NULL,\n is_enabled tinyint(1) unsigned NOT NULL DEFAULT '0',\n PRIMARY KEY (id),\n INDEX type (type),\n UNIQUE token (token)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::beginWork('Moving token data to new API subscriptions table @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, token, created_on FROM $users_table\");\n if($rows) {\n foreach($rows as $row) {\n if($row['token']) {\n DB::execute(\"INSERT INTO $subscriptions_table (type, user_id, token, client_name, client_vendor, created_on, is_enabled) VALUES ('ApiClientSubscription', ?, ?, ?, ?, ?, '1')\", $row['id'], $row['token'], 'activeCollab Legacy Token', 'A51', $row['created_on']);\n } // if\n } // foreach\n } // if\n\n DB::commit('Token data moved to new API subscriptions table @ ' . __CLASS__);\n\n DB::execute(\"ALTER TABLE $users_table DROP token\");\n } catch(Exception $e) {\n DB::rollback('Failed to move token data to new API subscriptions table @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function update(Request $request, Call $call)\n {\n //\n }", "public function update_subscription( $data ) {\r\n global $wpdb;\r\n\r\n // leave only the required keys\r\n $data = array_intersect_key( $data, LaterPay_Helper_Subscription::get_default_options() );\r\n\r\n // fill values that weren't set from defaults\r\n $data = array_merge( LaterPay_Helper_Subscription::get_default_options(), $data );\r\n\r\n unset( $data['lp_id'] ); // unset key ( used in WP schema ) before inserting to custom table.\r\n\r\n // pass_id is a primary key, set by autoincrement\r\n $id = $data['id'];\r\n unset( $data['id'] );\r\n\r\n // format for insert and update statement\r\n $format = array(\r\n '%d', // duration\r\n '%d', // period\r\n '%d', // access_to\r\n '%d', // access_category\r\n '%f', // price\r\n '%s', // revenue_model\r\n '%s', // title\r\n '%s', // description\r\n );\r\n\r\n if ( empty( $id ) ) {\r\n $wpdb->insert(\r\n $this->table,\r\n $data,\r\n $format\r\n );\r\n $data['id'] = $wpdb->insert_id;\r\n } else {\r\n $wpdb->update(\r\n $this->table,\r\n $data,\r\n array( 'id' => $id ),\r\n $format,\r\n array( '%d' ) // pass_id\r\n );\r\n $data['id'] = $id;\r\n }\r\n\r\n // purge cache\r\n LaterPay_Helper_Cache::purge_cache();\r\n\r\n return $data;\r\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public static function update(){\n }" ]
[ "0.7444646", "0.7097894", "0.7097894", "0.6890104", "0.68070495", "0.6716158", "0.64672345", "0.6388384", "0.628623", "0.62688124", "0.6259955", "0.616674", "0.6067797", "0.6029292", "0.5990102", "0.59377766", "0.59326804", "0.5918335", "0.5895007", "0.58866763", "0.58866763", "0.5872305", "0.5848577", "0.5825585", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5825441", "0.5817959", "0.5812878", "0.5812878", "0.578934", "0.578934", "0.57835853", "0.5782478", "0.5778201", "0.5767175", "0.5747754", "0.5747754", "0.574715", "0.574715", "0.5741432", "0.5734266", "0.57295936", "0.5717584", "0.5706349", "0.5690694", "0.5670799", "0.5652016", "0.56405956", "0.56405956", "0.5632206", "0.56057435", "0.5603659", "0.56009585", "0.5597082", "0.55959016", "0.55888045", "0.55888045", "0.55888045", "0.55888045", "0.5570567", "0.55692124", "0.55685556", "0.5552468", "0.5552468", "0.55522025", "0.55502623", "0.5543076", "0.55407214", "0.55407214", "0.55407214", "0.55407214", "0.5538735", "0.5533246", "0.5533246", "0.55174816", "0.5515488", "0.5513021", "0.55118984", "0.55106986", "0.55101585", "0.5508538", "0.54890674", "0.5472409", "0.5462538", "0.54502684", "0.5447901", "0.5439128", "0.5425796", "0.5425632", "0.5425632", "0.54185706" ]
0.0
-1
Operation updateAsyncWithHttpInfo Update Subscription
public function updateAsyncWithHttpInfo($id, $update_subscription_request) { $returnType = '\OpenAPI\Client\Model\Subscription'; $request = $this->updateRequest($id, $update_subscription_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); if ($returnType !== 'string') { $content = json_decode($content); } } return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; }, function ($exception) { $response = $exception->getResponse(); $statusCode = $response->getStatusCode(); throw new ApiException( sprintf( '[%d] Error connecting to the API (%s)', $statusCode, $exception->getRequest()->getUri() ), $statusCode, $response->getHeaders(), (string) $response->getBody() ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateSubscription($request);", "public function updateRequest($id, $update_subscription_request)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling update'\n );\n }\n // verify the required parameter 'update_subscription_request' is set\n if ($update_subscription_request === null || (is_array($update_subscription_request) && count($update_subscription_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $update_subscription_request when calling update'\n );\n }\n\n $resourcePath = '/subscriptions/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($update_subscription_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($update_subscription_request));\n } else {\n $httpBody = $update_subscription_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update(Request $request, Subscription $subscription)\n {\n //\n }", "public function update(Request $request, Subscribe $subscribe)\n {\n //\n }", "public function updateWithHttpInfo($id, $update_subscription_request)\n {\n $request = $this->updateRequest($id, $update_subscription_request);\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 ('\\OpenAPI\\Client\\Model\\Subscription' === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n if ('\\OpenAPI\\Client\\Model\\Subscription' !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\OpenAPI\\Client\\Model\\Subscription', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\OpenAPI\\Client\\Model\\Subscription';\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 '\\OpenAPI\\Client\\Model\\Subscription',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function update(string $subscriptionId, array $parameters = []): ApiResponse\n {\n return $this->_post(\"subscriptions/{$subscriptionId}\", $parameters);\n }", "public function update(Request $request, Subscriber $subscriber)\n {\n //\n }", "public function update()\n {\n return $this->putResource(sprintf('/%s', str_replace('{{subscriber_code}}', $this->subscriber_code, self::PATH)));\n }", "public function update(Request $request, SubscribedUser $subscribedUser)\n {\n //\n }", "public function updateAsync($id, $update_subscription_request)\n {\n return $this->updateAsyncWithHttpInfo($id, $update_subscription_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function update(Request $request, Subscription $subscription)\n {\n $request->validate([\n 'name' => 'required',\n 'min_labels' => 'required',\n 'max_labels' => 'required'\n ]);\n \n $subscription->update($request->all());\n \n return redirect()->route('subscriptions.index')->with('success',__('success_edit_subscription'));\n }", "public function tspUpdateAsyncWithHttpInfo($tsp_update_request)\n {\n $returnType = '';\n $request = $this->tspUpdateRequest($tsp_update_request);\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 (string) $response->getBody()\n );\n }\n );\n }", "public function update(Request $request, ClassSubscription $classSubscription)\n {\n //\n }", "public function update(UpdateRequest $request, $id)\n {\n $chartOfAccount = ChartOfAccount::findOrFail($id);\n $chartOfAccount->type_id = $request->get('type_id');\n $chartOfAccount->sub_ledger = $request->get('sub_ledger') ?? null;\n $chartOfAccount->position = $request->get('position');\n $chartOfAccount->cash_flow = $request->get('cash_flow');\n if ($request->get('cash_flow')) {\n $chartOfAccount->cash_flow_position = $request->get('cash_flow_position') ?? null;\n }\n $chartOfAccount->number = $request->get('number') ?? null;\n $chartOfAccount->alias = $request->get('alias');\n $chartOfAccount->save();\n\n return new ApiResource($chartOfAccount->load(['type', 'group']));\n }", "public function update(manageUserSubscriptionRequest $request, $id)\n {\n $data = Input::all();\n $user_subscription = $this->user_subscription->find($id);\n $data['id'] = $id;\n\n if($user_subscription){\n\n $update = $this->user_subscription->update($data);\n\n if(!$update){\n return response()->json(['error'=>'Server error'],500); \n }else{\n $user_subscription = $this->user_subscription->find($id);\n return response()->json(['success'=>$user_subscription],200);\n }\n\n }else{\n return response()->json(['error'=>'user subscription not found'], 401);\n }\n }", "public function postUpdate(Request $request)\n {\n // dd($request->all());\n // $id = Auth::user()->id; \n $request->validate([\n 'name'=>'required',\n 'amount'=>'required',\n 'status'=>'required',\n ]);\n \n $subscription=Subscription::findOrFail($request->id);\n $subscription->name=$request->name;\n $subscription->amount=$request->amount;\n $subscription->status=$request->status;\n $subscription->save();\n return response()->json(array('success'=>true,'message' =>'data updated successfully'));\n \n \n \n\n }", "public function update(Request $request, HashtagSubscriber $hashtagSubscriber)\n {\n //\n }", "public function update(string $slug, int $id, array $attributes): ResponseInterface;", "public function update(Request $request, $id)\n {\n $subscriber = Subscriber::findOrFail($id);\n $data = $request->all();\n $subscriber->update($data);\n\n return redirect('subscriber')->with('message','Subscriber Updated !');\n }", "public function updateDocumentAsyncWithHttpInfo($id, $documentUpdateRequest)\n {\n $returnType = '';\n $request = $this->updateDocumentRequest($id, $documentUpdateRequest);\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 (string) $response->getBody()\n );\n }\n );\n }", "function _updateSubscription(&$subscription) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE subscriptions\n\t\t\t\tSET\n\t\t\t\t\tjournal_id = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\ttype_id = ?,\n\t\t\t\t\tdate_start = %s,\n\t\t\t\t\tdate_end = %s,\n\t\t\t\t\tdate_reminded_before = %s,\n\t\t\t\t\tdate_reminded_after = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\treference_number = ?,\n\t\t\t\t\tnotes = ?\n\t\t\t\tWHERE subscription_id = ?',\n\t\t\t\t$this->dateToDB($subscription->getDateStart()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateEnd()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedBefore()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedAfter())\n\t\t\t), array(\n\t\t\t\t$subscription->getJournalId(),\n\t\t\t\t$subscription->getUserId(),\n\t\t\t\t$subscription->getTypeId(),\n\t\t\t\t$subscription->getStatus(),\n\t\t\t\t$subscription->getMembership(),\n\t\t\t\t$subscription->getReferenceNumber(),\n\t\t\t\t$subscription->getNotes(),\n\t\t\t\t$subscription->getId()\n\t\t\t)\n\t\t);\n\n\t\treturn $returner;\n\t}", "public function updateMeasurementAsyncWithHttpInfo($body)\n {\n $returnType = '\\CureDAO\\Client\\Models\\CommonResponse';\n $request = $this->updateMeasurementRequest($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 update($TenantID,updateTenantRequest $request){\n DB::beginTransaction();\n try {\n $Tenant = Tenant::where('id',$TenantID)->firstOrFail();\n // if the subscription_date was null it means its a new tenant and we shall send activation email\n if($Tenant->subscription_date == null && $request['status'] == 'active'){\n MailController::SendRequestApprovedEmail($Tenant);\n }\n $Tenant->update([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => Hash::make($request['password']),\n 'status' => $request->status,\n 'number_of_branches' => $request->number_of_branches,\n 'subscription_price' => $request->subscription_price,\n 'subscription_date' => $request->subscription_date,\n 'subscription_end_date' => $request->subscription_end_date,\n ]);\n return response()->json(['UpdatedSubscriber'=>$Tenant],200);\n\n DB::commit();\n } catch (\\Exception $e) {\n return response()->json(['Error'=>$e],500);\n\n DB::rollback();\n }\n }", "public function update(Request $request)\n {\n $id = $request->id;\n $key = Session::get('apiKeySession');\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, 'https://api.mailerlite.com/api/v2/subscribers/'.$id);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"fields\\\": {\\\"name\\\": \\\"$request->name\\\", \\\"country\\\": \\\"$request->country\\\"}}\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n \n $headers = [\n 'Content-Type: application/json',\n 'X-Mailerlite-Apikey: '.$key\n ];\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n $result = curl_exec($ch);\n\n if (curl_errno($ch)) {\n echo 'Error:' . curl_error($ch);\n }\n\n curl_close ($ch);\n return redirect('/list');\n }", "public function update(UpdateSubscriptionOptionRequest $request)\n {\n try {\n $subscriptionOption = $this->subscriptionOption->update($request->subscriptionOption, $request->validated());\n\n return $this->responseOk(new SubscriptionPlanOptionResource($subscriptionOption));\n } catch (Exception $e) {\n return $this->responseInternalError($e->getMessage());\n }\n }", "public function update(int $id, array $data): \\Psr\\Http\\Message\\ResponseInterface\n {\n return $this->data = $this->service->http->put($this->service->host . \"$this->endpoint/$id\", [\n 'form_params' => $data\n ]);\n }", "public function update(Request $request, $id)\n {\n $data=$request->except('_token');\n $subscriber=Subscriber::find($id);\n\n $subscriber->fill($data);\n $subscriber->save();\n return redirect('admin/subscribers')->with('request', $subscriber)->with('success', 'Subscriber Updated Successfully.');\n }", "public function update(\n string $id,\n array $body,\n ?RequestOptions $options = null,\n ): ResponseInterface;", "public function update(Request $request, $id): Response\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'string',\n 'body' => 'string',\n ]);\n\n\n // Sending error if validation failed\n if ($validator->fails()) {\n return $this->errorApiReponse($validator->errors()->messages(), 400);\n }\n\n $fields = $request->request->all();\n\n $topic = Topic::where('id', $id)->first();\n\n $topic->update($fields);\n $topic->save();\n\n return $this->apiResponse('Topic modified', $topic);\n }", "public function update(Request $request, Subasta $subasta)\n {\n //\n }", "public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }", "public function update(Request $request,$id)\n {\n $SubscriptionAppointment = SubscriptionAppointment::find($id);\n $SubscriptionAppointment->update($request->all());\n return response(\n [\n 'error'=> false,\n 'data'=> $SubscriptionAppointment\n ]\n ,201);\n }", "public function updateAsync(SslContact $body)\n {\n if ($body->getId() === null) {\n throw new \\InvalidArgumentException(\"Field SslContact.id is missing.\");\n }\n return $this->sendRequest(\n $this->domainrobotConfig->getUrl().\"/sslcontact/\".$body->getId(),\n 'PUT',\n [\"json\" => $body->toArray()]\n );\n }", "public function update(UpdateAccountPayableRequest $request, $id)\n {\n DB::connection('tenant')->beginTransaction();\n\n $cutOffAccountPayable = CutOffAccountPayable::findOrFail($id);\n $cutOffAccountPayable->chart_of_account_id = $request->get('chart_of_account_id');\n $cutOffAccountPayable->supplier_id = $request->get('supplier_id');\n $cutOffAccountPayable->notes = $request->get('notes');\n $cutOffAccountPayable->amount = $request->get('amount');\n $cutOffAccountPayable->save();\n\n DB::connection('tenant')->commit();\n\n return new ApiResource($cutOffAccountPayable);\n }", "public function updateTenant($tenantId, $request)\n {\n return $this->start()->uri(\"/api/tenant\")\n ->urlSegment($tenantId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function update($optional = [])\n {\n return $this->apiCall('put', '', ['json' => $this->getDirty($optional)]);\n }", "public function update($optional = [])\n {\n return $this->apiCall('put', '', ['json' => $this->getDirty($optional)]);\n }", "public function nspiUpdate(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n\n $fields = [\n 'time' => 'is_numeric',\n 'nonce' => 'is_string',\n 'hash' => 'is_string',\n ];\n $result = $this->basicAuthenticator($fields, $data);\n\n if (!empty($result['error'])) {\n return new JsonResponse($result);\n }\n if (!empty($data['authenticator']['identifier'])) {\n if ($data['authenticator']['identifier'] != self::ACQTEST_ID && $data['authenticator']['identifier'] != self::ACQTEST_ERROR_ID) {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Subscription not found')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n if ($data['authenticator']['identifier'] == self::ACQTEST_ERROR_ID) {\n return new JsonResponse(FALSE);\n }\n else {\n $result = $this->validateAuthenticator($data);\n // Needs for update definition.\n $data['body']['spi_def_update'] = TRUE;\n $spi_data = $data['body'];\n\n $result['body'] = ['spi_data_received' => TRUE];\n if (isset($spi_data['spi_def_update'])) {\n $result['body']['update_spi_definition'] = TRUE;\n }\n\n // Reflect send_method as nspi_messages if set.\n if (isset($spi_data['send_method'])) {\n $result['body']['nspi_messages'][] = $spi_data['send_method'];\n }\n $result['authenticator']['hash'] = CryptConnector::acquiaHash($result['secret']['key'], $result['authenticator']['time'] . ':' . $result['authenticator']['nonce']);\n if (isset($spi_data['test_validation_error'])) {\n // Force a validation fail.\n $result['authenticator']['nonce'] = 'TEST';\n }\n\n $site_action = $spi_data['env_changed_action'];\n // First connection.\n if (empty($spi_data['site_uuid'])) {\n $site_action = 'create';\n }\n\n switch ($site_action) {\n case 'create':\n $result['body']['site_uuid'] = self::ACQTEST_SITE_UUID;\n // Set machine name.\n \\Drupal::state()->set('acqtest_site_machine_name', $spi_data['machine_name']);\n // Set name.\n \\Drupal::state()->set('acqtest_site_name', $spi_data['name']);\n $acquia_hosted = (int) filter_var($spi_data['acquia_hosted'], FILTER_VALIDATE_BOOLEAN);\n \\Drupal::state()->set('acqtest_site_acquia_hosted', $acquia_hosted);\n\n $result['body']['nspi_messages'][] = t('This is the first connection from this site, it may take awhile for it to appear on the Acquia Network.');\n return new JsonResponse($result);\n\n break;\n case 'update':\n $update = $this->updateNspiSite($spi_data);\n $result['body']['nspi_messages'][] = $update;\n break;\n\n case 'unblock':\n \\Drupal::state()->delete('acqtest_site_blocked');\n $result['body']['spi_error'] = '';\n $result['body']['nspi_messages'][] = t('Your site has been unblocked and is sending data to Acquia Cloud.');\n return new JsonResponse($result);\n\n break;\n case 'block':\n \\Drupal::state()->set('acqtest_site_blocked', TRUE);\n $result['body']['spi_error'] = '';\n $result['body']['nspi_messages'][] = t('You have blocked your site from sending data to Acquia Cloud.');\n return new JsonResponse($result);\n\n break;\n }\n\n // Update site name if it has changed.\n $tacqtest_site_name = \\Drupal::state()->get('acqtest_site_name');\n if (isset($spi_data['name']) && $spi_data['name'] != $tacqtest_site_name) {\n if (!empty($tacqtest_site_name)) {\n $name_update_message = t('Site name updated (from @old_name to @new_name).', [\n '@old_name' => $tacqtest_site_name,\n '@new_name' => $spi_data['name'],\n ]);\n\n \\Drupal::state()->set('acqtest_site_name', $spi_data['name']);\n }\n $result['body']['nspi_messages'][] = $name_update_message;\n }\n\n // Detect Changes.\n if ($changes = $this->detectChanges($spi_data)) {\n $result['body']['nspi_messages'][] = $changes['response'];\n $result['body']['spi_error'] = TRUE;\n $result['body']['spi_environment_changes'] = json_encode($changes['changes']);\n return new JsonResponse($result);\n }\n\n unset($result['secret']);\n return new JsonResponse($result);\n }\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Invalid arguments')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }", "public function update($subscriberID, $subscriberListID, $emailAddress, $fields, $access)\n\t{\n\n\t\t$command = \"Command=Subscriber.Update\";\n\t\t$subscriberID = \"SubscriberID=\".$subscriberID;\n\t\t$subscriberListID = \"SubscriberListID=\".$subscriberListID;\n\t\t$emailAddress = \"EmailAddress=\".$emailAddress;\n\t\t$fields = \"Fields=\".$fields;\n\t\t$access = \"Access=\".$access;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$subscriberID\n\t\t\t\t\t\t.'&'.$subscriberListID\n\t\t\t\t\t\t.'&'.$emailAddress\n\t\t\t\t\t\t.'&'.$fields\n\t\t\t\t\t\t.'&'.$access\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public static function updateIt(int $id, array $request);", "public function fontProcessorUpdateAsyncWithHttpInfo($id, $tenant_id = null, $name = null, $path = null, $custom_fields = null, $file = null)\n {\n $returnType = '\\Aurigma\\AssetProcessor\\Model\\FontDto';\n $request = $this->fontProcessorUpdateRequest($id, $tenant_id, $name, $path, $custom_fields, $file);\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 }\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 update(Request $request, ResourceSubject $resourceSubject)\n {\n //\n }", "public function update( $data ){\n\t\t$response = $this->curl->put( $this->api_url . '/' . $data['id'], [ \n\t\t\t'access_token' \t\t\t\t=> $this->token,\n\t\t\t'name'\t\t\t\t\t\t=> $data['name'],\n\t\t\t'url'\t\t\t\t\t\t=> $data['url'],\n\t\t\t'price'\t\t\t\t\t\t=> $data['price'],\n\t\t\t'description'\t\t\t\t=> $data['description'],\n\t\t\t'preview_url'\t\t\t\t=> $data['preview_url'],\n\t\t\t'countries_available'\t\t=> $data['countries_available'],\n\t\t\t'max_purchase_count'\t\t=> $data['max_purchase_count'],\n\t\t\t'customizable_price'\t\t=> $data['customizable_price'],\n\t\t\t'webhook'\t\t\t\t\t=> $data['webhook'],\n\t\t\t'require_shipping'\t\t\t=> $data['require_shipping'],\n\t\t\t'shown_on_profile'\t\t\t=> $data['shown_on_profile'],\n\t\t\t'custom_receipt'\t\t\t=> $data['custom_receipt'],\n\t\t\t'custom_summary'\t\t\t=> $data['custom_summary'],\n\t\t\t'custom_product_type'\t\t=> $data['custom_product_type'],\n\t\t\t'custom_filetype'\t\t\t=> $data['custom_filetype'],\n\t\t\t'custom_permalink'\t\t\t=> $data['custom_permalink']\n\t\t]);\n\t\t\n\t\treturn $response;\n \t}", "public function update(Request $request, BotSpeak $botSpeak)\n {\n //\n }", "public function update(Request $request, TiendaApi $tiendaApi)\n {\n //\n }", "public function update($id)\n\t{\n//\t\t$subscription = Subscription::findOrFail($id);\n\n//\t\t$validator = Validator::make($data = Input::all(), Subscription::$rules);\n//\n//\t\tif ($validator->fails())\n//\t\t{\n//\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n//\t\t}\n//\n//\t\t$subscription->update($data);\n\n\t\treturn Redirect::route('subscriptions.index');\n\t}", "public function updateTermsAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\Terms';\n $request = $this->updateTermsRequest($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 updateSettings(\n array $body,\n ?RequestOptions $options = null,\n ): ResponseInterface;", "public function updateSubtag(Request $request, int $id)\n {\n $this->repository->updateSubtag($id, $request->all());\n return response()->json(['message' => 'update subtag successfully'], 200);\n }", "public function update(Request $request, $id)\n {\n $request->discount = $this->addDigits($request->discount);\n $request->price = $this->addDigits($request->price);\n\n $validator = Validator::make($request->all(), RulesController::SubscriptionAdminUpdate());\n\n if($validator->fails()){\n return redirect()\n ->route('admin.subs.subscriptiontype.view', $id)\n ->withErrors($validator)\n ->withInput();\n }\n\n $sub = $this->subscriptionType->find($id);\n $sub->name = $request->name;\n $sub->price = str_replace(',', '.', $request->price);\n $sub->discount = str_replace(',', '.', $request->discount);\n $sub->duration = $request->duration . ' maanden';\n $sub->save();\n\n Session::flash('success_message', 'Gegevens opgeslagen');\n\n return redirect()->route('admin.subs.subscriptiontype.view', $id);\n }", "public function update(Request $request, $subdomain,$id)\n {\n //\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function update(UpdateRequest $request, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n try{\n\n $events = Customer::find($id)->update($request->All());\n $data = Customer::find($id);\n $response = $this->generateItem($data);\n return $this->sendResponse($response, 201);\n\n\n }catch (\\Exception $e) {\n return $this->sendIseResponse($e->getMessage());\n }\n }", "public function getUpdate($id)\n {\n // dd($id);\n\n $subscription=Subscription::findOrFail($id);\n \n return view('plan.update',compact('subscription'));\n }", "public function postEdit($subscriptionId) {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ( $subscriptionId )) {\n $isCreated = true;\n $this->request->session ()->flash ( 'success', trans ( 'customer::subscription.update.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.update.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::subscription.update.error' ) );\n }", "public function updated(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'renewed');\n }", "#[\n OpenApi\\Operation(\n tags: ['Cookbooks/Users'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: ShowCookbookUsersParameters::class)]\n #[OpenApi\\RequestBody(factory: UpdateCookbookUserRequestBody::class)]\n #[\n OpenApi\\Response(\n factory: CookbookUserShowResponse::class,\n statusCode: 200\n )\n ]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[OpenApi\\Response(factory: ForbiddenResponse::class, statusCode: 403)]\n #[OpenApi\\Response(factory: NotFoundResponse::class, statusCode: 404)]\n #[\n OpenApi\\Response(\n factory: ValidationErrorResponse::class,\n statusCode: 422\n )\n ]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function update(Request $request, Cookbook $cookbook, User $user) {\n $this->verifyNoDemo();\n\n $this->authorizeAnonymously('update', $cookbook);\n\n if ($user->id === auth()->id()) {\n throw new AuthorizationException(__('messages.cant_update_self'));\n }\n\n $data = $request->validate([\n 'is_admin' => ['boolean'],\n ]);\n\n $cookbook->users()->updateExistingPivot($user->id, $data);\n\n $cookbookUser = $cookbook\n ->users()\n ->where('user_id', $user->id)\n ->first();\n\n return JsonResource::make($cookbookUser);\n }", "public function updateAccountJsonAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Reepay\\Model\\Account';\n $request = $this->updateAccountJsonRequest($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 updateNotificationByIdAsyncWithHttpInfo($evApiKey, $evAccessToken, $id, $body = null)\n {\n $returnType = '\\ExaVault\\Model\\NotificationResponse';\n $request = $this->updateNotificationByIdRequest($evApiKey, $evAccessToken, $id, $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 update(TaskUpdateRequest $request, $id)\n {\n\n $task = Task::findOrFail($id);\n $responseCode = 400;\n\n try {\n if ($task->update($request->all())) {\n $responseMsg = \"OK\";\n $responseCode = 200;\n } else {\n $responseMsg = \"something went wrong\";\n }\n }\n catch (\\Exception $e) {\n $responseMsg = $e->getMessage();\n }\n return response(json_encode([\"result\" => $responseMsg]), $responseCode);\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n // UPDATE\n }", "public function update(Request $request, $id)\n {\n $service = Service::findOrFail($id);\n $validator = Validator::make($request->all(),[\n \"customer_name\" => \"required|min:1|string\",\n \"unit\" => \"required\",\n \"dp\" => \"required\",\n ]);\n\n if ($validator->fails()) {\n return response()->json([\"errors\" => $validator->errors()], 422);\n }\n\n $service->update([\n \"customer_name\" => $request->customer_name,\n \"dp\" => $request->dp,\n \"unit\" => $request->unit,\n ]);\n \n return response()->json([\"msg\", \"Berhasil di update\" ]);\n }", "public function update(Request $request) {\n \n \n }", "public function update( $id )\n {\n if ( request()->isMethod('PUT') || request()->isMethod('PATCH') )\n return ( $this->intersemestralRepository->subscribeStudent( $id ) ) ?\n jsonResponse('success', 'subscribe_done', 200) :\n jsonResponse('error', 'subscribe_fail', 422);\n\n return AjaxResponse::make(__('javascript.http_status.error', ['status' => 405]), __('javascript.http_status.method', ['method' => 'PUT / PATCH']), '', 405);\n }", "public function update(Request $request, string $id): Response\n {\n return $this->_notimplemented();\n }", "public function update($request, $id);", "function update($email, $subscriber) {\n return $this->put_request($this->_subscribers_base_route.'.json?email='.urlencode($email), $subscriber);\n }", "public function update($id)\n {\n $tax = CustomTax::whereCompanyId($this->scope->id())->whereId($id)->firstOrFail();\n $input = Request::onlyLegacy('title', 'tax_rate');\n $validator = Validator::make($input, ['title' => 'required']);\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n try {\n $tax->title = $input['title'];\n $tax->tax_rate = $input['tax_rate'];\n $tax->save();\n\n return ApiResponse::success([\n 'message' => trans('response.success.updated', ['attribute' => 'Tax']),\n 'custom_tax' => $this->response->item($tax, new CustomTaxesTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function update(Request $request, Account $account) {\n //\n }", "public function update(Request $r)\n {\n //\n\n }", "public function update(Request $request, Topic $topic)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter) {\n //\n }", "public function update(Request $request, $id)\n {\n //\n return ['response'=>0];\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function update(Request $request, Newsletter $newsletter)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $subcategory = SubCategory::where('id', $id)->first();\n\n $subcategory->name = request('name') ?? $subcategory->name;\n $subcategory->category_id = request('category_id') ?? $subcategory->category_id;\n $subcategory->update();\n return response()->json([\n 'status' => 'done',\n 'message' => 'Successfully sub_category updated '\n ]);\n }", "public function update(Request $request, $id)\n {\n \n }", "public function update(Request $request, $id)\n {\n \n }", "public function update(InfoRequest $request, Info $info)\n {\n //\n }", "public function updateAsync(array $params = [])\n {\n return $this->handleMiddleware('update', $params, function(MiddlewareRequest $request) {\n $params = $request->getApiMethodArguments();\n $data = $params;\n $response = $this->apiInstance->adcreativesUpdateAsync($data);\n return $response;\n });\n }", "public function update($channel, $text, $ts)\n {\n return $this->method('update', compact('channel', 'text', 'ts'));\n }", "public function update(Request $request, $id)\n {\n $service = Service::findOrFail($id);\n\n $service->fill($request->all());\n\n $service->save();\n\n return response()->json([\n 'message' => 'Service has been updated',\n 'service' => new \\App\\Http\\Resources\\Service($service)\n ]);\n }", "public function update(Request $request, SubTopic $subTopic)\n {\n $request->validate([\n 'course_id' => 'required',\n 'title' => 'required',\n 'content' => 'required',\n ]);\n\n $slug = Str::slug($request->title);\n\n $subTopic->update([\n 'title' => $request->title, 'slug' => $slug\n ]);\n\n $content = ModelsContent::whereSubTopicId($subTopic->id)->first();\n $content->update(['content' => $request->content]);\n\n $sub_topic = $subTopic->load('contents');\n\n return response()->json([\n 'success' => true,\n 'data' => [\n 'data' => $sub_topic,\n ]\n ], 200);\n }", "public function update(int $id, Request $request): \\Illuminate\\Http\\JsonResponse\n {\n $client = $this->client->find($id);\n if(!$client) {\n abort(404);\n }\n $client->update($request->all());\n \n return response()->json($client);\n }", "public function update(Classes\\UpdateRequest $arg) {\n\t\treturn $this->makeSoapCall(\"update\", $arg);\n\t}", "public function update(Request, $request)\n {\n \n\n }", "public function update(Request $request, Version $version)\n {\n //\n }", "public function update(Request $request, Sublivres $sublivres)\n {\n //\n }", "public function update(Request $request)\n {\n \n\n \n }", "public function update($params = []) {\n\t\tif(is_null($this->update_endpoint)) {\n\t\t\tthrow new BadMethodCallException('method not supported on this resource');\n\t\t}\n\n\t\t$params = array_merge($this->data,$params);\n\t\t$uri = $this->substitute($this->update_endpoint,$params);\n\t\t$response = $this->client->request('PATCH', $uri, ['json' => $params]);\n\n\t\t$decoded = $this->client->decode($response);\n\n\t\t$params = (array) $decoded[$this->response_key];\n\t\t$params['client'] = $this->client;\n\n\t\treturn new static($params);\n\t}", "public function update(Request $request) {\n }", "public function update(Request $request) {\n }", "public function update($id = null)\n\t{\n\t\treturn $this->fail(lang('RESTful.notImplemented', ['update']), 501);\n\t}" ]
[ "0.6731759", "0.66227084", "0.66135156", "0.66135156", "0.62097406", "0.6089385", "0.60654646", "0.5956002", "0.59049314", "0.58601135", "0.5717568", "0.5671041", "0.5559133", "0.55380934", "0.54909086", "0.5484493", "0.5366367", "0.53622746", "0.5355326", "0.5353226", "0.5333656", "0.53288996", "0.5320229", "0.5293465", "0.52820194", "0.52527803", "0.5248893", "0.52465403", "0.52386886", "0.52289164", "0.5224191", "0.52238834", "0.5213104", "0.5194339", "0.5169345", "0.51576585", "0.51501083", "0.51501083", "0.5149548", "0.5144485", "0.51412237", "0.5139266", "0.5131851", "0.51304764", "0.51216006", "0.5119442", "0.51159453", "0.51143235", "0.50958824", "0.50932264", "0.5080992", "0.50754374", "0.5062402", "0.50552493", "0.5027007", "0.5018467", "0.5003171", "0.4993165", "0.49693313", "0.49621913", "0.49569082", "0.49424967", "0.49384785", "0.4937634", "0.49346596", "0.4927695", "0.49239713", "0.49199113", "0.49170402", "0.49117076", "0.49060398", "0.48906696", "0.48894745", "0.4887698", "0.488362", "0.488362", "0.488362", "0.488362", "0.48808202", "0.4864231", "0.48549724", "0.48549724", "0.48475087", "0.48470464", "0.48470464", "0.4845986", "0.48437005", "0.48402193", "0.48389614", "0.48367104", "0.48338133", "0.48297098", "0.48291272", "0.48241377", "0.48229328", "0.4817939", "0.4817417", "0.48151356", "0.48151356", "0.48146197" ]
0.650908
4
Create request for operation 'update'
public function updateRequest($id, $update_subscription_request) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $id when calling update' ); } // verify the required parameter 'update_subscription_request' is set if ($update_subscription_request === null || (is_array($update_subscription_request) && count($update_subscription_request) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $update_subscription_request when calling update' ); } $resourcePath = '/subscriptions/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($id !== null) { $resourcePath = str_replace( '{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // for model (json/xml) if (isset($update_subscription_request)) { if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_subscription_request)); } else { $httpBody = $update_subscription_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem ]; } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = ObjectSerializer::buildQuery($formParams); } } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('Authorization'); if ($apiKey !== null) { $headers['Authorization'] = $apiKey; } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getUpdateRequest()\n\t{\n\t\t$url = $this->url();\n\t\n\t\t$url->getQuery()->setParameter('code', 200);\n\t\t\n\t\treturn new Api\\Request\\Update((string) $url);\n\t}", "public function update($request,$id) {\n \n\n }", "public function update(Request $req){\n\n }", "public function update(Request $req)\n { \n\n }", "public function createUpdateStruct();", "public function update(Request $request)\n { }", "public function update(Request $r)\n {\n //\n\n }", "public function update(Request $request) {\n \n \n }", "public function update(Request $request)\r\n {\r\n }", "public function update(Request $request)\r\n {\r\n }", "public function update(Request $request)\n {\n \n }", "public function update(Request $request) {\n }", "public function update(Request $request) {\n }", "public function update(Request, $request)\n {\n \n\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n \n\n \n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n \n }", "public function update(Request $request)\n\t{\n\n\t}", "public function update(Request $request)\n { \n }", "public function update(Request $request)\n { \n }", "public function update(Request $request)\n {\n \n }", "public static function updateIt(int $id, array $request);", "public function update(Request $request)\n {\n \n }", "protected function shopUpdateRequest($data)\n {\n // verify the required parameter 'data' is set\n if ($data === null || (is_array($data) && count($data) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $data when calling shopUpdate'\n );\n }\n\n $resourcePath = '/shop/update';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($data)) {\n $_tempBody = $data;\n }\n\n if (in_array('multipart/form-data', ['application/json', 'application/xml'])) {\n $multipart = true;\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', 'application/xml']\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 API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('access_token');\n if ($apiKey !== null) {\n $queryParams['access_token'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('nonce');\n if ($apiKey !== null) {\n $queryParams['nonce'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('timestamp');\n if ($apiKey !== null) {\n $queryParams['timestamp'] = $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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request)\n {\n //\n }", "public function update(Request $request, Python $python)\n {\n //\n }", "public function update($request, $id);", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function update(Request $request, $id) //更新\n {\t\n\t\t//\n }", "public function update(Request $request, TiendaApi $tiendaApi)\n {\n //\n }", "public function update(Request $request)\n {\n \n \n\t\t\n \n }", "abstract public function updateFromRequest(Request $request = null, array $otherAttributes = array());", "public function testUpdate()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($newModel->toArray());\n }", "public function update( array $params );", "public function update(Request $request, $id)\n {\n //\n\n \n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function tspUpdateRequest($tsp_update_request)\n {\n // verify the required parameter 'tsp_update_request' is set\n if ($tsp_update_request === null || (is_array($tsp_update_request) && count($tsp_update_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $tsp_update_request when calling tspUpdate'\n );\n }\n\n $resourcePath = '/tsp';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($tsp_update_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($tsp_update_request));\n } else {\n $httpBody = $tsp_update_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function update(Request $request,$id)\n {\n \n //\n }", "public function update(UpdateRequest $request)\n\t{\n\t\treturn parent::updateCrud();\n\t}", "public function update(Request $request, NetworkIPSEC $networkIPSEC)\n {\n //\n }", "abstract public function put(Request $request);", "public function update(Request $request, $id){}", "public function update(Request $request, $id)\n { \n\n }", "public function update(Request $request, Requierement $requierement)\n {\n //\n }", "public function update(R $request, $id)\n {\n //\n }", "public function update(int $id, array $request): bool;", "public function update(Request $request, $id)\n {\n \n }", "public function update(Request $request, $id)\n {\n \n }", "public function update($request, $id)\n {\n //\n }", "public function update($id, Request $request)\n {\n }", "public function update(Request $request,$id){\n }", "public function update( Request $request , $id )\n {\n //\n }", "#[NoReturn]\n public function update(Request $request, int $id): Response\n {\n dd($id, $request->all());\n }", "public function update(Request $request,$id)\n {\n\n }", "public function update(Request $request, $id)\n {\n\n\n\n }", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function update(UpdateRequest $request, $id)\n {\n //\n }", "public function update(Request $request, Namaz $namaz)\n {\n //\n }" ]
[ "0.77520025", "0.6893688", "0.68338996", "0.682253", "0.67853606", "0.6754133", "0.6745293", "0.6745244", "0.6728395", "0.6728395", "0.6727146", "0.67198616", "0.67198616", "0.6713608", "0.66961724", "0.6678498", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66628087", "0.66596025", "0.66596025", "0.66596025", "0.66596025", "0.66596025", "0.6648622", "0.66446406", "0.66155374", "0.66123736", "0.6602879", "0.6581784", "0.6578193", "0.6577046", "0.656812", "0.656812", "0.656812", "0.656812", "0.656812", "0.656812", "0.656812", "0.656812", "0.656812", "0.65614796", "0.6522469", "0.6453297", "0.6437868", "0.6418665", "0.63917744", "0.63841593", "0.6378291", "0.6368432", "0.6365047", "0.63638866", "0.63638866", "0.63559747", "0.6343853", "0.6343853", "0.6343853", "0.6343853", "0.63373", "0.6335582", "0.6308614", "0.6303034", "0.6302382", "0.630126", "0.62883925", "0.6282769", "0.62785935", "0.62722117", "0.6270991", "0.6270991", "0.62694186", "0.6260342", "0.62594396", "0.62568516", "0.625542", "0.62480396", "0.624688", "0.6244318", "0.6243624", "0.6238878" ]
0.0
-1
Create http client option
protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } return $options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createHttpClientOption()\n{\n$options = [];\nif ($this->config->getDebug()) {\n$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');\nif (!$options[RequestOptions::DEBUG]) {\nthrow new \\RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());\n}\n}\n\nreturn $options;\n}", "static private function setHTTPClient() {\n self::$handler = new \\GuzzleHttp\\Handler\\CurlMultiHandler();\n self::$http = new \\GuzzleHttp\\Client(array(\n 'handler' => \\GuzzleHttp\\HandlerStack::create(self::$handler)\n ));\n }", "protected function constructHttpClient()\n {\n $hasHttpClient = (null !== $this->httpClient);\n $this->httpClient = new HttpClient($this->getOptions());\n if (! $hasHttpClient) {\n $this->httpClient->registerDefaults();\n }\n }", "public function testCanMakeHttpOptions()\n {\n # Set desired response\n $resp = $this->createMock('Psr\\Http\\Message\\ResponseInterface');\n $this->mockClient->addResponse($resp);\n $httpClient = $this->givenSdk()->getHttpClient();\n $response = $httpClient->options(\"/dummy_uri\");\n\n $this->assertSame($resp, $response);\n }", "private function setRequestOptions()\n {\n $this->client = new Client(['base_uri' => $this->baseUrl]);\n }", "protected function createHttpClientOption()\n {\n $options = [];\n if ($this->config['debug']) {\n $options[RequestOptions::DEBUG] = fopen($this->config['debugFile'], 'a');\n if (!$options[RequestOptions::DEBUG]) {\n throw new \\RuntimeException('Failed to open the debug file: ' . $this->config['debugFile']);\n }\n }\n\n return $options;\n }", "protected function http(){\n\n if( empty($this->HTTPClient) ){\n\n //init stack\n $stack = HandlerStack::create();\n\n if ( $this->token ){\n\n //setup to send the token with each request\n\n $this->addHeader(Headers::AUTHORIZATION, ( \"TOKEN \" . $this->token->getValue() ) );\n\n }\n else{\n\n //setup client to send signed requests\n\n $signer = new Signer(Settings::PROVIDER);\n $middleware = new Middleware($signer, $this->cfg->getKey(), $this->cfg->getSecret());\n\n $stack->push($middleware);\n\n }\n\n //enable debug\n if( $logger = $this->cfg->getLogger() )\n $this->pushRequestLogger($logger, $stack);\n\n //create the client\n $this->HTTPClient = new HTTPClient([\n 'headers' => &$this->headers,\n 'timeout' => $this->cfg->getRequestTimeout(),\n 'handler' => $stack\n ]);\n\n return $this->HTTPClient;\n\n }\n\n return $this->HTTPClient;\n\n }", "private function _createHttpClientOption() \n {\n $options = [];\n if ($this->config->getDebug()) {\n $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');\n if (!$options[RequestOptions::DEBUG]) {\n throw new \\RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());\n }\n }\n\n return $options;\n }", "public function __construct(ClientInterface $http_client) {\n $this->httpClient = $http_client;\n $this->ej_market_data_web_service_url = \\Drupal::config('ej_market_data.adminsettings')->get('ej_market_data_web_service_url');\n }", "protected function createHttpClientOption()\n {\n $options = [];\n\n if ($this->config->getDebug()) {\n $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'ab');\n\n if (! $options[RequestOptions::DEBUG]) {\n throw new \\RuntimeException('Failed to open the debug file: '.$this->config->getDebugFile());\n }\n }\n\n return $options;\n }", "protected function createHttpClientOption()\n {\n $options = [];\n\n if ($this->config->getDebug()) {\n $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'ab');\n\n if (! $options[RequestOptions::DEBUG]) {\n throw new \\RuntimeException('Failed to open the debug file: '.$this->config->getDebugFile());\n }\n }\n\n return $options;\n }", "protected function createHttpClientOption()\n {\n $options = [];\n if ($this->config->getDebug()) {\n $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');\n if (!$options[RequestOptions::DEBUG]) {\n throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());\n }\n }\n\n return $options;\n }" ]
[ "0.68757546", "0.67108804", "0.64613956", "0.6300258", "0.62856317", "0.61810327", "0.6174985", "0.6153127", "0.61101645", "0.6098676", "0.6098676", "0.6074991" ]
0.0
-1
$this>itemsObj = new Festival_Model_OrderItems();
public function init() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n $this->model = new Model_Jiafuyun_Order();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->bsodOrder = new BsodOrder();\n }", "function __construct()\n {\n $this->items = [];\n }", "public function __construct() {\n $this->items = [];\n }", "public function __construct()\n {\n $this->model = new OrderProduct();\n }", "public function __construct(Item $items)\n {\n $this->model = $items;\n }", "public function __construct()\n {\n // $this->detail = new OrderDetail();\n // $this->product = new Product();\n // $this->category = new Category();\n // $this->branch = new Branch();\n // $this->delivery = new Delivery();\n }", "public function ITEM($itemid) { $this->__construct($itemid); }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n $this->item = [];\n }", "public function __construct($items) {\n $this->items = $items;\n }", "public function __construct()\n {\n $this->inventory = new Inventory();\n }", "function getItems(){return $this->items;}", "protected function __construct() {\r\n $this->items = $this->initItems();\r\n }", "public function items ()\n {\n }", "function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}", "public function __construct(Order $testObj)\n {\n parent::__construct();\n $this->testObj = $testObj;\n\n }", "function __construct()\n\t{\n\t\t// this->model = new Producto();\n\t}", "function __construct() {\n $this->contact = new QuadernoContact(array(\n 'first_name' => 'Joseph',\n 'last_name' => 'Tribbiani',\n 'contact_name' => 'Friends Staff'));\n $this->contact->save();\n\n $this->item = new QuadernoDocumentItem(array(\n 'description' => 'concepto 1',\n 'price' => 100.0,\n 'quantity' => 20\n ));\n }", "public function __construct() {\n $this->_db = Zend_Registry::get('db');\n $this->_auth = Zend_Auth::getInstance()->getIdentity();\n if (isset($this->getSessionNs()->items)) {\n $this->_items = $this->getSessionNs()->items;\n }\n if (isset($this->getSessionNs()->shipping)) {\n $this->_shipping = $this->getSessionNs()->shipping;\n }\n if (isset($this->getSessionNs()->shippingCost)) {\n $this->_shippingCost = $this->getSessionNs()->shippingCost;\n }\n if (isset($this->getSessionNs()->salesTax)) {\n $this->_salesTax = $this->getSessionNs()->salesTax;\n }\n $this->_order = new Application_Model_Order;\n }", "public function run()\n {\n $item = new Orders;\n $item->id = 1;\n $item->code = \"PHUOCDEPTRAIVL\";\n $item->customer_id = 1;\n $item->payment_method = \"Cash\";\n $item->total_price = 10000;\n $item->status = 0;\n $item->created_at = \"2021-09-25 23:19:08\";\n $item->updated_at = \"2021-09-25 23:19:08\";\n $item->save();\n\n $item = new Orders;\n $item->id = 2;\n $item->code = \"PHUDEPTRAIVL\";\n $item->customer_id = 2;\n $item->payment_method = \"Cash\";\n $item->total_price = 20000;\n $item->status = 0;\n $item->created_at = \"2021-09-25 23:19:08\";\n $item->updated_at = \"2021-09-25 23:19:08\";\n $item->save();\n }", "private static function init(){\n\t\t\tself::$items=array();\n\t\t}", "public function __construct(){\n parent::__construct(new ExporterItemInfo());\n }", "public function __construct() {\n $this->items = new ArrayCollection;\n $this->orderProducts = new ArrayCollection;\n $this->promotions = new ArrayCollection();\n\n }", "public function __construct() \n {\n $this->_supplyOrderList = array();\n $this->_errorList = array();\n\n }", "public function __construct($item) {\n\t\t$this->item = $item;\n\t}", "public function __construct(Order $order_model)\n {\n $this->_order_model = $order_model;\n }", "public function __construct(){\n $this->productos = new Producto();\n }", "public function __construct($item)\n {\n $this->item = $item;\n }", "public function _construct()\n {\n $this->_init('saveorder/saveorder', 'saveorder_id');\n }", "function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function __construct(){\n parent::__construct(new ImportItemInfo());\n }", "public function __construct() {\n\t\t$this->model = new Model();\n\t\t$this->view = new View();\n\t\t$this->cart = array();\n\t\t$this->productArray = array();\n\t\t$this->productVar = array();\n\t\t\n\t}", "public function items()\n {\n \n }", "public function model()\n {\n return OrderItem::class;\n }", "public function model()\n {\n return OrderItem::class;\n }", "protected function _construct()\n\t{\n\t\t$this->_setPath(\"order\");\n\t}", "function __construct($item_id, $item_name, $quantity, $price) {\n $this->item_id = $item_id;\n $this->item_name = $item_name;\n $this->quantity = $quantity;\n $this->price = $price;\n }", "function __construct($order_item, $order_id, $ticket_item_meta=''){\r\n\t\t$this->order_item = $order_item;\r\n\t\t$this->order_id = $order_id;\r\n\t\t$this->ticket_item_meta = $ticket_item_meta;\r\n\r\n\t\t$this->the_ticket_item_id = $this->ticket_item_id();\r\n\t}", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "public function __construct(){\n\t\tinclude_once(\"model/crews_model.php\");\n\t\t$this->model = new crews_model();\n\t}", "private function __construct()\n {\n $orderNumber = uniqid();\n $this->_order = new Orders();\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity()) {\n $user = $auth->getIdentity();\n $this->_order->user = $user['id'];\n }\n $this->_order->ordernumber = $this->getOrderNumber();\n $this->_order->save();\n }", "public function __construct() {\n parent::__construct(); \n\n $this->load->library('form_validation');\n $this->load->library('session');\n $this->load->model('ItemModel');\n\n $this->itemCRUD = new ItemModel;\n }", "function carrinho(){\n\t\t\t$this->items = array();\n\t\t}", "public function __construct($id, $item);", "public function __construct() {\n\t\t$this->order = Array();\n\t\t$this->customer = Array();\n\t}", "public function __construct()\n\t{\n\t \t//$this->ecommerceClient = new ecommerceClient();\n\t\t\n\t}", "public function __construct($items = [])\n {\n //Execute parent construct\n parent::__construct($items);\n }", "public function __construct(){\n $this->users_elements_in_cart = new ClientShoppingCartController;\n }", "public function __construct(){\n\t\t$this->AB = new About(); \n\t\t$this->AP = new AppModel();\n\n\t}", "function __construct(){\n $this->toko = new M_Toko();\n $this->produk = new M_Produk(); //variabel model merupakan objek baru yang dibuat dari class model\n }", "public function __construct() {\n\t\t$this->orgModel = new OrgModel(); // TODO: \n\t }", "public function __construct()\n {\n $this->productList = new ProductList();\n }", "public function init()\n {\n $this->_equipo = new Application_Model_DeporEquipo();\n }", "public function items(){\n return $this->hasMany(OrderItem::class);\n }", "public function items()\n {\n return $this->hasMany('TechTrader\\Models\\OrderItem');\n }", "public function __construct($items = array()) {\n foreach ($items as $item) {\n $this->addItem($item); \n }\n }", "\r\n $c = 0;\r\n while ($row = $this->sqlGetNextRow() ){\r\n $this->order_detail[$this->order_detailCount]['orderID'] = $row ['orderID'];\r\n $this->order_detail[$this->order_detailCount]['bookId'] = $row ['bookID'];\r\n $this->order_detail[$this->order_detailCount]['price'] = $row ['price'];\r\n $this->order_detail[$this->order_detailCount]['count'] = $row ['count'];\r\n $this->order_detailCount++;\r\n }\r\n\r\n }\r\n\r\n function modelGetOrderDetailByOrderID ($id){\r\n }", "public function orderItem(): OrderItem\n {\n return $this->order_item;\n }", "public function show($orderItem)\n {\n }", "public function __construct()\n\t{\n\t\t$this->modelProducts = new ProductsModel();\n\t\t/* ********** fin initialisation Model ********** */\n\t}", "public function run()\n {\n\n $order1 = new Order();\n $order1->processed = 1;\n $order1->user_id = 4;\n $order1->cart = 'O:8:\"App\\Cart\":3:{s:5:\"items\";a:2:{i:10;a:3:{s:3:\"qty\";i:2;s:5:\"price\";d:5;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:10;s:5:\"title\";s:17:\"Bear Beer Special\";s:11:\"description\";s:176:\"Special Bear Beer beer. Combines classic sophistication with chic trendsetting.Great at weddings, picnics, and sporting events when it is being compared to domestic light beer.\";s:5:\"price\";s:4:\"2.50\";s:3:\"img\";s:28:\"/storage/images/bearbeer.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}i:6;a:3:{s:3:\"qty\";i:1;s:5:\"price\";d:2;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:6;s:5:\"title\";s:14:\"Laško Special\";s:11:\"description\";s:334:\"Laško Special combines classic sophistication with chic trendsetting. On the one hand, the designation “traditionally brewed” is about reviving tried and tested names in new versions, and on the other, “new tradition” suggests fresh recipes. History is embodied in a noble red, and the future in an elegant silver neck label.\";s:5:\"price\";s:4:\"2.00\";s:3:\"img\";s:27:\"/storage/images/special.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}}s:8:\"totalQty\";i:3;s:10:\"totalPrice\";d:7;}';\n $order1->save();\n\n $order2 = new Order();\n $order2->processed = 1;\n $order2->user_id = 4;\n $order2->cart = 'O:8:\"App\\Cart\":3:{s:5:\"items\";a:2:{i:4;a:3:{s:3:\"qty\";i:2;s:5:\"price\";d:2.8999999999999999;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:4;s:5:\"title\";s:16:\"Laško Weißbier\";s:11:\"description\";s:320:\"Laško Weißbier Laško Weißbier was inspired by the freshness of the Alps. This light, unfiltered beer pivo is characterized by haziness, yeast sediment and special harmonious note with mild bitterness. It\"s made with lovers of rich flavored beers in mind and it\"s the perfect refreshment for hanging out with friends.\";s:5:\"price\";s:4:\"1.45\";s:3:\"img\";s:25:\"/storage/images/weiss.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}i:1;a:3:{s:3:\"qty\";i:4;s:5:\"price\";d:4.3600000000000003;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:1;s:5:\"title\";s:15:\"Laško Zlatorog\";s:11:\"description\";s:985:\"A specific taste which has remained the same over years owing to our unchanged recipe. Full of pride! Zlatorog is a pale lager with a specific flavour, rich head and a characteristic distinct bitterness achieved by using worldwide known Slovenian hop varieties. Incorporating the finest ingredients and the latest technological advances and brewed using our traditional formula which has remained unchanged for decades we can proudly say Zlatorog is a beer that was already enjoyed by our grandparents. Incorporating the finest ingredients and the latest technological advances and brewed using our traditional formula which has remained unchanged for decades we can proudly say Zlatorog is a beer that was already enjoyed by our grandparents. It is the best-selling Laško beer which suggests how nicely it goes down the hatch. In selected bars across Slovenia you can also indulge in a mug of Laško Zlatorog draught beer which gratifies all the senses and provides perfect pleasure.\";s:5:\"price\";s:4:\"1.09\";s:3:\"img\";s:26:\"/storage/images/svetlo.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}}s:8:\"totalQty\";i:6;s:10:\"totalPrice\";d:7.2599999999999998;}';\n $order2->save();\n\n $order3 = new Order();\n $order3->processed = 0;\n $order3->user_id = 5;\n $order3->cart = 'O:8:\"App\\Cart\":3:{s:5:\"items\";a:3:{i:9;a:3:{s:3:\"qty\";i:10;s:5:\"price\";d:49.900000000000006;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:9;s:5:\"title\";s:19:\"Desparados Tequilla\";s:11:\"description\";s:163:\"Desperados is a pale lager beer with 5.9% alcohol by volume originally produced by the French brewing company Fischer Brewery, now produced by Karlovačko Brewery.\";s:5:\"price\";s:4:\"4.99\";s:3:\"img\";s:30:\"/storage/images/desparados.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}i:11;a:3:{s:3:\"qty\";i:2;s:5:\"price\";d:1.98;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:11;s:5:\"title\";s:5:\"Chang\";s:11:\"description\";s:446:\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\";s:5:\"price\";s:4:\"0.99\";s:3:\"img\";s:25:\"/storage/images/chang.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}i:10;a:3:{s:3:\"qty\";i:5;s:5:\"price\";d:12.5;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:10;s:5:\"title\";s:17:\"Bear Beer Special\";s:11:\"description\";s:176:\"Special Bear Beer beer. Combines classic sophistication with chic trendsetting.Great at weddings, picnics, and sporting events when it is being compared to domestic light beer.\";s:5:\"price\";s:4:\"2.50\";s:3:\"img\";s:28:\"/storage/images/bearbeer.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}}s:8:\"totalQty\";i:17;s:10:\"totalPrice\";d:64.380000000000024;}';\n $order3->save();\n\n $order4 = new Order();\n $order4->processed = 1;\n $order4->user_id = 5;\n $order4->cart = 'O:8:\"App\\Cart\":3:{s:5:\"items\";a:1:{i:3;a:3:{s:3:\"qty\";i:2;s:5:\"price\";d:2.6600000000000001;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:3;s:5:\"title\";s:20:\"Laško Unpasteurized\";s:11:\"description\";s:574:\"Laško Nepasterizirano (Laško Unpasteurized) is an exceptionally drinkable light beer that comes in bottles with a retro hint, and is celebrated for its relaxed character formed by a full taste, a pleasantly fresh, hoppy aroma and the authentic bitterness of the legendary Slovenian beer. Laško Nepasterizirano offers a unique freshness, which is why its shelf life is limited to 12 weeks. It is, in fact, created with the help of a special procedure following the traditional recipe using pure malt. The perfect companion for spontaneous gatherings on hot and sunny days.\";s:5:\"price\";s:4:\"1.33\";s:3:\"img\";s:35:\"/storage/images/nepasterizirano.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}}s:8:\"totalQty\";i:2;s:10:\"totalPrice\";d:2.6600000000000001;}';\n $order4->save();\n\n $order5 = new Order();\n $order5->processed = 0;\n $order5->user_id = 6;\n $order5->cart = 'O:8:\"App\\Cart\":3:{s:5:\"items\";a:1:{i:12;a:3:{s:3:\"qty\";i:24;s:5:\"price\";d:7.9199999999999999;s:4:\"item\";O:8:\"stdClass\":7:{s:2:\"id\";i:12;s:5:\"title\";s:10:\"KingFisher\";s:11:\"description\";s:446:\"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\";s:5:\"price\";s:4:\"0.33\";s:3:\"img\";s:30:\"/storage/images/kingfisher.png\";s:10:\"created_at\";s:19:\"2018-01-07 19:27:47\";s:10:\"updated_at\";s:19:\"2018-01-07 19:27:47\";}}}s:8:\"totalQty\";i:24;s:10:\"totalPrice\";d:7.9200000000000008;}';\n $order5->save();\n\n }", "public function testCreatePayItem()\n {\n }", "public function __construct()\n\t{\n\t\t// \\ladybug_dump($model);\n\t}", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "public function prepare_items()\n {\n }", "function Receipt_Batch(){\n\t/*Constructor function initialises a new receipt batch */\n\t\t$this->Items = array();\n\t\t$this->ItemCounter=0;\n\t\t$this->total=0;\n\t}", "public function __construct()\n {\n parent::__construct();\n $session = Mage::getSingleton('customer/session');\n $purchased = Mage::getResourceModel('mytunes/link_collection')\n ->addFieldToFilter('customer_id', $session->getCustomerId())\n ->addOrder('order_id', 'desc')\n ->addOrder('order_item_id', 'asc')\n ->addOrder('track_number', 'asc');\n $this->setItems($purchased);\n }", "public function get_orderitem(){\n $consulta=$this->db->query(\"select * from ORDERITEM;\");\n\n while($filas=$consulta->fetch_assoc()){\n $this->orderitem[]=$filas;\n }\n\n return $this->orderitem;\n}", "public function __CONSTRUCT(){\n $this->model = new Estadobien();\n }", "function __construct()\r\n {\r\n parent::__construct();\r\n $this->load->model('API/cart_model', 'cart_model');\r\n $this->load->model('API/order_model', 'order_model');\r\n }", "public function activeOrders()\n {\n }", "public function _construct(){\n $infoOrder = Mage::getSingleton('adminhtml/session')->getInfoOrder();\n if($infoOrder == null){\n $orderId = Mage::getSingleton('adminhtml/session')->getOrderViewDetail();\n } else {\n $orderId = $infoOrder['entity_id'];\n }\n if($orderId == null){\n $orderId = $this->getRequest('')->getParam('order_id');\n }\n $this->order = Mage::getModel('sales/order')->load($orderId);\n $this->_orderId = $orderId;\n }", "function clsRecorditems()\r\n {\r\n\r\n global $FileName;\r\n $this->Visible = true;\r\n $this->Errors = new clsErrors();\r\n $this->ds = new clsitemsDataSource();\r\n $this->InsertAllowed = false;\r\n $this->UpdateAllowed = false;\r\n $this->DeleteAllowed = false;\r\n if($this->Visible)\r\n {\r\n $this->ComponentName = \"items\";\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n $this->description = new clsControl(ccsLabel, \"description\", \"Description\", ccsMemo, \"\", CCGetRequestParam(\"description\", $Method));\r\n $this->description->HTML = true;\r\n }\r\n }", "protected function setUp()\n {\n $this->item = new Item();\n }", "public function __construct($_name = NULL,$_number = NULL,$_quantity = NULL,$_tax = NULL,$_amount = NULL,$_ebayItemPaymentDetailsItem = NULL,$_promoCode = NULL,$_productCategory = NULL,$_description = NULL,$_itemWeight = NULL,$_itemLength = NULL,$_itemWidth = NULL,$_itemHeight = NULL,$_itemURL = NULL,$_enhancedItemData = NULL,$_itemCategory = NULL)\r\n\t{\r\n\t\tparent::__construct(array('Name'=>$_name,'Number'=>$_number,'Quantity'=>$_quantity,'Tax'=>$_tax,'Amount'=>$_amount,'EbayItemPaymentDetailsItem'=>$_ebayItemPaymentDetailsItem,'PromoCode'=>$_promoCode,'ProductCategory'=>$_productCategory,'Description'=>$_description,'ItemWeight'=>$_itemWeight,'ItemLength'=>$_itemLength,'ItemWidth'=>$_itemWidth,'ItemHeight'=>$_itemHeight,'ItemURL'=>$_itemURL,'EnhancedItemData'=>$_enhancedItemData,'ItemCategory'=>$_itemCategory));\r\n\t}", "public function items()\n {\n return $this->hasMany('App\\OrderItem');\n }", "public function __construct($_shipmentItem = NULL)\n {\n parent::__construct(array('ShipmentItem' => $_shipmentItem), false);\n }", "function setOrderPaid($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function order_items()\n {\n return $this->hasMany('App\\Order_Item');\n }", "public function __construct( array $items = [] )\n\t{\n\t\t$this->items = $items;\n\t}", "function __construct() {\n\t\t$this->cotizacionModel = new cotizacionModel();\n\t}", "public function __construct($_items = NULL,$_bucketId = NULL,$_sellerId = NULL,$_externalSellerId = NULL,$_bucketSubtotalAmt = NULL,$_bucketShippingAmt = NULL,$_bucketInsuranceAmt = NULL,$_bucketSalesTaxAmt = NULL,$_bucketTotalAmt = NULL)\r\n\t{\r\n\t\tparent::__construct(array('Items'=>$_items,'BucketId'=>$_bucketId,'SellerId'=>$_sellerId,'ExternalSellerId'=>$_externalSellerId,'BucketSubtotalAmt'=>$_bucketSubtotalAmt,'BucketShippingAmt'=>$_bucketShippingAmt,'BucketInsuranceAmt'=>$_bucketInsuranceAmt,'BucketSalesTaxAmt'=>$_bucketSalesTaxAmt,'BucketTotalAmt'=>$_bucketTotalAmt));\r\n\t}", "public function __construct()\n {\n $this->itemPrices = new ArrayCollection();\n }", "public function run()\n {\n $item = new Item();\n $item->name = \"1-3\";\n $item->tier5_cost = 525;\n $item->other_cost = 1050;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"4-9\";\n $item->tier5_cost = 1000;\n $item->other_cost = 2140;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"10+\";\n $item->tier5_cost = 1600;\n $item->other_cost = 3270;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 1;\n $item->save();\n $item = new Item();\n $item->name = \"SOCIAL\";\n $item->tier5_cost = 550;\n $item->other_cost = 1150;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"EMAIL\";\n $item->tier5_cost = 1000;\n $item->other_cost = 2000;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 2;\n $item->save();\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1500;\n $item->other_cost = 3300;\n $item->step = 3;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 3;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 3;\n $item->save();\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1500;\n $item->other_cost = 3000;\n $item->step = 4;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 4;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 4;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1700;\n $item->other_cost = 3300;\n $item->step = 5;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 5;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 5;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 1000;\n $item->other_cost = 2000;\n $item->step = 6;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 6;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 6;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 3500;\n $item->other_cost = 6367;\n $item->step = 7;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 7;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 7;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 5555;\n $item->other_cost = 10827;\n $item->step = 8;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 8;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 8;\n $item->save();\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 3247;\n $item->other_cost = 6494;\n $item->step = 9;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 9;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 9;\n $item->save();\n\n $item = new Item();\n $item->name = \"YES\";\n $item->tier5_cost = 6000;\n $item->other_cost = 12732;\n $item->step = 10;\n $item->save();\n $item = new Item();\n $item->name = \"NO\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 10;\n $item->save();\n $item = new Item();\n $item->name = \"DON'T KNOW\";\n $item->tier5_cost = 0;\n $item->other_cost = 0;\n $item->step = 10;\n $item->save();\n }", "public function __construct()\n {\n // $this->invoice = $invoice;\n // $this->quiz = $quiz;\n }", "public function __construct()\n {\n parent::__construct();\n $this->load->library(array('Mpdf','upload','Image_lib'));\n\n $this->load->model(array('Deliveryorder_2/Deliveryorder_model',\n 'Deliveryorder_2/Detaildeliveryorder_model',\n 'Salesorder/Salesorder_model',\n 'Salesorder/Detailsalesorder_model',\n 'Pendingso/Pendingso_model',\n 'Pendingso/Detailpendingso_model',\n 'Customer/Customer_model',\n 'Aktifitas/aktifitas_model'\n ));\n\n $this->template->title('Delivery Order');\n $this->template->page_icon('fa fa-table');\n\n date_default_timezone_set(\"Asia/Bangkok\");\n }", "public function __construct(){\n\t\t\tparent::__construct();\n\t\t\t$this->load->model(\"Auction\");\n\t\t}", "public function __construct($items = [])\n {\n $this->items = $items;\n }", "public function __construct($order)\n {\n $this->order=$order;\n }", "public function __construct()\n {\n\t;\n }", "function __construct($values) {\n foreach ($values->items as $value) {\n $item= new RJsonwalksItem($value);\n $this->items[]=$item;\n }\n }", "public function orderItem($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->orderItemError->_value = 'authentication_error';\n else {\n $targets = $this->config->get_value('ruth', 'ztargets');\n $agencyId = self::strip_agency($param->agencyId->_value);\n if ($tgt = $targets[$agencyId]) {\n // build order\n $ord = &$order->Reservation->_value;\n $ord->LibraryNo->_value = $agencyId;\n $ord->BorrowerTicketNo->_value = $param->userId->_value;\n $ord->DisposalNote->_value = $param->orderNote->_value;\n $ord->LastUseDate->_value = self::to_zruth_date($param->orderLastInterestDate->_value);\n $ord->ServiceCounter->_value = $param->agencyCounter->_value;\n $ord->Override->_value = (self::xs_true($param->agencyCounter->_value) ? 'Y' : 'N');\n $ord->Priority->_value = $param->orderPriority->_value;\n // ?????? $ord->DisposalType->_value = $param->xxxx->_value;\n $itemIds = &$param->orderItemId;\n if (is_array($itemIds))\n foreach ($itemIds as $oid) {\n $mrid->ID->_value = $oid->_value->itemId->_value;\n if (!$mrid->TitlePartNo->_value = $oid->_value->itemSerialPartId->_value)\n $mrid->TitlePartNo->_value = 0;\n $ord->MRIDS->_value->MRID[]->_value = $mrid;\n }\n else {\n $mrid->ID->_value = $itemIds->_value->itemId->_value;\n if (!$mrid->TitlePartNo->_value = $itemIds->_value->itemSerialPartId->_value)\n $mrid->TitlePartNo->_value = 0;\n $ord->MRIDS->_value->MRID->_value = $mrid;\n }\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($order));\n \n//print_r($ord);\n//print_r($xml);\n \n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = &$dom->getElementsByTagName('ErrorResponse')->item(0)) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err->getAttribute('Err') . \n ' error: ' . $err->nodeValue);\n $res->orderItemError->_value = 'unspecified error, order not possible';\n } else {\n // order at least partly ok \n foreach ($dom->getElementsByTagName('MRID') as $mrid) {\n unset($ir);\n $ir->orderItemId->_value->itemId->_value = $mrid->getAttribute('Id');\n if ($mrid->getAttribute('Tp'))\n $ir->orderItemId->_value->itemSerialPartId->_value = $mrid->getAttribute('Tp');\n if (!$mrid->nodeValue)\n $ir->orderItemOk->_value = 'true';\n elseif (!($ir->orderItemError->_value = $this->errs[$mrid->nodeValue])) \n $ir->orderItemError->_value = 'unknown error: ' . $mrid->nodeValue;\n $res->orderItem[]->_value = $ir;\n }\n }\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->orderItemError->_value = 'system error';\n }\n//echo \"\\n\";\n//print_r($xml_ret);\n//print_r(\"\\nError: \" . $z->get_errno());\n } else\n $res->orderItemError->_value = 'unknown agencyId';\n }\n\n $ret->orderItemResponse->_value = $res;\n //var_dump($param); var_dump($res); die();\n return $ret;\n }", "public function __construct($line_items)\n {\n $this->line_items = $line_items;\n }", "public function getOrder()\n {\n\n }", "public function __construct ()\n { // TODO Auto-generated constructor\n }", "function __construct () {\n\n\t\techo 'I am in Model';\n\n\t}" ]
[ "0.6970815", "0.65818965", "0.6487226", "0.63998264", "0.63179785", "0.6308791", "0.6266799", "0.62652004", "0.62286776", "0.62286776", "0.62044525", "0.61947966", "0.6167838", "0.61582476", "0.60812825", "0.60708594", "0.60563695", "0.60502666", "0.60268563", "0.6020639", "0.6018478", "0.6018067", "0.600496", "0.59949577", "0.59798187", "0.5972667", "0.5958818", "0.59465843", "0.593525", "0.5918776", "0.59151375", "0.59009105", "0.5898536", "0.58919805", "0.5874379", "0.58734965", "0.58734965", "0.587083", "0.5869637", "0.58683085", "0.5863646", "0.58340544", "0.5821477", "0.5818443", "0.5807884", "0.5804103", "0.5791021", "0.5780281", "0.5779628", "0.5772662", "0.5767307", "0.57658327", "0.57611346", "0.5748304", "0.57412875", "0.573715", "0.57237965", "0.56997216", "0.56814164", "0.56679565", "0.566499", "0.566089", "0.5642317", "0.56399167", "0.56324357", "0.563204", "0.563204", "0.563204", "0.56305385", "0.5629572", "0.56254655", "0.562398", "0.56067574", "0.56058174", "0.55973613", "0.559482", "0.55936575", "0.5593628", "0.5589702", "0.5588759", "0.5588679", "0.5588332", "0.5585581", "0.5584801", "0.55845886", "0.55801505", "0.5572238", "0.55715114", "0.5567231", "0.55613065", "0.55587405", "0.55565715", "0.5549718", "0.5548497", "0.553793", "0.5537836", "0.5536001", "0.5534125", "0.55330694", "0.55291104", "0.5529092" ]
0.0
-1
Display a listing of the resource.
public function index() { $data = ProductCategory::all(); return response()->json($data,200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $validator = Validator::make($request->all(), [ 'name'=>'required|unique:product_category' ]); if($validator->fails()){ return response()->json($validator->messages(),200); } $pc = new ProductCategory(); $pc->name = $request->name; $pc->save(); return response()->json(['messages' => 'Product category created'],200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request) { $validator = Validator::make($request->all(), [ 'name'=>'required|unique:product_category' ]); if($validator->fails()) { return response()->json($validator->messages(),200); } $messages = ''; $pc = ProductCategory::find($request->product_category_id); if(!empty($pc)) { $pc->name=$request->name; $pc->save(); $messages = 'Product category updated'; } else { $messages = 'product category id not found'; } return response()->json(['messages' =>$messages],200); /**) } * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $pc = ProductCategory::find($id); $pc->delete(); return response()->(['messages'=>'Product deleted'],200); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Check directory's and file's existence, create it, open it, and return the file object.
public function openFile() { // check directory $file_path and create the directory if it doesn't exist if (!file_exists($this->file_path)) { if (!mkdir($this->file_path, 0777, true)) { throw new Exception('Failed to create directory.'); } } // open $file_name and create the file if it doesn't exist $file = new SplFileObject($this->file_path.$this->file_name, 'a+'); return $file; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createFile(FileInterface $file, DirectoryInterface $parent): FileInterface;", "function mk_file( $filename ) {\n \n // if file doesn't exist, create file and close it\n if ( ! is_file( $filename ) ) {\n fclose( fopen($filename, 'x' ) );\n return true;\n }\n\n // file already exist \n return false;\n}", "protected function createFile() {}", "public function openFile($fname, $create=false)\r\n\t{\r\n\t\t\r\n\t\t$antFs = ServiceLocatorLoader::getInstance($this->dbh)->getServiceLocator()->get(\"AntFs\");\r\n\t\t\r\n\t\t$accPath = $antFs->getAccountDirectory($this->dbh);\r\n\t\t$file = null; \r\n\r\n\t\tif ($this->id && $accPath && $this->user)\r\n\t\t{\r\n\t\t\t$fid = null;\r\n\r\n\t\t\t$olist = new CAntObjectList($this->dbh, \"file\", $this->user);\r\n\t\t\t$olist->addCondition(\"and\", \"folder_id\", \"is_equal\", $this->id);\r\n\t\t\t$olist->addCondition(\"and\", \"name\", \"is_equal\", $fname);\r\n\t\t\t$olist->getObjects(0, 1);\r\n\t\t\tif ($olist->getNumObjects())\r\n\t\t\t{\r\n\t\t\t\t$obj = $olist->getObjectMin(0);\r\n\t\t\t\t$fid = $obj['id'];\r\n\t\t\t}\r\n\r\n\t\t\t// If not found and we are not supposed to create the file\r\n\t\t\tif (!$fid && !$create)\r\n\t\t\t\treturn null;\r\n\r\n\t\t\t$file = CAntObject::factory($this->dbh, \"file\", $fid, $this->user);\r\n\t\t\t$file->setValue(\"name\", $fname);\r\n\t\t\t$file->setValue(\"folder_id\", $this->id);\r\n\t\t\t$file->skipObjectSyncStatCol = $this->skipObjectSyncStatCol;\r\n\t\t\t/*\r\n\t\t\t$file = new AntFs_File($this->dbh, $fid, $this->user);\r\n\t\t\t$file->name = $fname;\r\n\t\t\t$file->folderId = $this->id;\r\n\t\t\t */\r\n\t\t\tif ($file->save() === false)\r\n\t\t\t\t$file = null;\r\n\t\t}\r\n\r\n\t\treturn $file;\r\n\t}", "private function createIfNeededAndOpenFile(string $filePath)\n {\n $dirname = dirname($filePath);\n $dirExist = is_dir($dirname);\n if (!$dirExist) {\n $dirExist = mkdir($dirname, 0755, true);\n }\n if (!$dirExist) {\n throw new IOException('Directory cannot be created');\n }\n $resource = fopen($filePath, 'w');\n if (!$resource) {\n throw new IOException('Fail to open the file');\n }\n return $resource;\n }", "public function createDirectory()\n {\n $bReturn = $this->exists();\n if( !$bReturn && $this->_sPath->isValid() )\n {\n $bReturn = mkdir( (string)$this->_sPath, 0770, TRUE);\n if( $bReturn )\n {\n $this->_sPath->setValue( $this->getRealPath() );\n }\n }\n return $bReturn;\n }", "function createDirectoryIfNonExistent() {\n if (! file_exists($this->path)) {\n mkdir($this->path);\n }\n }", "public function create()\n {\n if (! $this->adapter->fileExists($this->path, true)) {\n // ensure the parent directory exists\n new Directory(dirname($this->path), $this->adapter);\n\n if ($this->adapter->createFile($this->path) === false) {\n $this->throwUnableToCreate();\n }\n }\n\n return $this;\n }", "protected function createDirectory() {}", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "protected function _open() {\r\n $mode = $this->option_create ? 'a+' : 'r+';\r\n // r+ : Open for reading and writing; place the file pointer at the beginning of the file.\r\n // a+ : Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.\r\n $file = $this->file;\r\n $mask = 0666 & ~$this->option_perms;\r\n $old_mask = umask($mask);\r\n $result = fopen($this->file, $mode);\r\n umask($old_mask);\r\n if (!$result) {\r\n throw new Exception(\"fopen(\\\"$file\\\", \\\"$mode\\\") failed.\");\r\n }\r\n return $result;\r\n }", "public function create(array $config): FilesystemInterface;", "public function createFile()\n {\n if (!is_string($this->file) || !strlen($this->file)) {\n throw new \\RuntimeException(\"Cannot create file. Filename must be set to a non-empty string.\");\n }\n\n Cache::ensureWritable(dirname($this->file));\n\n // open with 'c+' (to create if missing, but not truncate if existing)\n $this->handle = @fopen($this->file, 'c+');\n if ($this->handle === false) {\n throw new \\RuntimeException(\"Unable to create file ('\" . $this->file . \"').\");\n }\n\n // if anything goes wrong past this point, make sure we close/unlock our file\n try {\n // write lock to ensure no one else reads/writes until we are done\n $locked = flock($this->handle, LOCK_EX);\n if ($locked === false) {\n throw new \\RuntimeException(\"Unable to lock file ('\" . $file . \"') for writing.\");\n }\n\n // now that we have acquired a write lock, we want to verify that the\n // file is empty or invalid - if we're indexing, we only validate the\n // index file (handled by our index instance), if we're not indexing\n // (or we are ourselves the index instance) we validate $this->file\n if ($this->index) {\n $this->index->createFile();\n } elseif (unserialize(file_get_contents($this->file)) !== false) {\n throw new \\RuntimeException(\"Unable to create file ('\" . $this->file . \"'). File has valid content.\");\n }\n\n // prime file for array entries - we don't know how many entries there are\n // so we write a zero-padded length for now and update it on close.\n // we ftrunctate in case the file already exists, but has bad content\n ftruncate($this->handle, 0);\n fwrite($this->handle, 'a:0000000000:{');\n } catch (\\Exception $e) {\n $this->closeFile();\n throw $e;\n }\n\n // if we get this far we are committed to writing the file\n // we need a flag for this so we can safely touch-up in close\n $this->writing = true;\n\n return $this;\n }", "private function resolveFile($type)\n {\n if ($type == 'd') {\n return new Directory;\n } else {\n return new File;\n }\n }", "function openDirectory(){\n if (!file_exists(\"./data\")){ # If file doesn't exist return false\n $handleDir = false;\n return $handleDir;\n }\n else{\n $handleDir = opendir(\"./data\");\n /* I'm checking if the handleDir == returns false for some other reason in connection.php. This is part of validation.php,\n which allows me to present an error message above the form (nb if opendir can't connect it returns a boolean value of false) */\n return $handleDir;\n }\n}", "function create($path = '', $mode = 0755) \n {\n \n // Initialize variables\n static $nested = 0;\n \n // Check to make sure the path valid and clean\n $path = $this->_fs->path()->clean($path);\n\n // Check if parent dir exists\n $parent = dirname($path);\n \n if (!$this->exists($parent)) {\n // Prevent infinite loops!\n $nested++;\n if (($nested > 20) || ($parent == $path)) {\n $nested--;\n return VWP::raiseWarning(VText::_('Infinite loop detected'),get_class($this) . ':create',null,false); \n }\n\n // Create the parent directory\n $cr = $this->create($parent, $mode);\n if (VWP::isWarning($cr)) {\n $nested--;\n return $cr;\n }\n // OK, parent directory has been created\n $nested--;\n }\n\n // Check if dir already exists\n if ($this->exists($path)) {\n return true;\n }\n\n // Check for safe mode\n \n // We need to get and explode the open_basedir paths\n $obd = ini_get('open_basedir');\n\n // If open_basedir is set we need to get the open_basedir that the path is in\n if ($obd != null) {\n if (VPATH_ISWIN) {\n $obdSeparator = \";\";\n } else {\n $obdSeparator = \":\";\n }\n \n // Create the array of open_basedir paths\n $obdArray = explode($obdSeparator, $obd);\n $inBaseDir = false;\n // Iterate through open_basedir paths looking for a match\n foreach ($obdArray as $test) {\n $test = $this->_fs->path()->clean($test);\n if (strpos($path, $test) === 0) {\n $obdpath = $test;\n $inBaseDir = true;\n break;\n }\n }\n \n if ($inBaseDir == false) {\n // Return false because the path to be created is not in open_basedir\n return VWP::raiseWarning(VText::_('Path not in open_basedir paths'), get_class($this). \":create\",null,false);\n }\n }\n\n // First set umask\n $origmask = @umask(0);\n\n // Create the path\n if (!$ret = @mkdir($path, $mode)) {\n @umask($origmask);\n return VWP::raiseWarning(VText::_('Could not create directory' ) . ' Path: ' . $path,get_class($this) . ':create',null,false);\n }\n\n // Reset umask\n @umask($origmask);\t\t\n return $ret;\n }", "public function create_from_file($file);", "function open_dir($dir, $newdir) {\n\t\tif( file_exists( $dir ) && file_exists( $newdir ) ) {\n\t\t\t$open_dir = opendir( $dir );\n\t\t\twhile ( false !== ($file = readdir( $open_dir )) ) {\n\t\t\t\tif( $file != \".\" && $file != \"..\" ) {\n\t\t\t\t\tif( @filetype( $dir . \"/\" . $file . \"/\" ) == \"dir\" ) {\n\t\t\t\t\t\tif( ! file_exists( $newdir . \"/\" . $file . \"/\" ) ) {\n\t\t\t\t\t\t\tmkdir( $newdir . \"/\" . $file . \"/\" );\n\t\t\t\t\t\t\t@chmod( $newdir . \"/\" . $file, 0777 );\n\t\t\t\t\t\t\topen_dir( $dir . \"/\" . $file . \"/\", $newdir . \"/\" . $file . \"/\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcopy( $dir . \"/\" . $file, $newdir . \"/\" . $file );\n\t\t\t\t\t\t@chmod( $newdir . \"/\" . $file, 0666 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function createDir()\n {\n if ($this->dirCreated) {\n return;\n }\n\n $dir = $this->getDirFromStream($this->url);\n if (null !== $dir && !is_dir($dir)) {\n $this->errorMessage = null;\n set_error_handler(array($this, 'customErrorHandler'));\n $status = mkdir($dir, 0777, true);\n restore_error_handler();\n if (false === $status) {\n throw new \\UnexpectedValueException(sprintf('There is no existing directory at \"%s\" and its not buildable: '.$this->errorMessage, $dir));\n }\n }\n $this->dirCreated = true;\n }", "function create($file)\n\t{\n\t\t$this->zip = new ZipArchive;\n\t\t$this->isOpen = ($this->zip->open($file, ZIPARCHIVE::CREATE) === true);\n\t\t$this->file = $file;\n\t\treturn $this->isOpen;\n\t}", "private function getFileHandler() {\n $mode = $this->replace ? \"w+\" : \"a+\";\n return fopen($this->pathFilename(), $mode);\n }", "public static function dirExists($file, $create = true, $recursive = true, $mode = 0777)\n {\n return is_dir($file) or ($create and mkdir($file, $mode, $recursive));\n }", "protected function createDirectory($path)\n {\n $filesystem = App::make('files');\n if (!$filesystem->isDirectory($path)) {\n $this->comment(\"Creating directory: \".$path);\n $filesystem->makeDirectory($path, 0777, true);\n return $filesystem;\n }\n return $filesystem;\n }", "public function create($path)\n {\n return $this->fs->cloud()->createDir($path);\n }", "protected function openFile() {}", "public function createFromRealDirectory($realPath);", "private function createFile()\n {\n $payload = json_decode(file_get_contents('php://input'));\n if (!isset($payload)) {\n $this->info = 'No input data';\n return false;\n }\n $fileName = strtolower($payload->path) . CONTENT_EXT;\n if (file_exists(CONTENT_DIR . $fileName)) {\n $this->info = 'File exist';\n return false;\n }\n if (\n strlen($fileName) > strlen(CONTENT_EXT) &&\n file_put_contents(CONTENT_DIR . $fileName, $payload->content)\n ) {\n return true;\n }\n return false;\n }", "function MakeDir()\n{\t\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$bIsDirectoryCreate = false;\n\t$bIsDirectoryCreate = mkdir($sFileUrl, 0777, true);\n\t\n\tif($bIsDirectoryCreate === true)\n\t{\n\t\techo '<correct>correct create directory</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create directory</fail>';\n\t}\n}", "private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}", "function makeDIR($directory,$debugtxt=0,$nMode) {\n // Create payload directory if it doesn't exist:\n if (file_exists($directory)) {\n //if ($debugtxt) { echo \"<p>Directory <b>$directory</b> already exists </p>\"; }\n $result = true; // Return true as success is when the directory has either been created or already exists\n } else {\n // Make the new temp sub_folder for unzipped files\n if (!mkdir($directory, $nMode, true)) {\n if ($debugtxt) { \n echo \"<p>Error: Could not create folder <b>$directory</b> - check file permissions\";\n echo '<div class=\"admin_img\"><a href=\"'.$sSiteUrl.'/admin\" class=\"btn btn-lg btn-primary color-white\">Admin</a></div><div class=\"play_img\"><a href=\"'.$sSiteUrl.'/play\" class=\"btn btn-lg btn-primary color-white\">Play</a></div>';\n }\n $result= false;\n } else { \n //if ($debugtxt) { echo \"Folder <b>$directory</b> Created <br>\";} \n $result = true;\n } // END mkdir\n } // END if file exists\n return $result;\n }", "function create($file = null) {\n $file = (isset($this->_file) && !$file) ? $this->_file : $file;\n \n \tif (!Fire_File_Helper::exists($file)) {\n $io = new Fire_File_IO_Helper($file);\n $io->open('w+');\n $io->close();\n } else {\n Fire_Error::throwError(sprintf('File \"%s\" already exists.',\n $file\n ), __FILE__, __LINE__\n );\n }\n \n }", "public function createFile($path,$data) {\n\n $parent = $this->getNodeForPath(dirname($path));\n return $parent->createFile(basename($path),$data);\n\n }", "protected function checkDirectory()\n {\n $directoryPath = $this\n ->directory\n ->getDirectoryPath();\n\n if (!is_dir($directoryPath)) {\n\n mkdir($directoryPath);\n }\n\n return $this;\n }", "public static function temp(): Directory\n {\n $resource = tmpfile();\n $path = stream_get_meta_data($resource)['uri'];\n\n return new static(dirname($path));\n }", "private function check_directory($path) {\n\t\tif (!@opendir($path)) {\n\t\t\tmkdir($path, 0755);\n\t\t} //if(!@opendir($path))\n\t\treturn;\n\t}", "static public function create($directory, $mode=0777)\n\t{\n\t\tif (empty($directory)) {\n\t\t\tthrow new fValidationException('No directory name was specified');\n\t\t}\n\t\t\n\t\tif (file_exists($directory)) {\n\t\t\tthrow new fValidationException(\n\t\t\t\t'The directory specified, %s, already exists',\n\t\t\t\t$directory\n\t\t\t);\n\t\t}\n\t\t\n\t\t$parent_directory = fFilesystem::getPathInfo($directory, 'dirname');\n\t\tif (!file_exists($parent_directory)) {\n\t\t\tfDirectory::create($parent_directory, $mode);\n\t\t}\n\t\t\n\t\tif (!is_writable($parent_directory)) {\n\t\t\tthrow new fEnvironmentException(\n\t\t\t\t'The directory specified, %s, is inside of a directory that is not writable',\n\t\t\t\t$directory\n\t\t\t);\n\t\t}\n\t\t\n\t\tmkdir($directory, $mode);\n\t\t\n\t\t$directory = new fDirectory($directory);\n\t\t\n\t\tfFilesystem::recordCreate($directory);\n\t\t\n\t\treturn $directory;\n\t}", "function mdl_create_directory_if_not_exists(string $dirname)\n{\n // Create the path directory if not exists\n if (!is_dir($dirname)) {\n mkdir($dirname, 0777, true);\n }\n}", "function smarty_core_create_dir_structure($params, &$smarty)\n{\n if (!file_exists($params['dir'])) {\n $_open_basedir_ini = ini_get('open_basedir');\n\n if (DIRECTORY_SEPARATOR=='/') {\n /* unix-style paths */\n $_dir = $params['dir'];\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(':', $_open_basedir_ini);\n }\n\n } else {\n /* other-style paths */\n $_dir = str_replace('\\\\','/', $params['dir']);\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {\n /* leading \"//\" for network volume, or \"[letter]:/\" for full path */\n $_new_dir = $_root_dir[1];\n /* remove drive-letter from _dir_parts */\n if (isset($_root_dir[3])) array_shift($_dir_parts);\n\n } else {\n $_new_dir = str_replace('\\\\', '/', getcwd()).'/';\n\n }\n\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(';', str_replace('\\\\', '/', $_open_basedir_ini));\n }\n\n }\n\n /* all paths use \"/\" only from here */\n foreach ($_dir_parts as $_dir_part) {\n $_new_dir .= $_dir_part;\n\n if ($_use_open_basedir) {\n // do not attempt to test or make directories outside of open_basedir\n $_make_new_dir = false;\n foreach ($_open_basedirs as $_open_basedir) {\n if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {\n $_make_new_dir = true;\n break;\n }\n }\n } else {\n $_make_new_dir = true;\n }\n\n if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {\n $smarty->trigger_error(\"problem creating directory '\" . $_new_dir . \"'\");\n return false;\n }\n $_new_dir .= '/';\n }\n }\n}", "function file_create($route) {\n\tif (!file_exists($route)) {\n\t\t$file = fopen($route, 'x');\n\t\tfclose($file);\n\t}\n}", "public function createFile($file){\n \t\ttry{\n\t \t\t$f=fopen($file,'w'); \n\t \t\t\n\t \t\tfclose($f);\n\t \t\tif(!file_exists($file)) {\n\t \t\t\t$this->log(\"UNBXD_MODULE:Couldn't create the file\");\n\t \t\t\treturn false;\n\t \t\t}\n\t \t\t$this->log(\"UNBXD_MODULE: created the file\");\n\t \t\treturn true;\n \t\t} catch (Exception $ex) {\n\t \t$this->log(\"UNBXD_MODULE:Error while creating the file\");\n\t \t$this->log($ex->getMessage());\n\t \treturn false;\n\t }\n \t}", "function getOrCreateUploadDirectory() {\r\n\t\t$structure = func_get_args();\r\n\t\t// Constructing the whole structure, starting at files/\r\n\t\t$fullPath = 'files/';\r\n\t\t$tmpUmask = umask(0); // Little trick to correctly set the chmod\r\n\t\tforeach($structure as $path) {\r\n\t\t\t// Don't allow for suspicious structure\r\n\t\t\tif ($path=='..') return false;\r\n\r\n\t\t\t// Creating directory if not existing\r\n\t\t\t$fullPath.=$path.'/';\r\n\t\t\tif (!file_exists(WWW_ROOT.$fullPath) && !mkdir(WWW_ROOT.$fullPath, 0777)) {\r\n\t\t\t\tumask($tmpUmask);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tumask($tmpUmask);\r\n\t\treturn $fullPath;\r\n\t}", "function ensure_directory_writable($path, $base_path = '') {\n $result = false;\n if ($base_path != '') {\n $base_path = rtrim($base_path, '/').'/';\n $path = trim(substr($path, count($base_path) -1), '/');\n }\n if (file_exists($base_path.$path)) {\n $result = is_dir($base_path.$path) && is_writable($base_path.$path);\n } else {\n $result = true;\n $path_item = $base_path;\n foreach (explode('/', $path) as $item) {\n $path_item .= $item.'/';\n if (!file_exists($path_item)) {\n $result = mkdir($path_item);\n // if (!$result) debug('path_item', $path_item);\n } else {\n $result = is_dir($path_item);\n }\n if (!$result) {\n break;\n }\n }\n $result &= is_writable($base_path.$path);\n }\n return $result;\n}", "function CreateAndCheckConnFile($fileName) {\n\n global $SUB_DIRECTORY;\n\n if (file_exists($fileName)){\n $newFile = @fopen($fileName, 'a');\n if($newFile)\n fclose($newFile);\n else\n echo \"<b>Error</b>: Failed to open ($fileName) file: Permission denied.\";\n \n }\n else{\n if(!is_dir($SUB_DIRECTORY)){\n mkdir($SUB_DIRECTORY);\n }\n $newFile = @fopen($fileName, 'w');\n if($newFile){\n fwrite($newFile, \"<?php echo 'Devart HTTP tunnel temporary file.'; exit; ?>\\r\\n\"); // forbid viewing this file through browser\n fclose($newFile);\n }\n else\n echo \"<b>Error</b>: Failed to create ($fileName) file: Permission denied.\";\n }\n \n if(!$newFile)\n exit;\n}", "public static function openFile($path)\n {\n if (is_readable($path)) {\n $f = fopen($path, 'rb');\n if ($f !== false) {\n return new static($f);\n }\n }\n\n return null;\n }", "protected function canFileBeCreated() {}", "protected function checkFilesDir() {\n\t\t$perms = @fileperms(self::FILES_DIR);\n\t\t/* create if not exist */\n\t\tif ($perms === false) {\n\t\t\tif (!mkdir(self::FILES_DIR, 0700, true)) {\n\t\t\t\tthrow new QuicksandException(\"Cannot create files dir.\");\n\t\t\t}\n\t\t}\n\t\t/* check if dir */\n\t\telse if (($perms & 0x4000) != 0x4000) {\n\t\t\tthrow new QuicksandException(\"Files dir is not actually a directory.\");\n\t\t}\n\t\t/* check permissions */\n\t\telse if (($perms & 0700) != 0700) {\n\t\t\tthrow new QuicksandException(\"Missing permissions. Make sure this script can read, write and enter the files dir.\");\n\t\t}\n\t}", "function check_dir_exists($dir,$create=false) {\n\n global $CFG; \n\n $status = true;\n if(!is_dir($dir)) {\n if (!$create) {\n $status = false;\n } else {\n umask(0000);\n $status = mkdir ($dir,$CFG->directorypermissions);\n }\n }\n return $status;\n }", "protected function getFileFactory() {}", "public function create($mode=0777, $flags=0)\n \t{\n \t\tif ($this->exists()) {\n \t\t\tif ($flags & Fs::PRESERVE) return;\n \t\t\tthrow new Fs_Exception(\"Unable to create directory '{$this->_path}': File already exists\");\n \t\t}\n \t\t\n \t\t$path = (string)$this->realpath();\n \t\tif (!@mkdir($path, $mode, $flags & Fs::RECURSIVE)) throw new Fs_Exception(\"Failed to create directory '$path'\", error_get_last());\n \t\t$this->clearStatCache();\n \t}", "public function getFileDirectory();", "private function _determine_write_this()\n\t{\n\t\t// Not a directory and doesn't exist already...\n\t\tif (substr($this->_current['filename'], -1) !== '/' && !file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t{\n\t\t\t$this->_write_this = true;\n\t\t}\n\t\t// File exists... check if it is newer.\n\t\telseif (substr($this->_current['filename'], -1) !== '/')\n\t\t{\n\t\t\t$this->_write_this = $this->overwrite || filemtime($this->destination . '/' . $this->_current['filename']) < $this->_current['mtime'];\n\t\t}\n\t\t// Folder... create.\n\t\telseif ($this->destination !== null && !$this->single_file)\n\t\t{\n\t\t\t// Protect from accidental parent directory writing...\n\t\t\t$this->_current['filename'] = strtr($this->_current['filename'], array('../' => '', '/..' => ''));\n\n\t\t\tif (!file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t\t{\n\t\t\t\tmktree($this->destination . '/' . $this->_current['filename']);\n\t\t\t}\n\t\t\t$this->_write_this = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_write_this = false;\n\t\t}\n\t}", "public function mkDir($path);", "private function createTemporaryFileManager($mode = 'w+')\n {\n return new File($this->createTemporaryFile(), $mode);\n }", "public function createFile()\n {\n return $this->addExcludesNameEntry($this->files);\n }", "public static function createFile($path, $mode = null)\n {\n // init\n $mode = ($mode !== null) ? $mode : 'w';\n $filePath = self::normalizePath($path);\n $dirPath = dirname($filePath);\n \n if (!is_dir($dirPath)) self::createDirectory($dirPath);\n \n if (is_dir($dirPath) AND !is_file($filePath)) {\n $file = fopen($filePath, $mode);\n fclose($file);\n $s = chmod($filePath, 0777);\n }\n \n return is_file($filePath);\n }", "function check_directory($directory)\n{\n if (!Storage::exists($directory)) {\n Storage::makeDirectory($directory);\n }\n\n return $directory;\n}", "private function storeFile()\n {\n if (trim($this->path) == '') {\n throw new CacheException('no valid path is set!!');\n }\n if (!is_dir($this->path)) {\n $this->files->makeDirectory($this->path, $mode = 0777, true, true);\n }\n\n return $this->path.$this->file;\n }", "private function ensureDirectory() {\n\t\tif (!is_dir($this -> directory)) {\n\t\t\tif (!mkdir($this -> directory)) {\n\t\t\t\tthrow new LatexException('Could not create directory ' . $this -> directory);\n\t\t\t}\n\t\t}\n\t}", "function makeDir($directory, $doubleCheck = true, $useCache = true)\n\t{\n\t\t$success = @ftp_mkdir($this->connection, $directory);\n\t\tif ($success==true)\n\t\treturn $success;\n\t\t \n\t\tif ($doubleCheck==true)\n\t\t{\n\t\t\treturn $this->dirExists($directory, $useCache);\n\t\t}\n\t\telse\n\t\treturn false;\n\t}", "public function createDirectory()\n\t{\n\t\tif(is_dir($this->storagePath) and is_writable($this->storagePath)===false)\n\t\t{\n\t\t\tchmod($this->storagePath,$this->permissions);\n\t\t}\n\t\t\n\t\tif(is_dir($this->storagePath) and is_writable($this->storagePath))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(!is_dir($this->storagePath) and $this->createDir===true and mkdir($this->storagePath,$this->permissions,true))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tthrow new \\RuntimeException(\"Cannot to create the storage path:\".$this->storagePath);\n\t}", "public function openFolder($fname, $create=false)\r\n\t{\r\n\t\t$folder = null; \r\n\r\n\t\tif ($this->id && $this->user)\r\n\t\t{\r\n\t\t\t$fid = null;\r\n\r\n\t\t\t$olist = new CAntObjectList($this->dbh, \"folder\", $this->user);\r\n\t\t\t$olist->addCondition(\"and\", \"parent_id\", \"is_equal\", $this->id);\r\n\t\t\t$olist->addCondition(\"and\", \"name\", \"is_equal\", $fname);\r\n\t\t\t$olist->getObjects(0, 1);\r\n\t\t\tif ($olist->getNumObjects())\r\n\t\t\t{\r\n\t\t\t\t$obj = $olist->getObjectMin(0);\r\n\t\t\t\t$fid = $obj['id'];\r\n\t\t\t}\r\n\r\n\t\t\t// If not found and we are not supposed to create the file\r\n\t\t\tif (!$fid && !$create)\r\n\t\t\t\treturn null;\r\n\r\n\t\t\t$folder = CAntObject::factory($this->dbh, \"folder\", $fid, $this->user);\r\n\t\t\t$folder->setValue(\"name\", $fname);\r\n\t\t\t$folder->setValue(\"parent_id\", $this->id);\r\n\t\t\tif ($folder->save() === false)\r\n\t\t\t\t$folder = null;\r\n\t\t}\r\n\r\n\t\treturn $folder;\r\n\t}", "public function create($handlerObj = NULL, $handlerMethod = NULL) {\n $this->fileService->createDirectory( $this->path, $handlerObj, $handlerMethod );\n }", "public function createDir()\n\t{\n\t\tif (!Core_File::isDir($this->_dir))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCore_File::mkdir($this->_dir, CHMOD, TRUE);\n\t\t\t} catch (Exception $e) {}\n\t\t}\n\n\t\treturn $this;\n\t}", "function ensure_writable_dir($dir)\n{\n\tif (is_dir(\"./\" . $dir))\n\t{\n\t\tif (check_writeable($dir))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (@makedir($dir))\n\t\t{\n\t\t\t// dir created\n\t\t\tif (check_writeable($dir))\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// dir not creatable\n\t\t\treturn 4;\n\t\t}\n\t}\n}", "public function new_file()\n {\n $input = JFactory::getApplication()->input;\n\n $ecr_project = $input->get('ecr_project');\n\n if($input->get('do_action') == 'new_file')\n {\n $reqPath = $input->getPath('act_path');\n $reqName = $input->getPath('act_name');\n\n $path = JPath::clean(JPATH_ROOT.DS.$reqPath.DS.$reqName);\n\n if(is_dir($path))\n {\n EcrHtml::message(array(jgettext('This is a folder'), $path), 'error');\n\n return;\n }\n\n if(is_file($path))\n {\n EcrHtml::message(array(jgettext('The file already exists'), $path), 'error');\n\n return;\n }\n\n //-- @todo file from template\n $template = 'new file';\n\n if( ! is_int(file_put_contents($path, $template)))\n {\n EcrHtml::message(array(jgettext('Unable to create file'), $path), 'error');\n\n return;\n }\n\n //-- Clean the cache\n JFactory::getCache('EasyCreator_'.$ecr_project)->clean();\n\n echo '*OK*';\n\n return;\n }\n\n $this->actForm(jgettext('New file'), 'add', jgettext('Create'));\n $this->processForm('new_file', $ecr_project, 'file', 'new', true, true);\n }", "public function test_create_exists()\n {\n Directory::create(ROOT.DS.'application');\n }", "public function openFile() {\n $this->file = fopen($this->_dir . $this->_filename,\"r\");\n }", "public function newFile($dir,$name,$type){\n\t\tif(!$this->connected){\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->apiCall('new',array('dir'=>$dir,'name'=>$name,'type'=>$type),true);\n\t}", "public function makeFolder()\n\t{\n\t\t$dir = new Folder($this->fileDir);\n\t\tif($dir->pwd() == null){\n\t\t\treturn new Folder($this->fileDir,true,0755);\n\t\t}\n\t}", "public function createFile($file_name, $directory, $file_content) {\n if (!file_exists($directory)) {\n mkdir($directory, 0777, true);\n }\n $myfile = fopen(\"{$directory}/{$file_name}\", \"w\") or die(\"Unable to make model!\");\n fwrite($myfile, $file_content);\n fclose($myfile);\n return true;\n }", "private function _write_this_file()\n\t{\n\t\t$this->_skip = false;\n\t\t$this->_found = false;\n\n\t\t// A directory may need to be created\n\t\tif (strpos($this->_current['filename'], '/') !== false && !$this->single_file)\n\t\t{\n\t\t\tmktree($this->destination . '/' . dirname($this->_current['filename']));\n\t\t}\n\n\t\t// Is this the file we're looking for?\n\t\tif ($this->single_file && ($this->destination === $this->_current['filename'] || $this->destination === '*/' . basename($this->_current['filename'])))\n\t\t{\n\t\t\t$this->_found = $this->_current['data'];\n\t\t}\n\t\t// If we're looking for another file, keep going.\n\t\telseif ($this->single_file)\n\t\t{\n\t\t\t$this->_skip = true;\n\t\t}\n\t\t// Looking for restricted files?\n\t\telseif ($this->files_to_extract !== null && !in_array($this->_current['filename'], $this->files_to_extract))\n\t\t{\n\t\t\t$this->_skip = true;\n\t\t}\n\n\t\t// Write it out then\n\t\tif ($this->_check_header_crc() && !$this->_skip && $this->_found === false)\n\t\t{\n\t\t\tpackage_put_contents($this->destination . '/' . $this->_current['filename'], $this->_current['data']);\n\t\t}\n\t}", "public function testMakeDirectory()\n {\n $this->assertTrue(Storage::mkdir(self::$temp.DS.'created'));\n $this->assertTrue(is_dir(self::$temp.DS.'created'));\n }", "public function createFile($path)\n {\n touch($path);\n if (!file_exists($path)) {\n $this->error(\"Could not create file: $path\");\n return false;\n }\n if ($this->isWindows()) {\n return true;\n }\n if (!empty($this->config['default_permissions']['file_mode'])) {\n chmod($path, $this->config['default_permissions']['file_mode']);\n }\n if (!empty($this->config['default_permissions']['user'])) {\n chown($path, $this->config['default_permissions']['user']);\n }\n if (!empty($this->config['default_permissions']['group'])) {\n chgrp($path, $this->config['default_permissions']['group']);\n }\n return true;\n }", "public function open($path, $id)\n {\n $file = (string) $path . '/' . $id;\n\n $this->path = (string) $path;\n\n is_dir($path) || mkdir($path, 777);\n\n file_exists($file) || touch($file);\n\n return true;\n }", "private function make_path($path){\n\t\t\t// Test if path extist\n\t\t\tif(is_dir($path) || file_exists($path))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Create it\n\t\t\t\tmkdir($path, 0777, true);\n\t\t\t}\n\t}", "function crateFolder($path,$mode)\n\t{\n\t\tif(!is_dir($path))\n\t\t\t{\n\t\t\t\tif(!mkdir($path,$mode))\n\t\t\t\t\t{return false;}else{return true;}\n\t\t\t}\n\t\telse{return \"Found\";}\n\t}", "public function createPath( $path ) {\n\t\tif ( !file_exists($path) || !is_dir($path) ) {\n\t\t\tif ( !mkdir( $path, 0777, true ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}", "public static function existsOrCreatePath($path)\n\t{\n\t\tFile::exists($path) or File::makeDirectory($path);\n\t\treturn $path;\n\t}", "function __construct($filepath, $create = false, $chmod = 0777) {\n\t\t$this->path = $filepath;\n\n\t\tif ($this->exists() == false && $create == true) {\n\t\t\t$this->create($chmod);\n\t\t}\n\n\t\tif ($this->exists()) {\n\t\t\t$this->open();\n\t\t}\n\t}", "public function createDirectory(DirectoryInterface $directory, DirectoryInterface $parent): DirectoryInterface;", "private function check_directory()\n\t{\n\t\tif (!is_dir(Kohana::config($this->type.'.cache_folder')))\n\t\t\tmkdir(Kohana::config($this->type.'.cache_folder'));\n\t}", "public static function create_dir($dir_to_create)\n\t{\n\t\tif (mkdir($dir_to_create))\n\t\t{\n\t\t\tif (self::findServerOS() == 'LINUX')\n\t\t\t{\n\t\t\t\t$perms = self::unix_file_permissions($dir_to_create);\n\t\t\t\tif ( $perms != '0755') @chmod($dirPath, 0755);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthrow new Exception(\"Error creating directory '{$dir_to_create}'\");\n\n\t\t\treturn false;\n\t\t}\n\t}", "final function getFile();", "function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "protected function createDirectoryForTemporaryFiles(): void\n\t{\n\t\tif (! $this->filesystem->isDirectory(storage_path('tmp'))) {\n\t\t\t$this->filesystem->makeDirectory(storage_path('tmp'));\n\t\t}\n\t}", "private function createFile($file)\n\t{\n\t\t//exit;\n\n\t\t$extension = $file->guessExtension();\n\t\t$dir = $this->getUploadDir();\n\t\tif (!$extension) {\n\t\t\t$extension = 'bin';\n\t\t}\n\t\t$newName = $this->createRandCode() . '.' . $extension;\n\t\t$file->move($dir, $newName);\n\t\t/*\n\t\t * Создание и сохранение информации о файле\n\t\t */\n\t\t$File = new File();\n\t\t$File->setName($newName);\n\t\t$File->setType($file->getClientMimeType());\n\t\t$File->setSize($file->getClientSize());\n\t\treturn $File;\n\t}", "private function createFolder()\n {\n if (!file_exists($this->cacheDir)) {//if folder doesn't exist\n mkdir($this->cacheDir, 0755);//create folder\n }\n if (!file_exists($this->cacheFile)) {//if cache doesnt exist\n $file = fopen($this->cacheFile, 'w');\n fclose($file);\n } else {\n return true;\n } //return true if folder exists\n }", "public static function create(string $source): File {\n $file = new File();\n $file->init($source);\n return $file;\n }", "abstract public function createFile(FileData $fileData);", "protected function fileObj() {\n\t\t$fileObj = new Varien_Io_File ();\n\t\treturn $fileObj;\n\t}", "private function tempdir()\n {\n // create temp file\n $tempfile = tempnam(\n sys_get_temp_dir(),\n 'conversion'\n );\n\n // remove the file\n if (file_exists($tempfile)) {\n unlink($tempfile);\n }\n\n // create a directory with previous temp file name\n mkdir($tempfile);\n\n // check the folder has been created\n if (is_dir($tempfile)) {\n return $tempfile;\n }\n }", "public static function create($path = '', $mode = 0755)\r\n\t{\r\n\t\t$FTPOptions = JClientHelper::getCredentials('ftp');\r\n\t\tstatic $nested = 0;\r\n\r\n\t\t// Check to make sure the path valid and clean\r\n\t\t$pathObject = new JFilesystemWrapperPath;\r\n\t\t$path = $pathObject->clean($path);\r\n\r\n\t\t// Check if parent dir exists\r\n\t\t$parent = dirname($path);\r\n\r\n\t\tif (!self::exists($parent))\r\n\t\t{\r\n\t\t\t// Prevent infinite loops!\r\n\t\t\t$nested++;\r\n\r\n\t\t\tif (($nested > 20) || ($parent == $path))\r\n\t\t\t{\r\n\t\t\t\tJLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_LOOP'), JLog::WARNING, 'jerror');\r\n\t\t\t\t$nested--;\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Create the parent directory\r\n\t\t\tif (self::create($parent, $mode) !== true)\r\n\t\t\t{\r\n\t\t\t\t// JFolder::create throws an error\r\n\t\t\t\t$nested--;\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// OK, parent directory has been created\r\n\t\t\t$nested--;\r\n\t\t}\r\n\r\n\t\t// Check if dir already exists\r\n\t\tif (self::exists($path))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Check for safe mode\r\n\t\tif ($FTPOptions['enabled'] == 1)\r\n\t\t{\r\n\t\t\t// Connect the FTP client\r\n\t\t\t$ftp = JClientFtp::getInstance($FTPOptions['host'], $FTPOptions['port'], array(), $FTPOptions['user'], $FTPOptions['pass']);\r\n\r\n\t\t\t// Translate path to FTP path\r\n\t\t\t$path = $pathObject->clean(str_replace(JPATH_ROOT, $FTPOptions['root'], $path), '/');\r\n\t\t\t$ret = $ftp->mkdir($path);\r\n\t\t\t$ftp->chmod($path, $mode);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// We need to get and explode the open_basedir paths\r\n\t\t\t$obd = ini_get('open_basedir');\r\n\r\n\t\t\t// If open_basedir is set we need to get the open_basedir that the path is in\r\n\t\t\tif ($obd != null)\r\n\t\t\t{\r\n\t\t\t\tif (IS_WIN)\r\n\t\t\t\t{\r\n\t\t\t\t\t$obdSeparator = \";\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$obdSeparator = \":\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Create the array of open_basedir paths\r\n\t\t\t\t$obdArray = explode($obdSeparator, $obd);\r\n\t\t\t\t$inBaseDir = false;\r\n\r\n\t\t\t\t// Iterate through open_basedir paths looking for a match\r\n\t\t\t\tforeach ($obdArray as $test)\r\n\t\t\t\t{\r\n\t\t\t\t\t$test = $pathObject->clean($test);\r\n\r\n\t\t\t\t\tif (strpos($path, $test) === 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$inBaseDir = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($inBaseDir == false)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Return false for JFolder::create because the path to be created is not in open_basedir\r\n\t\t\t\t\tJLog::add(__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_FOLDER_PATH'), JLog::WARNING, 'jerror');\r\n\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// First set umask\r\n\t\t\t$origmask = @umask(0);\r\n\r\n\t\t\t// Create the path\r\n\t\t\tif (!$ret = @mkdir($path, $mode))\r\n\t\t\t{\r\n\t\t\t\t@umask($origmask);\r\n\t\t\t\tJLog::add(\r\n\t\t\t\t\t__METHOD__ . ': ' . JText::_('JLIB_FILESYSTEM_ERROR_COULD_NOT_CREATE_DIRECTORY') . 'Path: ' . $path, JLog::WARNING, 'jerror'\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t// Reset umask\r\n\t\t\t@umask($origmask);\r\n\t\t}\r\n\r\n\t\treturn $ret;\r\n\t}", "function create_dir($path, $make_writable = false) {\n if(mkdir($path)) {\n if($make_writable) {\n if(!chmod($path, 0777)) {\n return false;\n } // if\n } // if\n } else {\n return false;\n } // if\n \n return true;\n }", "public function getFile()\n {\n $challenge = $this->getHttpChallenge();\n if ($challenge !== false) {\n return new File($challenge->getToken(), $challenge->getToken() . '.' . $this->digest);\n }\n return false;\n }", "public function createFile(Request $request)\n {\n if( !$this->checkPermissions(['view-my-files']) ){ return $this->genResponse(401); };\n\n return $this->doCreateFile($request);\n }", "public static function createFile($filename)\n\t{\n\t\tif (!is_dir(dirname($filename))) {\n\t\t\tself::createFolder(dirname($filename));\n\t\t}\n\t\tif (file_exists($filename)) {\n\t\t\ttouch(time() . \".\" . $filename);\n\t\t\treturn;\n\t\t}\n\t\ttouch($filename);\n\t}", "public function createFile($directory, $filename, $content = '')\n {\n try {\n $this->checkDirectoryExists($directory);\n $this->validateFilename($filename);\n $this->canCreateFile($directory, $filename);\n // Add some content in order to avoid empty files being recognised as octet/stream files\n $date = new \\DateTime('now');\n if ($content == '') {\n $content = \"/*\\n * File created on \" . $date->format('F jS, Y') . \" at \" . $date->format('g:i a') . \"\\n */\\n\";\n }\n $this->safeCreateFile($directory . DIRECTORY_SEPARATOR . $filename, $content);\n } catch (\\Exception $exception) {\n return ['success' => false, 'error' => $exception->getMessage()];\n }\n return ['success' => true, 'content' => $content];\n }", "public function createFile( $path )\n {\n return touch( $path );\n }", "protected function makeUploadedFileByPath() {\n return (new UploadedFile($this->resource, basename($this->resource)));\n }", "public function readDirectory(Path $path): Directory;" ]
[ "0.6155667", "0.60799193", "0.5949634", "0.58423984", "0.5794429", "0.5779763", "0.5759584", "0.57259077", "0.57169217", "0.55665475", "0.5522985", "0.55155593", "0.5502272", "0.5480802", "0.5453434", "0.5452252", "0.54452354", "0.54277015", "0.54112834", "0.5402143", "0.53929937", "0.5372356", "0.53654253", "0.534418", "0.5335377", "0.5332843", "0.5305917", "0.5287175", "0.5269353", "0.5267996", "0.52652264", "0.52643687", "0.52566135", "0.5242726", "0.5242671", "0.5239122", "0.52338207", "0.5228644", "0.5223596", "0.5220688", "0.5216858", "0.5212124", "0.5195424", "0.5193682", "0.51885736", "0.51607805", "0.51604575", "0.51563907", "0.514964", "0.51481605", "0.513402", "0.513177", "0.51292396", "0.51226294", "0.51169336", "0.51136255", "0.51094794", "0.5106829", "0.5103099", "0.5103", "0.50981665", "0.5097547", "0.50617725", "0.50583947", "0.5056499", "0.505561", "0.50544417", "0.5053083", "0.5052503", "0.5044173", "0.5038904", "0.503359", "0.5029356", "0.5026607", "0.50245273", "0.5023129", "0.502277", "0.50169855", "0.50143415", "0.5005761", "0.49963015", "0.49926662", "0.49884492", "0.49836034", "0.49832198", "0.49800378", "0.49792144", "0.4973655", "0.49684975", "0.49670014", "0.49641833", "0.4961609", "0.49598482", "0.49553058", "0.49514577", "0.49427676", "0.49422356", "0.4935439", "0.49349543", "0.49233988" ]
0.6540006
0
Close the file object.
public function closeFile($file_object) { $file_object = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function closeFile() {\n fclose($this->file);\n }", "protected function closeFile() {\n if ($this->handle) {\n fclose($this->handle);\n\n $this->handle = null;\n }\n }", "public function closeFile(){\n if(is_resource($this->_filePointer) === true){\n fclose($this->_filePointer);\n }\n }", "public function close() {\r\n\t\tif ($this->opened) {\r\n\t\t\t$this->file->close();\r\n\t\t\t$this->opened = false;\r\n\t\t}\r\n\t}", "public function close()\n {\n fclose($this->resource);\n unset($this->file);\n }", "protected function closeFile() {}", "public function close()\n {\n // Free the file resource\n if ($this->fh)\n {\n fclose($this->fh);\n }\n }", "public function close()\n {\n fclose($this->_path);\n }", "public function fclose(): void {\n fclose($this->file);\n }", "protected function _closeFile() {}", "protected function _closeFile() {}", "public static function close()\n {\n self::$file = null;\n }", "public function Close()\n\t\t{\n\t\t\tif($this->file != NULL)\n\t\t\t\tfclose($this->file);\n\n\t\t\t$this->file = NULL;\n\t\t\t$this->descriptors = array();\n\t\t}", "public function close()\n {\n $this->fclose();\n }", "public function close()\n {\n fclose($this->resource);\n }", "protected function close() {\n fclose($this->handle);\n }", "public function close()\n {\n if (fclose($this->stream)) {\n $this->stream = null;\n }\n }", "public function close() {\n\t\tif ($this->fp) {\n\t\t\t@fclose($this->fp);\n\t\t\t$this->fp = null;\n\n\t\t\t// Import local temp file\n\t\t\tif ($this->mode === MOXMAN_Vfs_IFileStream::WRITE || $this->mode === MOXMAN_Vfs_IFileStream::APPEND) {\n\t\t\t\t$this->file->importFrom($this->localTempFilePath);\n\t\t\t}\n\t\t}\n\t}", "public function __destruct() {\n fclose($this->file);\n }", "public function __destruct()\n {\n fclose($this->fileHandle);\n }", "function __destruct() {\n fclose($this->file);\n }", "private function closeFile() {\n\t\treturn fclose($this->file);\n\t}", "function __destruct () {\n fclose($this->file);\n }", "public function close()\n {\n curl_close($this->ch);\n if ($this->file != null) {\n fclose($this->file);\n }\n }", "public function __destruct()\n {\n $this->closeFile();\n }", "public function __destruct()\n {\n if ($this->fileHandle !== false) {\n $this->close();\n }\n }", "public function close()\n {\n if (null !== $this->handle && \\is_resource($this->handle)) {\n fclose($this->handle);\n $this->handle = null;\n }\n }", "public function lclose() {\n fclose($this->fp);\n }", "public function lclose() {\n fclose($this->fp);\n }", "public function lclose() {\n\t\tfclose($this->fp);\n\t}", "public function lclose() {\n\t\tfclose($this->fp);\n\t}", "public function close() {\n\t\t$this->control = new FileControl( $this );\n\t}", "private function Close_Stream( )\r\n\t{\r\n\t\tfclose ( $this -> fileStream );\r\n\t\treturn;\r\n\t}", "private function lClose(): void\n {\n fclose($this->fp);\n }", "public function lclose() {\n if ($this->debug == 0 && is_resource($this->fp)) {\n fclose($this->fp);\n }\n }", "public function close()\n {\n if($this->fileHandle) closelog();\n }", "function file_close(&$file) {\n if (!fclose($file)) {\n error('Failed to close file ' . spy($file) . '.');\n }\n\n destroy($file);\n}", "private function close()\n {\n if ($this->stream) {\n $this->stream->close();\n }\n }", "private function closeFile( \\SplFileObject &$file ) {\n if( !$this->gzip && !$file->flock( LOCK_UN ) ) {\n $file = NULL;\n\n throw new \\Exception( 'Could not unlock file' );\n }\n\n $file = NULL;\n }", "public function close() {\n\t\tparent::close();\n\t\tif ($this->lockFileName == null) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\t// Close the lock file channel (Which will also free any locks)\n\t\t\t$this->lockFileChannel->close();\n\t\t} catch ( \\Exception $e ) {\n\t\t\t// Problems closing the stream. Punt.\n\t\t}\n\t\tself::$locks->remove( $this->lockFileName );\n\t\t\n\t\t// Unlink (delete) the lock file\n\t\t$f = new File( $this->lockFileName );\n\t\t$f->delete();\n\t\t\n\t\t$this->lockFileName = null;\n\t\t$this->lockFileChannel = null;\n\t}", "function close() {\n\t\tif ($this->f) {\n\t\t\treturn @fclose($this->f);\n\t\t}\n\t\treturn true;\n\t}", "function __destruct() {\n\t\t@fclose($this->fh);\n\t}", "public function close()\n {\n if (!empty($this->stream)) {\n fclose($this->stream);\n $this->detach();\n }\n }", "protected function closeStream()\n {\n gzclose($this->file);\n // Handle event with listener\n $this->listener->onEnd();\n }", "public function __destruct()\n {\n if ($this->fp) {\n fclose($this->fp); // Als het object niet meer nodig is, kan de file-pointer gesloten worden.\n }\n }", "public function close() {\n $this->stream->close();\n }", "public function close()\n {\n $this->_c->close();\n }", "public function __destruct(){\n \n fclose( $this->getFilePointer() );\n \n }", "function __destruct()\r\n\t{\r\n\t\tif ($this->readFile)\r\n\t\t\t@fclose($this->readFile);\r\n\t}", "public static function close() {}", "public function close() \n {\n fclose($this->_logf);\n unset($this->_logf);\n }", "public function close()\n {\n libxml_clear_errors();\n\n $this->reader->close();\n }", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function close();", "public function __destruct()\n {\n if ($this->handle) {\n fclose($this->handle);\n }\n }", "public function __destruct()\n {\n if ( $this->fd )\n {\n fclose( $this->fd );\n $this->fd = null;\n }\n }", "public function __destruct() {\n fclose($this->fileHandler);\n }", "public function close() {\n if($this->isOpen()) {\n closedir($this->getPointer());\n parent::close();\n }\n }", "public function close_csv() {\n fclose($this->file);\n }", "public function close()\n {\n if ($this->writer) {\n $this->writer->close();\n }\n\n $this->writer = null;\n }", "abstract public function close();", "abstract public function close();", "abstract public function close();", "abstract public function close();", "abstract public function close();", "function close()\n\t{\n\t\t$this->zip->close();\n\t}", "protected function end() {\n\t\tfclose($this->inputFileHandle);\n\t\tfclose($this->outputFileHandle);\n\t\tunlink($this->tempOutputFile);\n\t}", "public function __destruct()\n {\n if ($this->handle !== null) {\n \\fclose($this->handle);\n }\n }", "function __destruct(){\n\t\tfclose($this->fptr);\n\t}", "function __destruct()\r\n {\r\n if ($this->handle) {\r\n fclose($this->handle);\r\n }\r\n }", "public function close()\n {\n fclose($this->migration_file);\n $this->is_open = false;\n }", "public function __destruct()\n {\n $this->closeFiles();\n }", "public function close() {}", "public function close() {}", "public function close() {}", "public function close() {}", "public function close()\n {\n ps_close_image($this->document->resource, $this->id);\n call_user_func($this->dtor);\n\n $this->document = $this->dtor = null;\n }", "public function closedir() {\n fclose($this->handle);\n }", "public function import_close_file()\n\t{\n // phpcs:enable\n\t\tfclose($this->handle);\n\t\treturn 0;\n\t}", "public function __destruct()\n {\n if ($this->resource != null) fclose($this->resource);\n }" ]
[ "0.8404209", "0.832272", "0.81840813", "0.8165709", "0.81120735", "0.8062449", "0.80460984", "0.7954119", "0.78923094", "0.7759818", "0.7759818", "0.7650321", "0.7650029", "0.7541118", "0.7528586", "0.74780625", "0.7477603", "0.7434033", "0.74227095", "0.7313574", "0.72810024", "0.72320545", "0.72059405", "0.7183717", "0.7173409", "0.714899", "0.71308976", "0.7087635", "0.7087635", "0.7086635", "0.7086635", "0.7071853", "0.7068363", "0.69829655", "0.69663566", "0.6950141", "0.691551", "0.6854793", "0.6812954", "0.68110985", "0.68080634", "0.67679906", "0.676024", "0.67377084", "0.67308646", "0.6713083", "0.6691489", "0.66839916", "0.6662521", "0.6622369", "0.6622253", "0.66093284", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6603312", "0.6576762", "0.65604216", "0.6558939", "0.6558187", "0.65561604", "0.6543735", "0.6532647", "0.6532647", "0.6532647", "0.6532647", "0.6532647", "0.6494233", "0.6489929", "0.64712924", "0.6464474", "0.6450742", "0.6437792", "0.6431488", "0.6414473", "0.6414246", "0.6414246", "0.6414246", "0.6388957", "0.6364808", "0.63431394", "0.63412374" ]
0.7393602
19
Start logging current activity.
public function startLog($log_data, $log_path = null) { // specify file path and name $additional_path = null; $additional_name = null; if ($log_path !== null && is_array($log_path)) { $additional_path = implode('/', $log_path).'/'; $additional_name = implode('_', $log_path).'_'; } $this->file_path = './logs/'.$additional_path.date('Y/m/'); $this->file_name = 'log_'.$additional_name.date('Y_m_d').'.log'; // open the file $log_file = $this->openFile(); // get current (last) line $log_file->seek(PHP_INT_MAX); $this->file_line = $log_file->key() + 1; // write the log $time_of_day = gettimeofday(); $timestamp = date('Y-m-d H:i:s.',$time_of_day['sec']) . $time_of_day['usec']; $log_string = "\n\n".$timestamp.'|'.implode('|', $log_data); $log_file->fwrite($log_string); // close the file $this->closeFile($log_file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start() {\n if ($this->isLogging) {\n $this->tStart = gettimeofday();\n $this->tLast = $this->tStart;\n $this->log = \"<h1>Log: \" . $this->name . \"</h1>\\n<pre>Started: \" . gmdate(\"D, d M Y H:i:s T\", $this->tStart['sec']) . \"\\n &#916; Start ; &#916; Last ;\";\n\t\t\t$this->logLine(\"Start\");\n\t\t}\n }", "public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }", "protected function log()\n {\n\n $this->worker\n ->setInstance($this->instance);\n // If instance can be called\n if($this->worker->ping()) {\n $infos = $this->worker->getInfos();\n $createdAt = new \\DateTime();\n\n $log = $this->logManager->createNew();\n $log->setMemory($infos['Memory']['used_memory']);\n $log->setCpu($infos['CPU']['used_cpu_sys']);\n $log->setNbClients(sizeof($this->worker->getClients()));\n $log->setCreatedAt($createdAt);\n // Add log\n $this->instance->addLog($log);\n }\n }", "static public function enter(){\n\t\t$log=LogManager::singleton();\n\t\tdebug::debug(\"LogManager enter\");\n\t\t$log->logEnter();\n\t}", "public function log_activity() {\n\t\t$data = array();\n\t\t$data['page'] = current_url();\n\t\t$data['ip_address'] = $this->_ci->input->ip_address();\n\t\t$data['user_agent'] = $this->_ci->agent->agent_string(); \n\t\t$data['request_method'] = $this->_ci->input->server('REQUEST_METHOD');\n\t\t$data['request_params'] = serialize($this->_ci->input->get_post(NULL, TRUE)); \n\t\t$data['uri_string'] = $this->_ci->uri->uri_string();\n\t\t$data['created_at'] = date('Y-m-d h:i:s');\n\n\t\tif($this->verify_activity()) {\n\t\t\t// And write it to the database\n\t\t\t$this->_ci->db->insert('hooks', $data);\n\t\t}\n\t}", "private static function logging()\n {\n $files = ['Handler', 'Exception', 'Log'];\n $folder = static::$root.'Logging'.'/';\n\n self::call($files, $folder);\n }", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "protected function log() {\n }", "public function log() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n Yii::info(VarDumper::dump($this));\n $this->debugInternal($variables, $trace);\n }", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "public function log_activity() {\n \n \n $CI =& get_instance();\n $CI->load->library('audit_trail');\n // Start off with the session stuff we know\n $data = array();\n $data['user_id'] = $CI->session->userdata('user_id');\n \n // Next up, we want to know what page we're on, use the router class\n $data['section'] = $CI->router->class;\n $data['action'] = $CI->router->method;\n \n // Lastly, we need to know when this is happening\n $data['when'] = date('Y-m-d G:i:s');\n \n // We don't need it, but we'll log the URI just in case\n $data['uri'] = uri_string();\n $path = realpath(APPPATH);\n // And write it to the database\n if($CI->router->method!='checkPortal' && $CI->router->method!='getAttendanceUpdates' && $CI->router->method!='getAverageDailyAttendance'):\n $CI->audit_trail->lfile($path.'/modules/logs/'.$CI->session->userdata('user_id').'.txt');\n $CI->audit_trail->lwrite($CI->session->userdata('name').' access '.$CI->router->method.' through '. uri_string().'.' , 'TRACE');\n endif;\n }", "public static function logging()\n {\n }", "public function log()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n foreach (func_get_args() as $argument) {\n $output->dump($argument);\n }\n $output->close();\n }", "public function go()\n {\n $this->log->info(\"We have liftoff.\");\n }", "public function start() {\n\t\tif (!$this->isRunning()) {\n\t\t\t// start activity\n\t\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::RUNNING);\n\n\t\t\tif($this->runtimeContext)\n\t\t\t\t$this->workflowActivity->onStart($this->runtimeContext);\n\t\t}\n\n\t\t// activity is running, trigger onFlow event\n\t\tif($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "public function ual_activity_login() {\n\n\t\t// Prevent user ID returning as 0.\n\t\t$user_reset = apply_filters( 'determine_current_user', false );\n\n\t\twp_set_current_user( $user_reset );\n\n\t\t// Store user id.\n\t\t$user_id = get_current_user_id();\n\n\t\t// If we have the user id, continue.\n\t\tif ( ! empty( $user_id ) ) {\n\t\t\t// Get user data with id.\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Store a user name.\n\t\t\t$user_name = $user->display_name ? $user->display_name : $user->user_nicename;\n\n\t\t\t// Log this activity.\n\t\t\tdo_action( 'ual_log_action', $user->ID, $user_name . ' logged In', 'logged-in' );\n\t\t}\n\t}", "public function start() {\n\t\t$this->invoke(\"start\");\n\t}", "public function enableLogging()\n {\n global $log;\n if (! $this->logger)\n {\n // create a log channel\n $this->logger = new \\Monolog\\Logger('SQL');\n $this->logger->pushHandler($log);\n }\n }", "public static function start_logging(task_base $task) {\n global $CFG, $DB;\n\n if (!self::should_log()) {\n return;\n }\n\n // We register a shutdown handler to ensure that logs causing any failures are correctly disposed of.\n // Note: This must happen before the per-request directory is requested because the shutdown handler deletes the logfile.\n if (!self::$tasklogregistered) {\n \\core_shutdown_manager::register_function(function() {\n // These will only actually do anything if capturing is current active when the thread ended, which\n // constitutes a failure.\n \\core\\task\\logmanager::finalise_log(true);\n });\n\n // Create a brand new per-request directory basedir.\n get_request_storage_directory(true, true);\n\n self::$tasklogregistered = true;\n }\n\n if (self::is_current_output_buffer()) {\n // We cannot capture when we are already capturing.\n throw new \\coding_exception('Logging is already in progress for task \"' . get_class(self::$task) . '\". ' .\n 'Nested logging is not supported.');\n }\n\n // Store the initial data about the task and current state.\n self::$task = $task;\n self::$taskloginfo = (object) [\n 'dbread' => $DB->perf_get_reads(),\n 'dbwrite' => $DB->perf_get_writes(),\n 'timestart' => microtime(true),\n ];\n\n // For simplicity's sake we always store logs on disk and flush at the end.\n self::$logpath = make_request_directory() . DIRECTORY_SEPARATOR . \"task.log\";\n self::$fh = fopen(self::$logpath, 'w+');\n\n // Note the level of the current output buffer.\n // Note: You cannot use ob_get_level() as it will return `1` when the default output buffer is enabled.\n if ($obstatus = ob_get_status()) {\n self::$oblevel = $obstatus['level'];\n } else {\n self::$oblevel = null;\n }\n\n self::$outputloggedcontent = !empty($CFG->task_logtostdout);\n\n // Start capturing output.\n ob_start([\\core\\task\\logmanager::class, 'add_line'], self::CHUNKSIZE);\n }", "function upgrade_log_start() {\n global $CFG, $upgradeloghandle;\n\n if (!empty($_SESSION['upgraderunning'])) {\n return; // logging already started\n }\n\n @ignore_user_abort(true); // ignore if user stops or otherwise aborts page loading\n $_SESSION['upgraderunning'] = 1; // set upgrade indicator\n if (empty($CFG->dbsessions)) { // workaround for bug in adodb, db session can not be restarted\n session_write_close(); // from now on user can reload page - will be displayed warning\n }\n make_upload_directory('upgradelogs');\n ob_start('upgrade_log_callback', 2); // function for logging to disk; flush each line of text ASAP\n register_shutdown_function('upgrade_log_finish'); // in case somebody forgets to stop logging\n}", "public function start()\n {\n //Start pushing data\n }", "public function start() {\n\n // TODO: Maybe sometimes\n\n }", "public function begin () {\n $this->connection->begin();\n $this->update_current_user_activity();\n }", "function start()\n\t{\n\t\tif( ! $this->is_running ){\n\t\t\t$this->is_running = TRUE;\n\t\t\t$this->running_since = self::timeMillisecondsAsFloat();\n\t\t}\n\t}", "public function enableLogging() {\n $this->debug = true;\n }", "public function start()\n {\n $this->startTime = Carbon::now();\n }", "public function open()\n {\n $this->fileHandle = openlog($this->signature, LOG_ODELAY | LOG_PID, LOG_LOCAL0 );\n if ($this->fileHandle !== false && count($this->stack)) {\n $this->stackFlush();\n }\n }", "public function log($type = 'call-start')\n {\n API::post('ivr/log', array(\n 'type' => $type,\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start() {}", "public function start()\n {\n // For example you can check Auth\n }", "public function log_login()\n {\n if (!$this->config->get('log_logins')) {\n return;\n }\n\n $user_name = $this->get_user_name();\n $user_id = $this->get_user_id();\n\n if (!$user_id) {\n return;\n }\n\n self::write_log('userlogins',\n sprintf('Successful login for %s (ID: %d) from %s in session %s',\n $user_name, $user_id, self::remote_ip(), session_id()));\n }", "public function start()\n\t{\n\t\t// Get contoller and action names\n\t\t$this->getControllerName();\n\t\t$this->getActionName();\n\n\t\t// Set Names of executing class and action names\n\t\t$this->class_Name = ucfirst($this->controllerName);\n\t\t$this->action_Name = ucfirst($this->actionName);\n\n\t\t// Set globals variable\n\t\t$this->setGlobalsData();\n\n\t\t// Run action\n\t\t$this->getControllerAction();\n\t}", "public function setActivityLogging($status){\n $this->enableActivityLogging = (bool) $status;\n }", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "function start() {\n // Warns if binary logging is not active\n //$r = $this->q(\"show variables like 'log_bin'\");\n //if (@mysql_fetch_object($r)->Value != 'ON') {\n // Binary log should be used for better data reliability\n // see http://dev.mysql.com/doc/refman/5.0/fr/commit.html\n // and http://dev.mysql.com/doc/refman/5.0/fr/binary-log.html\n // and http://www.cyberciti.biz/faq/what-is-mysql-binary-log/\n //}\n // Manages nested transactions:\n // only issues a BEGIN statement for the first transaction\n if (self::$started_transactions_count < 1) {\n // Backups current autocommit state\n self::$autocommit_state_backup = $this->autocommit();\n // Sets autocommit state to false\n $this->autocommit(false);\n // Begin transaction\n $this->q('BEGIN');\n // Resets internal variables\n self::$started_transactions_count = 0;\n $this->last_insert_id = null;\n $this->results = array();\n $this->exceptions = array();\n }\n // Manages transactions counter\n self::$started_transactions_count++;\n }", "function execute() {\n\t\tif ( $this->getRequest()->getSwitch('o') ) {\n\t\t\tsystemLog::getInstance()->setWriter(\n\t\t\t\tnew systemLogWriterCli(\n\t\t\t\t\tnew systemLogFilter(\n\t\t\t\t\t\tsystemLogLevel::ALWAYS, systemLog::getInstance()->getLogLevel()\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function loggy_start($name = 'Measurement')\n {\n return Loggy::startMeasurement($name);\n }", "public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start()\n\t{\n\t\t$this->startTimer = microtime(TRUE);\n\t}", "protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }", "public function start()\n {\n $model = $this->getModel();\n $model->started_at = date('Y-m-d H:i:s');\n $model->save(false);}", "public function logs()\n {\n $this->_display('logs');\n }", "function _Log($activity, $always_log = false) {\n\t\t# Logging cache takes up a lot of room. It is off by default\n\t\t# But we always log errors, for example.\n\t\tif (defined('FRESHPORTS_LOG_CACHE_ACTIVITY') || $always_log) {\n\t\t\tsyslog(LOG_NOTICE, $activity);\n\t\t}\n\t}", "public function logResult() : void\n {\n $log = implode(' ', $this->logArray);\n $logger = new Logger('Results');\n $logger->pushHandler(new StreamHandler('file.log', Logger::DEBUG));\n $logger->addInfo($log);\n }", "public function start()\n {\n }", "public function start()\n {\n }", "public function start()\n {\n }", "public function firstlog()\n\t{\n\t\t$this->load->view('newlog');\n\t}", "public function start()\n {\n Console::startProgress(0,100);\n }", "public function enableRequestLog()\n {\n $this->loggingRequests = true;\n }", "function log()\n {\n }", "public function start()\n {\n // TODO: Implement start() method.\n }", "private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }", "public function start(): void {}", "public function log()\n\t{\n\t\treturn $this->currentLog;\n\t}", "public function start()\n {\n echo 'Start odometer.',\"\\n\";\n }", "private function logRequest() {\n\t\t//Uncomment or set 'error_log = syslog' to log to system default syslog location\n\t\topenlog(basename(__FILE__), LOG_NDELAY, LOG_LOCAL5);\n\t\tsyslog(LOG_NOTICE, get_class($this).\" \".$_SERVER['REMOTE_ADDR'].\" did $this->_method with request: \".$this->_request['rquest'].\"\\n\");\n\t\tcloselog;\n\t}", "public function start()\n {\n if ($this->argument('blacklist')) {\n $this->error(\"The blacklist argument hasn't been implemented yet. The command will put logs in every controller.\");\n }\n\n if ($this->confirm('This command will CHANGE your controllers.'.\"\\n\".'Are you sure you want to continue? [y|N]')) {\n $filesArray = $this->dirToArray($this->controllerBaseUrl);\n $this->loopFiles($filesArray);\n $this->info('Wrote log-lines to '.$this->controllerCount.' controllers.');\n }\n }", "public function info()\n {\n $this->appendLog('info', \\func_get_args());\n }", "protected function _logTraffic() {\n if ('testing' !== APPLICATION_ENV) {\n $lastRequest = $this->_client->getLastRequest();\n $lastResponse = $this->_client->getLastResponse();\n $filename = date('Y-m-d') . '-gofilex.log';\n $logMessage = \"\\n\";\n $logMessage .= '[REQUEST]' . \"\\n\";\n $logMessage .= $lastRequest . \"\\n\\n\";\n $logMessage .= '[RESPONSE]' . \"\\n\";\n $logMessage .= $lastResponse . \"\\n\\n\";\n\n $logger = Garp_Log::factory($filename);\n $logger->log($logMessage, Garp_Log::INFO);\n }\n }", "function logBegin($format)\n\t{\n\t\t// Log aktiv?\n\t\tif (!$this->m_enable)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t// Uhrzeit des Logeintrages\n\t\t$t = time();\n\t\t//m_clockBegin = clock();\n\t\t$ltm = localtime($t, 1);\n\t\t\n\t\t// Mit fuehrendem Zeitstring?\n\t\tif ($this->m_withTimestamp)\n\t\t{\t\n\t\t\t$timeString = sprintf(\"%02u:%02u:%02u\\t\", $ltm[\"tm_hour\"], $ltm[\"tm_min\"], $ltm[\"tm_sec\"]);\n\t\t}\n\t\t/*\n\t\t// Dateiname der Logdatei\n\t\t$fileName = sprintf($this->m_fileNameTemplate, \n\t\t\t$ltm[\"tm_year\"] % 100, $ltm[\"tm_mon\"] + 1, $ltm[\"tm_mday\"]);\n\t\t// Pruefen ob sich der Name geandert hat.\n\t\tif (strcmp($fileName, $this->m_fileName) != 0)\n\t\t{\n\t\t\t// Dateiname hat sich geaendert.\n\t\t\t$this->m_fileName = $fileName;\n\t\t\t$this->logCheck(); // Eventuell die aelteste Logdatei loeschen.\n\t\t}\n\t\t*/\n\t\t// Alle Argumente als Parameter aufbereiten\n\t\t$args = func_get_args();\n\t\t// Erstes Element ist Formatstring, diesen entfernen\n\t\tarray_shift($args);\n\t\t// Logzeile aufbauen und halten\n\t\t$this->m_row = vsprintf($timeString . $format, $args);\n\n\t\treturn 1;\n\t}", "public function logger(Varien_Event_Observer $observer)\n {\n $controller = $observer->getEvent()->getControllerAction();\n $request = $controller->getRequest();\n\n //Watchdog if off => RETURN;\n //We don't log this extension actions => RETURN;\n if ((Mage::helper('foggyline_watchdog')->isModuleEnabled() == false)\n || ($request->getControllerModule() == 'Foggyline_Watchdog_Adminhtml')\n ) {\n return;\n }\n\n //We are in admin area, but admin logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'adminhtml')\n && (Mage::helper('foggyline_watchdog')->isLogBackendActions() == false)\n ) {\n return;\n }\n\n //We are in frontend area, but frontend logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'frontend')\n && (Mage::helper('foggyline_watchdog')->isLogFrontendActions() == false)\n ) {\n return;\n }\n\n //If user login detected\n $user = Mage::getSingleton('admin/session')->getUser();\n\n //If customer login detected\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n $log = Mage::getModel('foggyline_watchdog/action');\n\n $log->setWebsiteId(Mage::app()->getWebsite()->getId());\n $log->setStoreId(Mage::app()->getStore()->getId());\n\n $log->setTriggeredAt(Mage::getModel('core/date')->timestamp(time()));\n\n if ($user && $user->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_USER);\n $log->setTriggeredById($user->getId());\n } elseif ($customer && $customer->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_CUSTOMER);\n $log->setTriggeredById($customer->getId());\n } else {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_GUEST);\n $log->setTriggeredById(null);\n }\n\n $log->setControllerModule($request->getControllerModule());\n $log->setFullActionName($request->getControllerModule());\n $log->setClientIp($request->getClientIp());\n $log->setControllerName($request->getControllerName());\n $log->setActionName($request->getActionName());\n $log->setControllerModule($request->getControllerModule());\n $log->setRequestMethod($request->getMethod());\n\n //We are in 'adminhtml' area and \"lbparams\" is ON\n if (Mage::getDesign()->getArea() == 'adminhtml'\n && Mage::helper('foggyline_watchdog')->isLogBackendActions()\n && Mage::helper('foggyline_watchdog')->isLogBackendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //We are in 'frontend' area and \"lfparams\" is ON\n if (Mage::getDesign()->getArea() == 'frontend'\n && Mage::helper('foggyline_watchdog')->isLogFrontendActions()\n && Mage::helper('foggyline_watchdog')->isLogFrontendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //In case of other areas, we don't log request params\n\n try {\n $log->save();\n } catch (Exception $e) {\n //If you cant save, die silently, not a big deal\n Mage::logException($e);\n }\n }", "function create_run_log() {\n\n\t\t$this->log = new Log();\n\t\t$this->log->set_workflow_id( $this->get_id() );\n\t\t$this->log->set_date( new DateTime() );\n\n\t\tif ( $this->is_tracking_enabled() ) {\n\t\t\t$this->log->set_tracking_enabled( true );\n\n\t\t\tif ( $this->is_conversion_tracking_enabled() ) {\n\t\t\t\t$this->log->set_conversion_tracking_enabled( true );\n\t\t\t}\n\t\t}\n\n\t\t$this->log->save();\n\t\t$this->log->store_data_layer( $this->data_layer() );\n\n\t\tdo_action( 'automatewoo_create_run_log', $this->log, $this );\n\t}", "public function start() {\n $this->getPidFile()->write($this->getPidManager()->getCurrent());\n $this->getIpc()->setVar('pid', $this->getPidManager()->getCurrent());\n $this->_run();\n }", "function start()\n {\n $this->startService();\n $this->startSession();\n }", "public function start()\n {\n // nop\n }", "public function start()\n {\n // Este módulo requiere a un usuario logueado\n $this -> setRequireUser( true );\n }", "function emDebug() {\n if ($this->getSystemSetting('enable-system-debug-logging') || ( !empty($_GET['pid']) && $this->getProjectSetting('enable-project-debug-logging'))) {\n $emLogger = \\ExternalModules\\ExternalModules::getModuleInstance('em_logger');\n $emLogger->emLog($this->PREFIX, func_get_args(), \"DEBUG\");\n }\n }", "public function recordJournalingStart();", "function ajan_core_record_activity() {\n\n\tif ( !is_user_logged_in() )\n\t\treturn false;\n\n\t$user_id = ajan_loggedin_user_id();\n\n\tif ( ajan_is_user_inactive( $user_id ) )\n\t\treturn false;\n\n\t$activity = ajan_get_user_last_activity( $user_id );\n\n\tif ( !is_numeric( $activity ) )\n\t\t$activity = strtotime( $activity );\n\n\t// Get current time\n\t$current_time = ajan_core_current_time();\n\n\t// Use this action to detect the very first activity for a given member\n\tif ( empty( $activity ) ) {\n\t\tdo_action( 'ajan_first_activity_for_member', $user_id );\n\t}\n\n\tif ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) {\n\t\tajan_update_user_last_activity( $user_id, $current_time );\n\t}\n}", "public static function start(): void {\n }", "public function start(): void;", "public function start()\n {\n $this->_timeStartInMicroSeconds = microtime(true);\n }", "function start_action() {\n\t\t$current_action = current_filter();\n\t\techo '<div class=\"ks-hook-wrap ' . $current_action . '_wrap\"><div class=\"ks-hook start ' . $current_action . '\" title=\"start ' . $current_action . '\">' . $current_action . '</div>';\n\t}", "function start()\n{\n global $STATE_FILE, $LOG_FILE;\n\n $start_time = time();\n \n // log the timer in STATE_FILE\n $fp = fopen($STATE_FILE, 'w');\n fwrite($fp, $start_time);\n fclose($fp);\n}", "public function run()\n {\n $data = [\n \t\t\t'Company-Updated',\n \t\t\t'Project-Updated',\n 'User-Updated'\n \t\t];\n\n foreach($data as $key => $value) {\n\t\t\tLog::create(['name'=>$value]);\n\t\t}\t\t\n }", "private function add_to_log($action) {\n if ($action) {\n $event = \\mod_simplecertificate\\event\\course_module_viewed::create(\n array(\n 'objectid' => $this->get_course_module()->instance,\n 'context' => $this->get_context(),\n 'other' => array('certificatecode' => $this->get_issue()->code)));\n $event->add_record_snapshot('course', $this->get_course());\n }\n\n if (!empty($event)) {\n $event->trigger();\n }\n }", "public function log_view() {\n \\filter_embedquestion\\event\\question_viewed::create(['context' => $this->embedlocation->context,\n 'objectid' => $this->current_question()->id])->trigger();\n }", "function pushCurrentTimeLog()\n\t{\n\t\tarray_push($this->Time_Log, $this->Current_TimeLog);\n\t\t$this->setCurrentTimeLog(NULL);\n\t}" ]
[ "0.7086521", "0.6382671", "0.6255514", "0.62346", "0.6180652", "0.6170296", "0.6146097", "0.6125242", "0.607057", "0.60679466", "0.60460776", "0.60316217", "0.6027603", "0.5867818", "0.5846256", "0.58232164", "0.5818103", "0.58176935", "0.58118844", "0.57783824", "0.5774136", "0.57577956", "0.5748682", "0.57461685", "0.5723803", "0.5717732", "0.57042354", "0.5685374", "0.5656601", "0.56527734", "0.56527734", "0.5652382", "0.5651918", "0.56516993", "0.56516993", "0.56516993", "0.56516993", "0.56516993", "0.56516993", "0.5630425", "0.5608206", "0.5584808", "0.557732", "0.5571052", "0.556011", "0.554856", "0.5544279", "0.55390155", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.551112", "0.55077386", "0.5499994", "0.5490546", "0.5473055", "0.54644495", "0.5459548", "0.5440824", "0.5440824", "0.5440824", "0.54334164", "0.54296535", "0.541994", "0.5382418", "0.5375895", "0.53743917", "0.5374356", "0.5371937", "0.5342383", "0.53350264", "0.53055865", "0.5304273", "0.5303212", "0.5281823", "0.5281755", "0.5280541", "0.5264945", "0.5251537", "0.5235867", "0.52292883", "0.5216825", "0.52159107", "0.5215877", "0.52136976", "0.5209262", "0.52062064", "0.5202204", "0.52011263", "0.51881504", "0.51723176", "0.5167546", "0.5155407" ]
0.0
-1
Add log to current activity.
public function addLog($log_data) { // open the file $log_file = $this->openFile(); // get current (last) line $log_file->seek($this->file_line); $this->file_line = $log_file->key() + 1; // write the log $time_of_day = gettimeofday(); $timestamp = date('Y-m-d H:i:s.',$time_of_day['sec']) . $time_of_day['usec']; $log_string = "\n".$timestamp.'|'.implode('|', $log_data); $log_file->fwrite($log_string); // close the file $this->closeFile($log_file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function add_log($log) {\n $this->log .= \" \" . $log;\n }", "public function addLog($data);", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "private function add_to_log($action) {\n if ($action) {\n $event = \\mod_simplecertificate\\event\\course_module_viewed::create(\n array(\n 'objectid' => $this->get_course_module()->instance,\n 'context' => $this->get_context(),\n 'other' => array('certificatecode' => $this->get_issue()->code)));\n $event->add_record_snapshot('course', $this->get_course());\n }\n\n if (!empty($event)) {\n $event->trigger();\n }\n }", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "public function log_activity() {\n\t\t$data = array();\n\t\t$data['page'] = current_url();\n\t\t$data['ip_address'] = $this->_ci->input->ip_address();\n\t\t$data['user_agent'] = $this->_ci->agent->agent_string(); \n\t\t$data['request_method'] = $this->_ci->input->server('REQUEST_METHOD');\n\t\t$data['request_params'] = serialize($this->_ci->input->get_post(NULL, TRUE)); \n\t\t$data['uri_string'] = $this->_ci->uri->uri_string();\n\t\t$data['created_at'] = date('Y-m-d h:i:s');\n\n\t\tif($this->verify_activity()) {\n\t\t\t// And write it to the database\n\t\t\t$this->_ci->db->insert('hooks', $data);\n\t\t}\n\t}", "function addToLog ($content){\n\t\t$file = fopen ('../../data/log.txt', 'a+');\n\n\t\tfwrite ($file, $content);\n\t\tfclose ($file);\n\t}", "function add_log_entry(log_op_move $entry) {\n array_unshift($this->log_op_list, $entry);\n }", "protected function log()\n {\n\n $this->worker\n ->setInstance($this->instance);\n // If instance can be called\n if($this->worker->ping()) {\n $infos = $this->worker->getInfos();\n $createdAt = new \\DateTime();\n\n $log = $this->logManager->createNew();\n $log->setMemory($infos['Memory']['used_memory']);\n $log->setCpu($infos['CPU']['used_cpu_sys']);\n $log->setNbClients(sizeof($this->worker->getClients()));\n $log->setCreatedAt($createdAt);\n // Add log\n $this->instance->addLog($log);\n }\n }", "public function withLog($entry);", "public function addEntry(\\Yana\\Db\\Ddl\\Logs\\AbstractLog $log)\n {\n array_unshift($this->changes, $log);\n }", "private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }", "public function log_activity() {\n \n \n $CI =& get_instance();\n $CI->load->library('audit_trail');\n // Start off with the session stuff we know\n $data = array();\n $data['user_id'] = $CI->session->userdata('user_id');\n \n // Next up, we want to know what page we're on, use the router class\n $data['section'] = $CI->router->class;\n $data['action'] = $CI->router->method;\n \n // Lastly, we need to know when this is happening\n $data['when'] = date('Y-m-d G:i:s');\n \n // We don't need it, but we'll log the URI just in case\n $data['uri'] = uri_string();\n $path = realpath(APPPATH);\n // And write it to the database\n if($CI->router->method!='checkPortal' && $CI->router->method!='getAttendanceUpdates' && $CI->router->method!='getAverageDailyAttendance'):\n $CI->audit_trail->lfile($path.'/modules/logs/'.$CI->session->userdata('user_id').'.txt');\n $CI->audit_trail->lwrite($CI->session->userdata('name').' access '.$CI->router->method.' through '. uri_string().'.' , 'TRACE');\n endif;\n }", "protected function addLog() {\n\t\t$oLog = PHP_Beautifier_Common::getLog();\n\t\t$oLogConsole = Log::factory('console', '', 'php_beautifier', array(\n\t\t\t\t'stream' => STDERR,\n\t\t\t), PEAR_LOG_DEBUG);\n\t\t$oLog->addChild($oLogConsole);\n\t}", "function rec($log_item)\n\t{\n\t\t$this->items[] = $log_item;\n\t}", "public function appendLog($message);", "protected function log() {\n }", "public function log($log) {\n //$this->log = $log;\n }", "function logActivity($inputData){\n\tif (!file_exists('./activityLog/'))\n\t\tmkdir('./activityLog/');\n\t$fileHandle = fopen('./activityLog/data.log','a');\n\tfputs($fileHandle , trim($inputData).\"\\n\" , 1024 );\n\tfclose($fileHandle);\n}", "private static function addLog($msg) {\n\t\tself::$log[] = '\"'.formatTimestamp(time()).' - '.$msg.'\"';\n\t}", "private function setupLog()\n {\n $path = JFactory::getConfig()->get('log_path');\n\n $fileName = 'ecr_log.php';\n $entry = '';\n\n if('preserve' == JFactory::getApplication()->input->get('logMode')\n && JFile::exists($path.'/'.$fileName)\n )\n {\n $entry = '----------------------------------------------';\n }\n else if(JFile::exists($path.'/'.$fileName))\n {\n JFile::delete($path.'/'.$fileName);\n }\n\n JLog::addLogger(\n array(\n 'text_file' => $fileName\n , 'text_entry_format' => '{DATETIME}\t{PRIORITY}\t{MESSAGE}'\n , 'text_file_no_php' => true\n )\n , JLog::INFO | JLog::ERROR\n );\n\n if('' != $entry)\n JLog::add($entry);\n\n return $this;\n }", "public function __invoke($param)\n {\n $this->addLog($param);\n }", "function pushCurrentTimeLog()\n\t{\n\t\tarray_push($this->Time_Log, $this->Current_TimeLog);\n\t\t$this->setCurrentTimeLog(NULL);\n\t}", "protected function append(LoggerLoggingEvent $event)\n {\n $this->processLog(\n $this->layout->format($event),\n $this->getFlushOnShutdown()\n );\n }", "public function append(LoggerLoggingEvent $event) {\r\n\t\t$eventDate = $this->getDate($event->getTimestamp());\r\n\t\t\r\n\t\t// Initial setting of current date\r\n\t\tif (!isset($this->currentDate)) {\r\n\t\t\t$this->currentDate = $eventDate;\r\n\t\t} \r\n\t\t\r\n\t\t// Check if rollover is needed\r\n\t\telse if ($this->currentDate !== $eventDate) {\r\n\t\t\t$this->currentDate = $eventDate;\r\n\t\t\t\r\n\t\t\t// Close the file if it's open.\r\n\t\t\t// Note: $this->close() is not called here because it would set\r\n\t\t\t// $this->closed to true and the appender would not recieve\r\n\t\t\t// any more logging requests\r\n\t\t\tif (is_resource($this->fp)) {\r\n\t\t\t\t$this->write($this->layout->getFooter());\r\n\t\t\t\tfclose($this->fp);\r\n\t\t\t}\r\n\t\t\t$this->fp = null;\r\n\t\t}\r\n\t\r\n\t\tparent::append($event);\r\n\t}", "public static function add_line(string $log) : string {\n if (empty(self::$taskloginfo)) {\n return $log;\n }\n\n if (empty(self::$fh)) {\n return $log;\n }\n\n if (self::is_current_output_buffer()) {\n fwrite(self::$fh, $log);\n }\n\n if (self::$outputloggedcontent) {\n return $log;\n } else {\n return '';\n }\n }", "public function log (string $msg) : void {\n\t\t$this->logs [] = $msg;\n\t}", "public function log() {\r\n\t\t$this->resource->log();\r\n\t}", "private function addToLog($txt){\n\n $this->db->insert('master_log',\n array(\n 'log_txt' => trim($txt),\n 'added' => 'NOW()'\n ));\n \n }", "public function registerActivity($model, string $message, string $log = 'default'): void\n {\n $user = auth()->user();\n activity($log)->performedOn($model)->causedBy($user)->log($message);\n }", "public function add($entry)\n {\n $this->log[] = $entry;\n while (\\count($this->log) > $this->size) {\n array_shift($this->log);\n }\n }", "function activity_log( $wp_comment_id = \"\", $lf_comment_id = \"\", $lf_activity_id = \"\" ) {\n update_comment_meta( $wp_comment_id, LF_CMETA_PREFIX . $lf_comment_id, $lf_comment_id );\n update_comment_meta( $wp_comment_id, LF_AMETA_PREFIX . $lf_activity_id, $lf_activity_id );\n return false;\n\n }", "function insert_log( $log_data = array() ) {\n\t\n\t\t/* Get Log From Rule ID */\t\t\n\t\t$logs_array = Inbound_Logging_Automation::get_logs( $log_data['rule_id'] );\n\t\t\n\t\t/* Push log to front of array */\n\t\t$logs_array[] = $log_data;\n\t\t\n\t\t/* Trim logs array to X entries */\n\t\tif ( count($logs_array) > self::$log_limit ) {\n\t\t\t$trim = count($logs_array) - self::$log_limit;\n\t\t\t$logs_array = array_slice($logs_array, $trim);\n\t\t}\n\t\t\n\t\t/* Update logs meta */\n\t\tupdate_post_meta( $log_data['rule_id'] , '_automation_logs' , json_encode($logs_array) );\n\n\t}", "public function log()\n {\n $this->fetchFields();\n Log::console($this);\n }", "protected function addLog($text, $pid = 0)\n {\n if ($pid === 0) {\n $pid = getmypid();\n }\n\n $log_text = sprintf('[%s] <%s> %s', date('Y-m-d H:i:s'), $pid, $text);\n $this->line($log_text);\n\n if (config('user.disable-logging')) {\n return;\n }\n\n $log_path = $this->logPath($pid);\n $file_handle = fopen($log_path, 'a+');\n\n fwrite($file_handle, $log_text.\"\\n\");\n fclose($file_handle);\n\n }", "public function enableLogging()\n {\n global $log;\n if (! $this->logger)\n {\n // create a log channel\n $this->logger = new \\Monolog\\Logger('SQL');\n $this->logger->pushHandler($log);\n }\n }", "public function logMessage(LogMessage $message) {\n if (!$this->isLoggable($message)) {\n return;\n }\n\n if ($this->useBuffer($message)) {\n $this->actionBuffer[] = $message;\n } else {\n $this->log($message);\n }\n }", "public function log() {\n // data we are going to log\n $variables = func_get_args();\n $trace = debug_backtrace(null, 1);\n Yii::info(VarDumper::dump($this));\n $this->debugInternal($variables, $trace);\n }", "function log($type, $log) {\n try {\n $fh = fopen($this->logFilePath, 'a');\n fwrite($fh, date($this->dateFormat) . \" - {$type} -> {$log}\" . PHP_EOL);\n fclose($fh);\n } catch(Exception $e) {\n $this->error($e->getMessage());\n }\n }", "public function add_log($message) {\n\t\t$log_option_name = $this->get_logger_option_name();\n\t\t$log_limit = $this->get_logger_limit();\n\t\t$log = $this->get_log();\n\t\t$log[] = $message;\n\t\twhile (count($log) > 0 && count($log) > $log_limit) {\n\t\t\tarray_shift($log);\n\t\t}\n\t\tupdate_option($log_option_name, $log);\n\t}", "function _Log($activity, $always_log = false) {\n\t\t# Logging cache takes up a lot of room. It is off by default\n\t\t# But we always log errors, for example.\n\t\tif (defined('FRESHPORTS_LOG_CACHE_ACTIVITY') || $always_log) {\n\t\t\tsyslog(LOG_NOTICE, $activity);\n\t\t}\n\t}", "public function log($log);", "public static function addTagToLog($name){\n\t\tself::$tag_log[] = $name;\n\t}", "protected function log( $log )\n {\n if( $this->getLogger() === null )\n return;\n\n $this->getLogger()->log( 'Clickatell: ' . $log, $this->getLogLevel() );\n }", "function write_log($log) {\n $orderLog = new Logger('order');\n $orderLog->pushHandler(new StreamHandler(storage_path('logs/frontend.log')), Logger::INFO);\n $orderLog->info('OrderLog', $log);\n}", "protected static function MergeLogs()\n {\n }", "protected function recordActivity($event)\n {\n $this->activity()->create([\n 'user_id' => auth()->id(),\n 'type' => $this->getActivityType($event),\n ]);\n }", "public function addLog ( $keys, $received, $sent, $base_string, $notes, $user_id = null ) { }", "protected function _write($event)\n {\n $this->logs[] = $event;\n }", "public static function log($request, $timestamp = 0, $move_head = false)\n {\n\n }", "function __log($alias, $action, $details, $foreign_key=null){\n if($this->__isLogRequired($action)) {\n $this->__UserLog->create();\n $this->__UserLog->data = array(\n 'user_id' => User::get('id'),\n 'resource' => $alias,\n 'resource_type' => 'model',\n 'action' => $action,\n 'foreign_key' => $foreign_key,\n 'details' => $this->__isLogDetailsRequired($alias,$action) ? $details : null\n );\n if(!$this->__deferred) {\n $this->__saveLog();\n }\n }\n }", "function create_run_log() {\n\n\t\t$this->log = new Log();\n\t\t$this->log->set_workflow_id( $this->get_id() );\n\t\t$this->log->set_date( new DateTime() );\n\n\t\tif ( $this->is_tracking_enabled() ) {\n\t\t\t$this->log->set_tracking_enabled( true );\n\n\t\t\tif ( $this->is_conversion_tracking_enabled() ) {\n\t\t\t\t$this->log->set_conversion_tracking_enabled( true );\n\t\t\t}\n\t\t}\n\n\t\t$this->log->save();\n\t\t$this->log->store_data_layer( $this->data_layer() );\n\n\t\tdo_action( 'automatewoo_create_run_log', $this->log, $this );\n\t}", "public function log($type = 'call-start')\n {\n API::post('ivr/log', array(\n 'type' => $type,\n 'caller' => $this->caller,\n 'called' => $this->called\n ), $this->app->getAccessToken());\n }", "protected function _log($message)\n {\n $this->_log->save(get_class($this), 'test', $message);\n }", "protected function logLine($logLine)\n\t{\n\t\tif (!MAKE_INSTALL_LOG || ($this->logFile == '')) return;\n\t\t$logfp = fopen($this->logFile, 'a+');\n\t\tfwrite($logfp, ($now = time()).', '.gmstrftime('%y-%m-%d %H:%M:%S',$now).' '.$logLine.\"\\n\");\n\t\tfclose($logfp);\n\t}", "function turnitintooltwo_add_to_log($courseid, $eventname, $link, $desc, $cmid, $userid = 0) {\n global $USER;\n\n $eventname = str_replace(' ', '_', $eventname);\n $eventpath = '\\mod_turnitintooltwo\\event\\\\'.$eventname;\n\n $data = array(\n 'objectid' => $cmid,\n 'context' => ( $cmid == 0 ) ? context_course::instance($courseid) : context_module::instance($cmid),\n 'other' => array('desc' => $desc)\n );\n if (!empty($userid) && ($userid != $USER->id)) {\n $data['relateduserid'] = $userid;\n }\n $event = $eventpath::create($data);\n $event->trigger();\n}", "function inbound_record_log( $title = '', $message = '', $rule_id = 0, $job_id = '', $type = null ) {\n\tglobal $inbound_automation_logs;\n\t$inbound_automation_logs->add( $title, $message, $rule_id, $job_id, $type );\n\n}", "public function log()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n foreach (func_get_args() as $argument) {\n $output->dump($argument);\n }\n $output->close();\n }", "function changeLogs() {\n\n }", "private function activityLog(array $data)\n {\n $default = [\n 'type' => 1,\n 'rel_route' => 'selfservice.operator.category.edit',\n 'section' => 'general.category',\n 'user_id' => 1,\n 'user_name' => 'John Doe',\n 'event_name' => 'item_created',\n 'ip' => inet_pton('81.8.12.192'),\n 'created_at' => time(),\n 'updated_at' => time()\n ];\n\n foreach ($data as $k => $row) {\n $data[$k] = $row + $default;\n }\n\n DB::table('activity_log')->insert($data);\n }", "public static function line($log_text) {\n\t\tif(\\Config::LOG_DEBUG) {\n\t\t\tself::$log[] = array(\"type\" => \"log\", \"value\" => $log_text);\n\t\t}\n\t}", "public function writeLog()\n {\n $redis = self::getClient();\n $redis ->lPush('admin_log',$this->data);\n }", "function ilog(){\r\n\t\tif($this->input['action'] != 'mylog'){\r\n\t\t\tif($this->vars['logSavePage'] == 1) $logSavePage = addslashes(serialize($this->page));\r\n\t\t\t// user log\r\n\t\t\t$this->DB->query(\"\r\n\t\t\t\tINSERT INTO `log` (`userid` , `title` , `area` , `module` , `action` , `id` , `ip` , `kinput` , `page` , `dateline`)\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'\".$this->user['userid'].\"', '\".$this->page['title'].\"', '\".$this->vars['area'].\"', '\".$this->input['module'].\"', '\".$this->input['action'].\"', '\".$this->iif($this->input[$this->input['module'].'id'] > 0, $this->input[$this->input['module'].'id'], 0).\"', '\".IP.\"', '\".serialize($this->input).\"', '\".$logSavePage.\"', '\".TIMENOW.\"'\r\n\t\t\t\t)\r\n\t\t\t\");\r\n\t\t}\r\n\t}", "function log_activity($description, $user_id = '')\n{\n\t$CI = &get_instance();\n\t$CI->load->model('activity_log_model', 'activity_log');\n\n\tif ($user_id == '')\n\t{\n\t\t$user_id = get_loggedin_info('user_id');\n\t}\n\n\t$data = array(\n\t\t'description' => $description,\n\t\t'date' => current_timestamp(),\n\t\t'user_id' => $user_id,\n\t\t'ip_address' => $CI->input->ip_address()\n\t);\n\n\t$CI->activity_log->insert($data);\n}", "public function writeLog(\\Log $log)\n {\n \n // similarly add other logger type classes to write \n // logs using different methods\n }", "function add2log($filename,$entry,$debug=true){\n $TimeStamp = date(\"Y-m-dTH:i:s+0000\");\n $entry .= \"\\n\";\n $FileHandle=fopen($filename, \"a\");\n\n if($FileHandle){\n fwrite($FileHandle, \"[ $TimeStamp ] \".$entry);\n fclose($FileHandle);\n\n //~ If debug is enable we also print some infos to the console\n if($debug){ echo($entry); }\n }\n}", "protected function recordActivity($event)\n {\n $this->activity()->create([\n //type => created_thread\n 'type' => $event . '_' . strtolower(class_basename($this)),\n 'user_id' => auth()->id()\n ]);\n }", "public function addLog($message)\n {\n if ($this->isLogEnabled()) {\n if (is_array($message)) {\n $message = print_r($message, true);\n }\n Mage::log($message, Zend_Log::DEBUG, 'cloudpayments.log', true);\n }\n return true;\n }", "function log()\n {\n }", "public function addActivity($data);", "private function updateLogs($log){\n\n\t\t// Open log file\n\t\t$this->loadLogs();\n\n\t\t// Append new log\n\t\t$this->logs[] = $log;\n\n\t\t// Push new contents on the file\n\t\treturn $this->pushLogs();\n\n\t}", "protected function addLog($asynctoLogMessage)\n\t{\n\t\t$this->arrLogMessages[] = $asynctoLogMessage;\n\t\tif($this->bPrintLogMessages && $asynctoLogMessage->getLevel() >= $this->bPrintLogMessagesThreshold)\n\t\t\tprint($asynctoLogMessage.\"\\n\");\n\t}", "protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }", "public static function log_save()\n {\n if (empty(self::$log) or self::$configuration['core']['log_threshold'] < 1) {\n return;\n }\n\n // Filename of the log\n $filename = self::log_directory().date('Y-m-d').'.log'.EXT;\n\n if (! is_file($filename)) {\n // Write the SYSPATH checking header\n file_put_contents($filename,\n '<?php defined(\\'SYSPATH\\') or die(\\'No direct script access.\\'); ?>'.PHP_EOL.PHP_EOL);\n\n // Prevent external writes\n chmod($filename, 0644);\n }\n\n // Messages to write\n $messages = array();\n\n do {\n // Load the next mess\n list($date, $type, $text) = array_shift(self::$log);\n\n // Add a new message line\n $messages[] = $date.' --- '.$type.': '.$text;\n } while (! empty(self::$log));\n\n // Write messages to log file\n file_put_contents($filename, implode(PHP_EOL, $messages).PHP_EOL, FILE_APPEND);\n }", "protected function log($data) {\n $time = date('Y-m-d h:i:s a', time());\n $line = $time.\" \".$data.PHP_EOL;\n echo $line;\n file_put_contents($this->_directories[\"communication.log\"], $line,FILE_APPEND);\n }", "function publishLog() {\n\t\t$id = $this->current_log;\t\t\n\t\t$res = $this->query(\"SELECT event_id FROM $this->table_log WHERE id=$id\");\n\t\t$row = $res->fetch_assoc();\n\t\t$cal_id = explode(\",\",$row['event_id']);\n\t\t$calEvent = $this->calendar_instance->getEventDetails($row['event_id']);\n\t\t$topic = $calEvent['caption'];\n\t\t$year = $calEvent['year'];\n\t\t$slug = $calEvent['slug'];\n\t\t$url = $this->generateCoolURL(\"/$year/$slug\");\n\t\t$this->addToActivityLog(\"publiserte logg fra <a href=\\\"$url\\\">$topic</a>.\",false,\"major\");\n\t}", "public function log($message): void\n\t{\n\t\t$defaults = [\n\t\t\t'SEVERITY' => 'INFO',\n\t\t\t'AUDIT_TYPE_ID' => $this->auditTypeId,\n\t\t\t'ITEM_ID' => $this->itemId ?: '',\n\t\t];\n\n\t\t$message = $this->logMessToArray($message);\n\n\t\tCEventLog::Add(array_merge($defaults, $message, ['MODULE_ID' => $this->moduleId]));\n\t}", "public function add() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->ActivityLog->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash('Comment saved', 'flash_success');\n\t\t\t\tif (array_key_exists('parent_flag_status', $this->request->data['ActivityLog'])) {\n\t\t\t\t\t$this->ActivityLog->updateParentFlag($this->ActivityLog->id, $this->request->data['ActivityLog']['parent_flag_status']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Error saving comment. Try again', 'flash_error');\n\t\t\t}\n\t\t}\n\t\t$this->redirect($this->referer('/'));\n\t}", "protected function logActivity(FieldObservation $fieldObservation)\n {\n activity()->performedOn($fieldObservation)\n ->causedBy(auth()->user())\n ->log('approved');\n }", "private function log($message)\n {\n Log::info($message);\n $this->info($message);\n }", "public function logResult() : void\n {\n $log = implode(' ', $this->logArray);\n $logger = new Logger('Results');\n $logger->pushHandler(new StreamHandler('file.log', Logger::DEBUG));\n $logger->addInfo($log);\n }", "private function do_log($log_type, $log_line='') {\n\t\tswitch ($log_type) {\n\t\t\tcase 'auth_code':\n\t\t\t\t$currDay = date('Y-m-d', time());\n\t\t\t\t$log_file = self::LOG_PATH.\"auth_code_{$currDay}.log\";\n\n\t\t\t\t$time = date('Y-m-d H:i:s', time());\n\t\t\t\t$log = \"[$time][$log_line]\\n\";\n\t\t\t\tfile_put_contents($log_file, $log, FILE_APPEND);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn;\n\t}", "public function log(string $message): void\n {\n $filePointer = fopen($this->file, \"a\");\n\n $logMsg = date('Y-m-d H:i:s') . \"\\t\\t\" . $message . \"\\n\";\n\n //rewind($filePointer);\n fwrite($filePointer, $logMsg);\n fclose($filePointer);\n }", "function addFileLog($file, $text) {\n\t$today = date(\"Ymd\");\n\t$timeStamp = date(\"Y-m-d H:i:s\");\n\t$filePath = \"./__logs__/\".$today.\"_\".$file;\n\tfile_put_contents($filePath, \"\\n\".$timeStamp.\"\\n\".$text, FILE_APPEND | LOCK_EX);\n}", "function logger($str)\r\n\t\t{\r\n\t\t\t//write log\r\n\t\t\t$log = $str = '' ? PHP_EOL : '[' . date('Y-m-d H:i:s') . '] ' . $str . PHP_EOL;\r\n\t\t\tfile_put_contents('patcher.log', $log, FILE_APPEND | LOCK_EX);\r\n\t\t}", "public function log()\r\n {\r\n echo $this->message.PHP_EOL;\r\n }", "function log_action($blog_id, $note) {\r\n\t //grab data\r\n\t $log = get_blog_option($blog_id, 'psts_action_log');\r\n\r\n\t if (!is_array($log))\r\n\t $log = array();\r\n\r\n\t //append\r\n\t $timestamp = microtime(true);\r\n\r\n\t\t//make sure timestamp is unique by padding seconds, or they will be overwritten\r\n\t while (isset($log[$timestamp]))\r\n\t $timestamp += 0.0001;\r\n\r\n\t $log[$timestamp] = $note;\r\n\r\n\t //save\r\n\t update_blog_option($blog_id, 'psts_action_log', $log);\r\n\t}", "public function addLogFile(string $name, string $link) : void\n {\n $this->logFiles[$name] = $link;\n }", "protected function recordActivity($event)\n {\n Activity::create([\n 'user_id' => auth()->id(),\n 'type' => $this->getType($event),\n 'date' => Carbon::now(),\n ]);\n }", "function add_activity_result($result) {\n\t\t$this->_activity_result[] = $result;\n\t}", "private function log_it($msg) {\n $this->log_msg_queue .= date('m/d/y H:i:s : ', time()) . $msg . PHP_EOL;\n }", "public function createdLogEntryCallsGivenLogger()\n {\n $this->mockLogger->expects($this->once())\n ->method('log')\n ->with($this->logEntry);\n $this->logEntry->log();\n }", "private static function logging()\n {\n $files = ['Handler', 'Exception', 'Log'];\n $folder = static::$root.'Logging'.'/';\n\n self::call($files, $folder);\n }", "public function log($content){\n \t\ttry{\n \t\t\t$resp = file_put_contents($this->logFileName, date('Y-m-d H:i:s').$content.\"\\n\", FILE_APPEND);\n \t\t\tif($resp){\n \t\t\t\treturn true;\n \t\t\t} else {\n \t\t\t\terror_log(\"UNBXD_MODULE:Error while appending the contents to log file\");\n \t\t\t\treturn false;\n \t\t\t}\n \t\t\treturn true;\n \t\t}catch(Exception $ex) {\n \t\t\terror_log(\"UNBXD_MODULE:Error while appending the contents to log file\");\n \t\t\tMage::throwException($ex->getMessage());\n \t\t\treturn false;\n \t\t}\n \t}", "function _log($message) {\n file_put_contents(\n LOG_FILE, \n $message,\n FILE_APPEND\n );\n}", "public function add_log($log_data)\n {\n\n /*** Data Format ::\n\n $log_data = [\n 'log_data' => 'sample log',\n 'meta_data' => 'location: Moon, etc.',\n 'tags' => 'moon, announcement',\n 'user_id' => '1'\n ];\n\n ***/\n\n $log_add_query = \"INSERT INTO `$this->table` (log_data, meta_data, tags, user_id) VALUES (:log_data, :meta_data, :tags, :user_id)\";\n $stmt = $this->conn->prepare($log_add_query);\n $stmt->execute($log_data);\n }", "private function logAdd($meal, $participant)\n {\n if (is_object($this->getDoorman()->isKitchenStaff()) === false) {\n return;\n }\n\n $logger = $this->get('monolog.logger.balance');\n $logger->addInfo(\n 'admin added {profile} to {meal} (Participant: {participantId})',\n array(\n 'participantId' => $participant->getId(),\n 'profile' => $participant->getProfile(),\n 'meal' => $meal,\n )\n );\n }", "public static function log($log1, $log2)\n\t{\n\t\tif (config::byKey('ActiveLog', 'zipabox', false)) log::add('zipabox', $log1, $log2);\n\t}", "function log_event($action) {\n\t$now = new DateTime();\t\n\tfile_put_contents(WP_PLUGIN_DIR.\"/StandardsReader/cron_log.txt\", \"|\" . $now->format('Y-m-d H:i:s') . \" \". $action . \"\\r\\n\", FILE_APPEND | LOCK_EX);\n}", "function add_log_file_contents($logfilePath, $content) {\n $existingLog = file_get_contents($logfilePath);\n $existingLog = str_replace('# CHANGELOG' . PHP_EOL, '', $existingLog);\n\n $newLog = '# CHANGELOG' . PHP_EOL . PHP_EOL . $content . $existingLog;\n\n file_put_contents($logfilePath, $newLog);\n}" ]
[ "0.6949899", "0.6786018", "0.64081633", "0.6330909", "0.62965894", "0.6278046", "0.6214957", "0.6186524", "0.61659294", "0.6150313", "0.60642064", "0.6049629", "0.6048209", "0.6039665", "0.6021442", "0.59698683", "0.5951873", "0.59339076", "0.5907722", "0.5890782", "0.5884637", "0.5881466", "0.58736473", "0.5860336", "0.5851384", "0.58345956", "0.5829496", "0.58112967", "0.57649803", "0.57638395", "0.57601714", "0.5742493", "0.5726458", "0.57160336", "0.57115597", "0.5680867", "0.5642853", "0.56003803", "0.55909467", "0.5589922", "0.5583804", "0.558041", "0.55554485", "0.554447", "0.5532719", "0.5531726", "0.550786", "0.5507511", "0.54959524", "0.5472654", "0.54685694", "0.54660666", "0.54608244", "0.54605603", "0.54484665", "0.5435403", "0.54299957", "0.54241884", "0.5420555", "0.54089046", "0.54078853", "0.54002506", "0.5395923", "0.5394846", "0.5389169", "0.53881514", "0.5380868", "0.5374118", "0.53652", "0.53561914", "0.53503114", "0.53496146", "0.53409624", "0.53306276", "0.5328869", "0.532593", "0.5309991", "0.5294703", "0.52934366", "0.5282186", "0.52804995", "0.5277381", "0.5276957", "0.5274643", "0.5260399", "0.52480656", "0.52479327", "0.5246931", "0.52445006", "0.52439207", "0.52301574", "0.52278626", "0.52271146", "0.52242965", "0.52234715", "0.52198565", "0.5202221", "0.5192602", "0.5189551", "0.5185975" ]
0.6091978
10
Run the database seeds.
public function run() { //Factory for the address CustomizePizza::create([ 'order_item_id' => 1, 'item_price_id' => 63, 'quantity' => '2', ]); CustomizePizza::create([ 'order_item_id' => 2, 'item_price_id' => 63, 'quantity' => '1', ]); CustomizePizza::create([ 'order_item_id' => 3, 'item_price_id' => 63, 'quantity' => '3', ]); CustomizePizza::create([ 'order_item_id' => 4, 'item_price_id' => 63, 'quantity' => '1', ]); CustomizePizza::create([ 'order_item_id' => 5, 'item_price_id' => 63, 'quantity' => '2', ]); CustomizePizza::create([ 'order_item_id' => 6, 'item_price_id' => 63, 'quantity' => '1', ]); CustomizePizza::create([ 'item_price_id' => 63, 'order_item_id' => 7, 'quantity' => '2', ]); CustomizePizza::create([ 'item_price_id' => 63, 'order_item_id' => 8, 'quantity' => '1', ]); CustomizePizza::create([ 'item_price_id' => 63, 'order_item_id' => 9, 'quantity' => '3', ]); CustomizePizza::create([ 'item_price_id' => 63, 'order_item_id' => 10, 'quantity' => '1', ]); CustomizePizza::create([ 'item_price_id' => 63, 'order_item_id' => 11, 'quantity' => '2', ]); CustomizePizza::create([ 'item_price_id' => 63, 'order_item_id' => 12, 'quantity' => '3', ]); CustomizePizza::create([ 'order_item_id' => 13, 'item_price_id' => 63, 'quantity' => '2', ]); CustomizePizza::create([ 'order_item_id' => 14, 'item_price_id' => 63, 'quantity' => '2', ]); CustomizePizza::create([ 'order_item_id' => 15, 'item_price_id' => 63, 'quantity' => '1', ]); CustomizePizza::create([ 'order_item_id' => 16, 'item_price_id' => 63, 'quantity' => '3', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8014072", "0.7980389", "0.7977261", "0.79545176", "0.7951285", "0.7949779", "0.79447794", "0.79427236", "0.7938544", "0.7937133", "0.7933888", "0.7892658", "0.78813094", "0.7879304", "0.78790134", "0.7875582", "0.78718805", "0.7870327", "0.7851507", "0.78506047", "0.7841656", "0.7834773", "0.782799", "0.7819246", "0.7809116", "0.7803176", "0.7802559", "0.7800953", "0.7799208", "0.77958846", "0.77905864", "0.7788729", "0.7786444", "0.7778857", "0.7777666", "0.7765372", "0.77626014", "0.7762562", "0.77622634", "0.77615577", "0.7760895", "0.77596897", "0.7757152", "0.7753893", "0.77497184", "0.77495176", "0.77468747", "0.77301675", "0.77291715", "0.772798", "0.7716827", "0.77145964", "0.7714208", "0.7713344", "0.77125347", "0.771253", "0.7711237", "0.77112275", "0.77108705", "0.7710304", "0.7705747", "0.77048707", "0.770442", "0.77041996", "0.77028614", "0.77021116", "0.77008957", "0.7698864", "0.76987725", "0.7697583", "0.76966494", "0.76945114", "0.7692977", "0.7691408", "0.76907796", "0.7688464", "0.7687695", "0.7686974", "0.7686826", "0.76851374", "0.7684132", "0.7679417", "0.7678492", "0.76778567", "0.76769906", "0.76728696", "0.7671034", "0.76692134", "0.7668971", "0.7668952", "0.7666531", "0.7662757", "0.7662455", "0.76616526", "0.765996", "0.7656754", "0.765413", "0.76537156", "0.76526105", "0.76523715", "0.7652133" ]
0.0
-1
Create new BaseFieldRepository instance.
public function __construct(ConfigHandler $config, CrudBaseController $controller, BaseForm $form, Field $field = null) { $this->config = $config; $this->controller = $controller; $this->form = $form; $this->field = $field; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct( $repo, $field )\n {\n $this->repo = $repo;\n $this->field = $field;\n }", "public function createRepository()\n {\n $schema = $this->getConnection()->getSchemaBuilder();\n\n $schema->create($this->table, function ($table) {\n $table->increments('id');\n $table->string('plugin');\n $table->string('migration');\n $table->integer('batch');\n });\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "abstract protected function getRepository();", "abstract public function getRepository();", "abstract public function getRepository();", "public function __construct( )\n {\n $this->genericRepository = new DtGenericRepository();\n $this->genericRepository->type = \"\\App\\Models\\Objects\\Entities\\Account\";\n }", "protected function getRepository() {}", "abstract function newRepoInstance($mongoDb, $collection, $persistable = null);", "public function create($repository);", "public abstract function getRepository();", "public function initRepository(): void;", "abstract public function repository();", "public abstract function createFields();", "protected function saveNew() {\n $module_handler = \\Drupal::moduleHandler();\n $entity_manager = \\Drupal::entityManager();\n $storage_controller = $entity_manager->getStorageController($this->entityType);\n\n // Field name cannot be longer than Field::ID_MAX_LENGTH characters. We\n // use drupal_strlen() because the DB layer assumes that column widths\n // are given in characters rather than bytes.\n if (drupal_strlen($this->id) > static::ID_MAX_LENGTH) {\n throw new FieldException(format_string(\n 'Attempt to create a field with an ID longer than @max characters: %id', array(\n '@max' => static::ID_MAX_LENGTH,\n '%id' => $this->id,\n )\n ));\n }\n\n // Ensure the field name is unique (we do not care about deleted fields).\n if ($prior_field = current($storage_controller->load(array($this->id)))) {\n $message = $prior_field->active ?\n 'Attempt to create field name %id which already exists and is active.' :\n 'Attempt to create field name %id which already exists, although it is inactive.';\n throw new FieldException(format_string($message, array('%id' => $this->id)));\n }\n\n // Disallow reserved field names. This can't prevent all field name\n // collisions with existing entity properties, but some is better than\n // none.\n foreach ($entity_manager->getDefinitions() as $type => $info) {\n if (in_array($this->id, $info['entity_keys'])) {\n throw new FieldException(format_string('Attempt to create field %id which is reserved by entity type %type.', array('%id' => $this->id, '%type' => $type)));\n }\n }\n\n // Check that the field type is known.\n $field_type = field_info_field_types($this->type);\n if (!$field_type) {\n throw new FieldException(format_string('Attempt to create a field of unknown type %type.', array('%type' => $this->type)));\n }\n $this->module = $field_type['module'];\n $this->active = TRUE;\n\n // Make sure all settings are present, so that a complete field\n // definition is passed to the various hooks and written to config.\n $this->settings += $field_type['settings'];\n\n // Provide default storage.\n $this->storage += array(\n 'type' => variable_get('field_storage_default', 'field_sql_storage'),\n 'settings' => array(),\n );\n // Check that the storage type is known.\n $storage_type = field_info_storage_types($this->storage['type']);\n if (!$storage_type) {\n throw new FieldException(format_string('Attempt to create a field with unknown storage type %type.', array('%type' => $this->storage['type'])));\n }\n $this->storage['module'] = $storage_type['module'];\n $this->storage['active'] = TRUE;\n // Provide default storage settings.\n $this->storage['settings'] += $storage_type['settings'];\n\n // Invoke the storage backend's hook_field_storage_create_field().\n $module_handler->invoke($this->storage['module'], 'field_storage_create_field', array($this));\n\n // Save the configuration.\n $result = parent::save();\n field_cache_clear();\n\n // Invoke hook_field_create_field() after the cache is cleared for API\n // consistency.\n $module_handler->invokeAll('field_create_field', array($this));\n\n return $result;\n }", "abstract protected function createFields();", "public function __construct()\n {\n $this->typeRepo = new TypesRepository();\n }", "private function createRepositoryDefinition()\n {\n $id = $this->getServiceId('repository');\n if (!$this->container->has($id)) {\n $definition = new Definition($class = $this->getServiceClass('repository'));\n $definition->setArguments([\n new Reference($this->getServiceId('manager')),\n new Reference($this->getServiceId('metadata'))\n ]);\n if (is_array($this->options['translation'])) {\n $definition\n ->addMethodCall('setLocaleProvider', [new Reference('ekyna_core.locale_provider.request')]) // TODO alias / configurable ?\n ->addMethodCall('setTranslatableFields', [$this->options['translation']['fields']])\n ;\n }\n $this->container->setDefinition($id, $definition);\n }\n }", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "public static function get(): AbstractRepository {\n return new static();\n }", "public function init(string $model_type): Repository;", "static function createWith($fields) {\r\n return static::make($fields)->create();\r\n }", "public function getRepository();", "public static function create(array $fields) : ActiveRecordInterface\n\t{\n\t\t$instance = new self;\n\n\t\tif (property_exists($instance, 'created_dt'))\n\t\t{\n\t\t\t$fields['created_dt'] = !array_key_exists('created_dt', $fields) ? gmdate('Y-m-d H:i:s') : $fields['created_dt'];\n\t\t}\n\n\t\tif (property_exists($instance, 'uuid'))\n\t\t{\n\t\t\t$fields['uuid'] = Uuid::uuid5(Uuid::NAMESPACE_DNS, implode('', array_values($fields)) . rand(1, 99999999) . microtime());\n\t\t}\n\n\t\t$instance->fromArray($fields, $keyType = TableMap::TYPE_FIELDNAME);\n\t\t$instance->save();\n\t\treturn $instance;\n\t}", "function repositoryCustom()\n {\n }", "public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }", "public function __construct(\\App\\Repos\\Local_DB_RO_Repository $repo)\n {\n\t\t$this->middleware('auth');\n\n\t\t$this->repo = $repo;\n }", "private function createFields(){\n //Human::log(\"------------- Create fields model \".$this->modelName);\n self::$yetInit[get_class($this)]=true;\n //let's init database.\n $modelName=get_class($this);\n $modelNameManager=$modelName.\"Manager\";\n if(!class_exists($modelNameManager)){\n $modelNameManager=\"DbManager\";\n }\n $rc=new ReflectionClass($modelName);\n $rc->setStaticPropertyValue(\"manager\", new $modelNameManager( $modelName ));\n \n //browse the class properties to find db fields and then store it in a good order (keys first, associations later)\n\t $fields=array();\n foreach ($rc->getProperties() as $field){\n if($field->isPublic()){\n\n\n //get the type from the @var type $field name comment...yes, I'm sure.\n $comments=$field->getDocComment();\n $details=CodeComments::getVariable($comments);\n\n $type=$details[\"type\"];\n $isVector=$details[\"isVector\"];\n $description=$details[\"description\"];\n $fieldName=$field->name;\n\n $fieldObject=$this->getDbField($fieldName,$type,$isVector);\n\n if($fieldObject){\n $fieldObject[\"comments\"]=$description;\n switch($fieldObject[\"type\"]){\n\n case \"OneToOneAssoc\":\n case \"NToNAssoc\":\n //associations at the end\n array_push($fields, $fieldObject);\n break;\n\n default :\n //classic fields at the beginning\n array_unshift($fields, $fieldObject);\n\n }\n\n }\n }\n }\n\t //create the fields\n\t foreach ($fields as $f){\n\t\t$f[\"options\"][Field::COMMENTS]=$f[\"comments\"];\n Field::create($modelName.\".\".$f[\"name\"],$f[\"type\"],$f[\"options\"]);\n //Human::log($this->modelName.\" Create field \".$f[\"name\"]);\n \n\t }\n \n\t //whooho!\n $this->db()->init(); \n }", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function repository()\n {\n return Repository::i();\n }", "public function repository(): CrudRepository\n {\n return new ResourceRepository();\n }", "public function __construct()\n {\n\n $this->docuVaultGeneratorRepo = new DocuVaultGeneratorRepository();\n }", "public function __construct(TipoProdutoRepository $repository, DatabaseManager $db)\n {\n parent::__construct($repository, $db);\n }", "public function test_it_creates_new_field_from_input_data()\n\t{\n\t\t$previous = \\DvsField::count();\n\n\t\t$this->LanguagesRepository->shouldReceive('findLanguageForPageVersion')\n\t\t\t->times(1)\n\t\t\t->andReturn(\\DvsLanguage::find(45));\n\n\n\t\t// when we call this method with input data\n\t\t$output = $this->FieldManager->findOrCreateField([\n\t\t\t'human_name' => 'Human Name',\n\t\t\t'key' => 'key42',\n\t\t\t'type' => 'text',\n\t\t\t'settings' => '{}',\n\t\t\t'page_version_id' => '1',\n\t\t\t'value' => '{}',\n\t\t]);\n\n\t\t// then it should create a new field from input data\n\t\tassertEquals('key42', $output->key);\n\t\tassertEquals($previous + 1, \\DvsField::count());\n\t}", "public function createFilmRepository()\n {\n // il le demanderait dans son constructeur.\n // Ce serait donc le role de cette Factory d'instancier ce PDO\n // et de l'injecter au FilmRepository\n // La Factory aurait egalement pu gerer le lifecycle des PDOs\n // (un par repository ? un unique pour toute l'appli ?)\n return new FilmRepository();\n }", "public function __construct()\n {\n parent::__construct();\n $this->userRepository = new UserRepository();\n }", "protected function & createField() {\n\t\t# Initialize\n\t\t$linker =& $this->getLinker();\n\t\t# Create Form FIELD!\n\t\t$linker->create($this);\n\t\t# Chain\n\t\treturn $this;\n\t}", "public function getRepository(): EntityRepository;", "protected function createFieldConfigurationManager()\r\n {\r\n $this->fieldConfigurationManager = GeneralUtility::makeInstance(FieldConfigurationManager::class);\r\n $this->fieldConfigurationManager->injectController($this->getController());\r\n }", "public function __construct(SignupRepository $signupRepo ) {\n parent::__construct ();\n $this->country = new Country();\n $this->currency = new Currency();\n $this->user = new User();\n $this->region = new Region();\n $this->organization = new Organization();\n $this->repository = $signupRepo;\n $this->gd = new GeneralDistributor();\n $this->parts = new QprReport();\n $this->service = new QsrReport();\n\n }", "private function createDriver(array $fields = []): User\n {\n $fields['permissions'] = $fields['permissions'] ?? User::DRIVER_PERMISSION;\n\n return factory(User::class)->create(array_merge($this->driverData, $fields));\n }", "public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $fieldData) {\n\t\t\t$field = new Field();\n\t\t\t$field->setProperties($fieldData);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}", "public function __construct(){\n $this->db = new Base;\n }", "public function __construct()\n {\n $this->citiesRepository = new CitiesRepository();\n }", "public function createRepository($entityName)\n {\n if (isset($this->repositories[$entityName])) {\n //echo 'Repo exist -> returning';\n return $this->repositories[$entityName];\n }\n\n $classname = \"\\\\Model\\Repository\\\\{$entityName}Repository\";\n\n //todo: might check if file with repo exist\n //echo 'creating repo'\n $repo = new $classname();\n $repo->setPdo($this->pdo);\n $this->repositories[$entityName] = $repo;\n\n return $repo;\n }", "public function __construct(){\n $this->db = new Base;\n }", "protected function repository($name)\n {\n parent::repository($name);\n\n return $this->repository;\n }", "public function getRepository(): TableRepository;", "public function baseRepository() {\n $userRepository = $this->getDoctrine()\n ->getManager()\n ->getRepository('Application\\UserBundle\\Entity\\User');\n return $userRepository;\n }", "public function __construct(DatabaseStudentRepository $repository) {\n $this->repository = $repository;\n }", "public function withFields(): Factory\n {\n return $this->afterCreating(function (Entry $entry) {\n $fields = $entry->toEntryClass()->getFields();\n\n foreach ($fields as $field) {\n Field::factory()->create([\n 'entry_id' => $entry->id,\n 'key' => $field->getKey(),\n 'value' => $field->getKey() . '_value',\n ]);\n }\n });\n }", "public static function factory(array $fields)\n\t{\n\t\t$collection = new self();\n\t\tforeach ($fields as $data) {\n\t\t\t$field = Field::factory($data);\n\t\t\t$collection->add($field);\n\t\t}\n\t\treturn $collection;\n\t}", "public function repository()\n {\n return GenreRepositoryInterface::class;\n }", "public function repository(): RepositoryContract;", "public function __construct(ContactRepository $repository)\n {\n $this->repository = $repository;\n }", "public function cloneRepository();", "public function construct() {\n parent::construct();\n $this->additional_fields['nid'] = [\n 'table' => 'node_revision',\n 'field' => 'nid',\n ];\n $this->additional_fields['vid'] = [\n 'table' => 'node_revision',\n 'field' => 'vid',\n ];\n $this->additional_fields['title'] = [\n 'table' => 'node_revision',\n 'field' => 'title',\n ];\n }", "public function __construct(DataRepository $repository)\n {\n $this->repository = $repository;\n }", "public function getRepository($className);", "public function __construct(BackendRepositoryInterface $bR)\n {\n $this->bR = $bR;\n //i mam w gateway dostepne moje repo dla kazdej metody\n }", "public function createRepository()\n {\n if (!interface_exists('Puli\\Repository\\Api\\ResourceRepository')) {\n throw new RuntimeException('Please install puli/repository to create ResourceRepository instances.');\n }\n\n $repo = new JsonRepository(__DIR__.'/path-mappings.json', __DIR__.'/..', true);\n\n return $repo;\n }", "public function __construct()\n {\n $this->postRepository = new PostRepository();\n $this->userRepository = new UserRepository();\n $this->commentRepository = new CommentRepository();\n $this->replyRepository = new ReplyRepository();\n }", "public function __construct()\n {\n// $this->repo = new CourseRepository;\n }", "protected function repository(StoreInterface $store)\n\t{\n\t\treturn new Repository($store);\n\t}", "public static function make(string $field)\n\t{\n\t\treturn new static($field);\n\t}", "private function registerFactoryInRepository(): FactoryInterface\n {\n if (!empty($this->statedClassName)) {\n $this->factoryRepository[$this->statedClassName] = $this;\n }\n\n return $this;\n }", "public function createFields()\n\t{\n\t\t$this->_formFields = $this->createModelFormFields();\n\t\treturn $this;\n\t}", "public function __construct()\n {\n $this->bigStatisticsRepo = new BigStatisticsRepository();\n }", "public function create($fields)\r\n {\r\n return $this->__create($fields);\r\n }", "public function getRepository(string $className): IRepository;", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "public function __construct(MigrationRepositoryInterface $repository)\n {\n parent::__construct();\n\n $this->repository = $repository;\n }", "public function __construct(ContactRepository $repository)\n {\n $this->repository = $repository;\n\n $this->table = 'contacts';\n }", "public function newCustomFieldModel($fieldName)\n\t{\n\t\treturn new CustomField([\n\t\t\t'field_name' => $fieldName,\n\t\t\t'parent_type' => get_class($this),\n\t\t\t'parent_id' => $this->id\n\t\t]);\n\t}", "public function __construct($field){\n $this->field = $field;\n }", "public function __construct( VoucherRepository $repository )\n {\n // Repository to persist data\n $this->repository = $repository;\n }", "public function setFieldsBase( $fields_base )\n\t{\n\t\t$this->_fields_base = $fields_base;\n\t\treturn $this;\n\t}", "public static function createField(IndexInterface $index, $field_identifier) {\n return new Field($index, $field_identifier);\n }", "public function __construct()\n {\n parent::__construct();\n $this->repository = app(UserGroup::class);\n }", "function __construct($field = null) {\n if (is_null($field))\n return;\n $this->field = $field;\n }", "public function __construct(FtpCommandRepository $repository)\n {\n parent::__construct();\n\n $this->repository = $repository;\n }", "function create(array $fields = null)\n {\n return (is_array($fields)) ? call_user_func_array([$this->modelClass, 'create'], [$fields]) : new $this->modelClass();\n }", "public function __construct(PostRepository $repo)\n\t{\n\t\t$this->repo = $repo;\n\t}", "protected function create()\n {\n return new $this->entityClass();\n }", "public function getRepositoryFactory()\n {\n return $this->repositoryFactory;\n }", "public function __construct(SupplierRepository $repository)\n {\n $this->repository = $repository;\n }", "public function __construct($fields = [])\n {\n\n parent::__construct($this->prepareFields($fields));\n }", "public function __construct(RepositoryInterface $repository)\n {\n parent::__construct();\n\n $this->repository = $repository;\n }", "public function initDB() {\n\t\t$field = $this->factory->createILubFieldDefinition();\n\t\t$field->initDB();\n\t}", "public function __construct()\n {\n $this->repository = new EloquentRoleRepository;\n }", "public function create($data = array()) {\n\t\tparent::create($data);\n\t\t$this->dir = new RepoDir(false);\n\t\treturn $this;\n\t}", "public function __construct(QBDRepository $qbdRepo)\n {\n //parent::__construct();\n\n $this->qbdRepo = $qbdRepo;\n }", "function create_field($field)\n{\n}", "public function __construct(ContentModelRepository $repository)\n {\n $this->repository = $repository;\n }", "protected function repository($provider)\n {\n return new GatewayRepository($provider);\n }", "public function create($fields) {\n return $this->model->create($fields);\n }", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "protected function createRepository($entityName = null)\n {\n if ( ! $this->schemaReloaded || ! $this->fixturesReloaded) {\n throw new RuntimeException('Schema or fixures not reloaded, did you call parent::setUp()?');\n }\n if (null === $entityName) {\n if (null === $this->entityName) {\n throw new UnexpectedValueException(\n 'Please provide entity name in overriding class or as first argument'\n );\n }\n $entityName = $this->entityName;\n }\n return $this->getEntityManager()->getRepository($entityName);\n }", "public function getRepository() : RepositoryInterface {\n\n if(null === $this->repository) {\n\n $quizModuleService = new ModuleService(new Meta(), new View());\n $this->repository = new Repository($this->getConfig(), $quizModuleService);\n }\n\n return $this->repository;\n }", "public function __construct(FenpeiRepository $fenpeiRepository)\n {\n parent::__construct();\n $this->fenpeiRepository = $fenpeiRepository; //注入对象\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}" ]
[ "0.63967806", "0.6295707", "0.6184993", "0.6002979", "0.59320277", "0.59320277", "0.5928329", "0.58996564", "0.5894282", "0.5870929", "0.5858669", "0.5828895", "0.5789435", "0.5779005", "0.57713735", "0.5745175", "0.5724787", "0.5683236", "0.5672522", "0.56175005", "0.5560978", "0.5518583", "0.54987895", "0.54958457", "0.5477423", "0.54695827", "0.5428172", "0.5370086", "0.53668886", "0.5346217", "0.5346072", "0.5316084", "0.53126216", "0.5296628", "0.5295924", "0.5289204", "0.528064", "0.5267129", "0.52514535", "0.51903987", "0.51797146", "0.5176261", "0.5173542", "0.51732725", "0.51686484", "0.5161389", "0.516079", "0.51536834", "0.5151836", "0.5137868", "0.51353395", "0.51276064", "0.51179224", "0.51009655", "0.509917", "0.5097206", "0.5094852", "0.50940293", "0.5091545", "0.50801146", "0.5064239", "0.5059842", "0.5056261", "0.50531554", "0.5048591", "0.5048005", "0.50416774", "0.5037969", "0.5036964", "0.5033872", "0.5032013", "0.5031567", "0.502813", "0.50273746", "0.5026884", "0.5018604", "0.5013684", "0.5012745", "0.5008363", "0.4998092", "0.49964184", "0.4989556", "0.4986772", "0.49817413", "0.49742863", "0.4956677", "0.49556756", "0.49456832", "0.49416456", "0.49387288", "0.49381378", "0.4933417", "0.49247473", "0.49065363", "0.49061394", "0.49057662", "0.49008253", "0.48878488", "0.48800686", "0.48719415", "0.4870896" ]
0.0
-1
Fill attributes to model.
protected function fillAttributesToModel($model, array $attributes) { foreach ($this->form->getRegisteredFields() as $field) { if (! array_key_exists($field->id, $attributes)) { continue; } $fill = [$field->local_key]; if ($field instanceof ModifiesMultipleAttributes) { $fill = $field->getModifiedAttributes(); $attributes = $attributes[$field->id]; } foreach ($fill as $attribute) { $field->fillModel($model, $attribute, $attributes[$attribute]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fill(Identifiable $model, array $attributes);", "public function _fill($attributes)\n \t{\n \t\tforeach($attributes as $key => $value) {\n \t\t\t$this->$key = $value;\n \t\t}\n\n \t\treturn $this;\n \t}", "public function fillModelAttributes($model, $request, $fields)\n {\n }", "public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}", "public function fill(array $attributes)\n {\n $existingAttributes = get_object_vars($this);\n\n foreach ($existingAttributes as $attributeName => $oldAttributeValue) {\n array_key_exists($attributeName, $attributes) ? $this->$attributeName = $attributes[$attributeName] : NULL;\n }\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }", "protected function setAttributes()\n {\n if (in_array('attributes', $this->with)) {\n $this->result[$this->attribute]['attributes'] = Arr::get($this->field, 'attributes');\n }\n\n\n return $this;\n }", "public function _set_model_fields(){\n // set fields only when they have not been set for this object\n if($this->_fields_loaded===FALSE){\n\n foreach ($this->_meta() as $meta) {\n\n $this->{$meta->name} = '';\n }\n }\n }", "public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$this->values[$field] = $this->$field ;\n\t\t}\n\t}", "public function fill(array $attributes = [])\n {\n // start_measure('fill-model', 'Création de l\\'objet '.static::class);\n foreach ($attributes as $key => $value) {\n if (is_array($value) && method_exists($this, $key)) {\n $this->setRelation($key,\n $this->$key()->getRelationsFromArray($value)\n );\n } else {\n $this->setAttribute($key, $value);\n }\n }\n // stop_measure('fill-model');\n\n return $this;\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }", "public function __construct(){\n if(count($this->fillable) == 0){\n foreach($this->attributes as $key => $attr){\n array_push($this->fillable, $key);\n }\n }\n }", "public function fill()\n {\n $relationships = $this->relationships;\n $modelRelations = $this->loadRequiredRelationships();\n\n return collect($relationships)->transform(function($relations, $key) use($modelRelations) {\n $merge = array_get($modelRelations, $key);\n return $merge ? $this->mergeRelations($merge, $relations) : $relations;\n })->all();\n }", "public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\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// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\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$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function fill(array $attributes)\n {\n foreach ($this->fillableFromArray($attributes) as $key => $value) {\n if ($this->isFillable($key)) {\n $this->setAttribute($key, $value);\n }\n }\n\n return $this;\n }", "public function fill(array $attributes);", "public function fill(array $attributes, $raw = false) {\n\t\tforeach ($attributes as $key => $value) {\n\t\t\t// If the \"raw\" flag is set, it means that we'll just load every value from\n\t\t\t// the array directly into the attributes, without any accessibility or\n\t\t\t// mutators being accounted for. What you pass in is what you get.\n\t\t\tif ($raw) {\n\t\t\t\t$this->set_attribute($key, $value);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the \"accessible\" property is an array, the developer is limiting the\n\t\t\t// attributes that may be mass assigned, and we need to verify that the\n\t\t\t// current attribute is included in that list of allowed attributes.\n\t\t\tif (is_array(static::$accessible)) {\n\t\t\t\tif (in_array($key, static::$accessible)) {\n\t\t\t\t\t$this->$key = $value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If the \"accessible\" property is not an array, no attributes have been\n\t\t\t\t// white-listed and we are free to set the value of the attribute to\n\t\t\t\t// the value that has been passed into the method without a check.\n\n\t\t\t\t$this->$key = $value;\n\t\t\t}\n\t\t}\n\n\t\t// If the original attribute values have not been set, we will set\n\t\t// them to the values passed to this method allowing us to easily\n\t\t// check if the model has changed since hydration.\n\t\tif (count($this->original) === 0) {\n\t\t\t$this->original = $this->attributes;\n\t\t}\n\n\t\treturn $this;\n\t}", "abstract protected function getModelAttributes();", "public function fill($model, $setPrimaryKey = true) {\r\n if($setPrimaryKey)\r\n $this->primaryKey = $model->id;\r\n $this->attributes = [\r\n 'title' => $model->header1,\r\n 'content' => $model->text,\r\n ];\r\n }", "public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }", "protected function hydrate()\n {\n $state = $this->_payload->state();\n foreach ($state as $key => $value) {\n $type = null;\n try {\n $type = optional((new \\ReflectionProperty($this, $key))->getType())->getName();\n } catch(\\Exception $e) {\n }\n if ($type) {\n $model_key = optional(new $type)->getKeyName();\n if (optional($value)[$model_key]) {\n $model = (new $type)->find(optional($value)[$model_key]);\n if ($model && ! is_null($value)) {\n $this->hydrate_model_attributes($model, (array) $value);\n $this->{$key} = $model;\n } else {\n $model = (new $type);\n $this->hydrate_model_attributes($model, (array) $value);\n $this->{$key} = $model;\n }\n } else {\n $model = (new $type);\n $this->hydrate_model_attributes($model, (array) $value);\n $this->{$key} = $model;\n }\n } else {\n $this->{$key} = $value;\n }\n }\n }", "public function fill(array $attributes)\n {\n $this->saving = true;\n\n $totallyGuarded = $this->totallyGuarded();\n\n foreach ($attributes as $key => $values) {\n if ($this->isKeyALocale($key)) {\n foreach ($values as $translationAttribute => $translationValue) {\n if ($this->alwaysFillable() or $this->isFillable($translationAttribute)) {\n $this->getTranslationOrNew($key)->$translationAttribute = $translationValue;\n } elseif ($totallyGuarded) {\n throw new MassAssignmentException($key);\n }\n }\n unset($attributes[$key]);\n }\n }\n\n $result = parent::fill($attributes);\n\n $this->saving = false;\n\n return $result;\n }", "public function initialize()\n {\n $this->skipAttributes([\n \"question_id\",\n ]);\n\n $this->skipAttributesOnCreate([\n \"question_status\"\n ]);\n\n $this->skipAttributesOnUpdate([\n \"question_creation_time\"\n ]);\n\n $this->hasMany('question_id', 'QaApp\\Models\\Answer', 'question_id', array('alias' => 'Answers'));\n }", "public function fill(array $attributes)\n {\n $totallyGuarded = $this->totallyGuarded();\n\n // TODO: check if its fillable\n // TODO: set attribute\n // TODO: else throw exception\n\n // TODO: return $this for chaining\n }", "public function fill($attributes)\n {\n foreach ($attributes as $key => $attribute)\n {\n if ($attribute === null)\n {\n unset($attributes[$key]);\n }\n }\n parent::fill($attributes);\n return $this;\n }", "public function fill(array $attributes = []);", "public function loadAttributes()\n {\n if (! $this->_attributesLoaded) {\n // send the backend a list of attributes we already have, so the backend can possibly\n // skip re-loading them.\n $presentAttributeNames = array_keys($this->_attributes);\n $newAttributes = $this->_cache->getBackend()->getMissingAttributes($this, $presentAttributeNames);\n $this->_attributes = array_merge($this->_attributes, $newAttributes);\n $this->_attributesLoaded = true;\n }\n return $this;\n }", "public function hydrate( array $attributes ) {\n\n\t\t// Set all the field from $data\n\t\tforeach ( $attributes as $fieldName => $fieldValue ) {\n\t\t\t$this->set( $fieldName, $fieldValue );\n\t\t}\n\n\t}", "public function setAttributes();", "public function fillAll($attributes, $safeOnly = true, $scenario = null)\n {\n $this->ensureAllInstanceOf(BaseActiveRecord::class);\n if(!empty($attributes)){\n foreach($this->getModels() as $model) {\n if($scenario){\n $model->scenario = $scenario;\n }\n $model->setAttributes($attributes, $safeOnly);\n }\n }\n return $this;\n }", "private function setAutofillFields() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof AutofillField) {\n $this->values[$field_name] = $field->fill();\n }\n }\n }", "public function fill(array $attributes)\n {\n $totallyGuarded = $this->totallyGuarded();\n\n foreach ($this->fillableFromArray($attributes) as $key => $value)\n {\n if ($this->isFillable($key))\n $this->setAttribute($key, $value);\n elseif ($totallyGuarded)\n throw new MassAssignmentException($key);\n }\n\n return $this;\n }", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = \"assignments\";\n\t}", "public function fill(array $attributes)\n {\n if ($this->getSection()) {\n $this->getEditableFields()->getFields()->each(function (FieldInterface $field) use (& $attributes) {\n $field->onDocumentFill($this, array_get($attributes, $field->getDBKey()));\n unset($attributes[$field->getDBKey()]);\n });\n }\n\n parent::fill($attributes);\n\n return $this;\n }", "protected static function boot()\n {\n /** We MUST call the parent boot...\n */\n parent::boot();\n\n static::saving(function ($model) {\n $model->attributeValues()->delete();\n\n foreach ($model->attributable as $key => $attribute)\n {\n\n $value = new AttributeValue([\n 'value' => $model->attributes[$key],\n ]);\n \n $model->attributable_records[] = Attribute::find($attribute['id'])->values()->save($value);\n \n unset($model->attributes[$key]);\n }\n });\n\n static::saved(function ($model) {\n \n /** Save all variables.\n * \n */\n foreach ($model->attributable_records as $key => $record)\n {\n $model->attributeValues()->save($record);\n \n unset($model->attributable_records[$key]);\n }\n });\n\n static::retrieved(function ($model) {\n if (config('attributable.cache') && !Cache::tags(['neon-attributes'])->has('neon-aval-'.$model->id)) {\n Cache::tags(['neon-attributes'])\n ->put(\n 'neon-aval-'.$model->id,\n $model->attributeValues,\n now()->addMinutes(2)\n );\n }\n \n $attributeValues = (config('attributable.cache') && Cache::tags(['neon-attributes'])->has('neon-aval-'.$model->id)) ? Cache::tags(['neon-attributes'])->get('neon-aval-'.$model->id) : $model->attributeValues;\n \n foreach ($attributeValues as $attributeValue)\n {\n $model->setAttribute($attributeValue->attribute->slug, $attributeValue->value);\n }\n });\n }", "public function fill(array $attributes)\n\t{\n\t\t$this->fillCustomAttributes($attributes);\n\t\t\n\t\treturn parent::fill($attributes);\n\t}", "protected function fillMandatoryModelsFields(&$model, $body)\n {\n $fields = array_keys($this->getMandatoryModelsFields());\n foreach ($fields as $field)\n {\n $model->$field = $body[$field];\n }\n }", "public function fill(array $attributes)\n {\n foreach ($attributes as $key => $value) {\n if (property_exists($this, $key)) {\n $this->{$key} = $value;\n }\n }\n return $this;\n }", "protected function fillModel(Model $model)\n {\n $model->fill($this->input);\n }", "protected function _prepareEnrtyForSave()\n {\n $object = $this->getObject();\n if (!($object instanceof Varien_Object)) {\n Mage::throwException(Mage::helper('googlebase')->__('Object model is not specified to save Google Base entry.'));\n }\n\n $this->_setUniversalData();\n\n $attributes = $this->getAttributeValues();\n if (is_array($attributes) && count($attributes)) {\n foreach ($attributes as $name => $data) {\n\n $name = $this->_normalizeString($name);\n $value = isset($data['value']) ? $data['value'] : '';\n $type = isset($data['type']) && $data['type'] ? $data['type'] : self::DEFAULT_ATTRIBUTE_TYPE;\n\n $customSetter = '_setAttribute' . ucfirst($name);\n if (method_exists($this, $customSetter)) {\n $this->$customSetter($name, $value, $type);\n } else {\n $this->_setAttribute($name, $value, $type);\n }\n }\n }\n return $this;\n }", "public function forceFill(array $attributes);", "public function setAttributes()\n\t{\n\t\t$this->title \t\t= Input::get( 'title' );\n\t\t$this->description \t= Input::get( 'description' );\n\t\t$this->color \t\t= Input::get( 'color' );\n\t\t$this->type \t\t= Input::get( 'type' );\n\t\t$this->canvas_id\t= Input::get( 'canvas_id', Input::get( 'canvasId' ) );\n\t}", "private function addAtrributesToCRUD() {\r\n if (!empty($this->__attributes)) {\r\n $this->myCRUD()->setAtributes($this->__attributes);\r\n }\r\n }", "protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }", "public function fill($attributes)\n {\n // Some context types have varying types\n if ($this->hasGetMutator('type')) {\n $this->type = $this->mutateAttribute('type', $this->getArrValue($attributes, 'type', $this->type));\n }\n\n // Set properties\n $properties = array_merge([\n '@context' => 'http://schema.org',\n '@type' => $this->type,\n 'sameAs' => null\n ], $this->structure, $this->extendStructure);\n\n // Set properties from attributes\n foreach ($properties as $key => $property) {\n $this->setProperty($key, $property, $this->getArrValue($attributes, $key, ''));\n }\n\n // After fill event\n $this->afterFill($attributes);\n }", "public function fill(array $attributes)\n {\n parent::fill($attributes);\n if ($this->exists != false) {\n $this->time_add = time();\n }\n\n return $this;\n }", "public function clean()\n {\n\n $this->model = null;\n $this->value = null;\n $this->attribute = null;\n $this->data = [];\n\n $this->fkTable = null;\n\n $this->fkQuery = null;\n $this->fkAndQuery = null;\n $this->fkOrQuery = null;\n\n }", "public function forceFill(array $attributes)\n {\n $model = $this;\n\n return static::unguarded(function () use ($model, $attributes) {\n return $model->fill($attributes);\n });\n }", "public function __construct(Model $data)\n {\n parent::__construct($data);\n\n $metas = $data->hasMany('Andriynto\\Ebri\\Models\\UserMeta')->getResults();\n\n if ( ! $metas->isEmpty()) {\n $metas = $metas->toArray();\n\n foreach ($metas as $item) {\n $this->setAttribute($item['key'], $item['value']);\n }\n\n unset($metas);\n }\n\n unset($metas);\n }", "public static function populateModel($values)\n\t{\n\t\t// Strip out the element record attributes if this is getting called from a child class\n\t\t// based on an Active Record result eager-loaded with the ElementRecord\n\t\tif (isset($values['element']))\n\t\t{\n\t\t\t$elementAttributes = $values['element'];\n\t\t\tunset($values['element']);\n\t\t}\n\n\t\t$model = parent::populateModel($values);\n\n\t\t// Now set those ElementRecord attributes\n\t\tif (isset($elementAttributes))\n\t\t{\n\t\t\tif (isset($elementAttributes['i18n']))\n\t\t\t{\n\t\t\t\t$model->setAttributes($elementAttributes['i18n']);\n\t\t\t\tunset($elementAttributes['i18n']);\n\t\t\t}\n\n\t\t\t$model->setAttributes($elementAttributes);\n\t\t}\n\n\t\treturn $model;\n\t}", "public function forceFill(array $attributes)\n {\n $this->attributes = $attributes;\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_dl('');\n $this->setDl('');\n $this->setRegion('');\n $this->setNombre_dl('');\n $this->setGrupo_estudios('');\n $this->setRegion_stgr('');\n $this->setStatus('');\n $this->setPrimary_key($aPK);\n }", "protected function mergeTranslationsWithAttributes()\n\t{\n\t\t$this->attributes = array_merge($this->attributes, $this->translatedAttributes);\n\t}", "public function buildAttributes()\n {\n $classes = new ClassFactory();\n $classes->add($this->default_class);\n\n if ($this->class) {\n foreach (explode(' ', $this->class) as $c) {\n $classes->add($c);\n }\n }\n\n $attr = new AttributeFactory();\n $attr->add('class', $classes->get());\n\n if ($this->role) {\n $attr->add('role', $this->role);\n }\n\n if ($this->id) {\n $attr->add('id', $this->id);\n }\n\n if ($this->aria_label) {\n $attr->add('aria-label', $this->aria_label);\n }\n\n if ($this->attributes) {\n foreach ($this->attributes as $key => $attribute) {\n $attr->add($key, $attribute);\n }\n }\n\n $this->data['attr'] = $attr->get();\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_enc('');\n $this->setId_nom('');\n $this->setModo('');\n $this->setF_ini('');\n $this->setF_fin('');\n $this->setId_nom_new('');\n $this->setPrimary_key($aPK);\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_item('');\n $this->setId_ubi('');\n $this->setId_tarifa('');\n $this->setYear('');\n $this->setCantidad('');\n $this->setObserv('');\n $this->setId_serie('');\n $this->setPrimary_key($aPK);\n }", "protected function collect_attributes() {\n\t\tforeach ( $this->properties as $key => $val ) {\n\t\t\tif ( in_array($key, self::$global_attributes) || in_array($key, static::$element_attributes) ) {\n\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// also check for compound attributes, such as data-src, aria-required, etc.\n\t\t\tforeach ( self::$global_attribute_pattern_prefixes as $prefix ) {\n\t\t\t\tif ( preg_match( '/'. $prefix .'[-]\\w+/', $key ) ) {\n\t\t\t\t\t$this->attributes[ $key ] = $val;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function populateModels()\n {\n }", "protected function prepareForValidation()\n {\n\n $attrs = $this->all();\n $attrs['day'] = ucfirst($attrs['day']);\n $hours = $this->transformHoursAndMinutes();\n $attrs['time_start'] = $hours[0];\n $attrs['time_end'] = $hours[1];\n $this->replace($attrs);\n }", "protected function bind(&$model) {\n\t\tforeach ($model->getAttributeNames() as $attribute) {\n\t\t\t// dont bind Created date attribute (default is now).\n\t\t\tif ($attribute === 'created') continue; \n\t\t\t$model->$attribute = $this->get($attribute);\n\t\t}\n\t\treturn $model;\n\t}", "public function fill(array $attributes = [])\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_nom('');\n $this->setId_nivel('');\n $this->setId_asignatura('');\n $this->setId_situacion('');\n // la fecha debe estar antes del acta por si hay que usar la funcion inventarActa.\n $this->setF_acta('');\n $this->setActa('');\n $this->setDetalle('');\n $this->setPreceptor('');\n $this->setId_preceptor('');\n $this->setEpoca('');\n $this->setId_activ('');\n $this->setNota_num('');\n $this->setNota_max('');\n $this->setTipo_acta('');\n $this->setPrimary_key($aPK);\n }", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "protected function setNullAllAttributes()\n\t{\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\tif( $value == \"real\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"int\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"date\" ) $this->$field = \"\" ;\n\t\t\telse if( $value == \"string\" ) $this->$field = null ;\n\t\t}\n\t}", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_item('');\n $this->setId_ubi('');\n $this->setF_gasto('');\n $this->setTipo('');\n $this->setCantidad('');\n $this->setPrimary_key($aPK);\n }", "public function fillModel(&$model, $input)\n\t{\n\t\t$model->{$this->getOption('field_name')} = $input;\n\t}", "protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }", "protected abstract function initializeAttributes(): array;", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_activ('');\n $this->setId_asignatura('');\n $this->setId_nom('');\n $this->setId_nivel('');\n $this->setId_situacion('');\n $this->setPreceptor('');\n $this->setId_preceptor('');\n $this->setNota_num('');\n $this->setNota_max('');\n $this->setActa('');\n $this->setPrimary_key($aPK);\n }", "private function prepareItems()\n {\n $attribute = $this->attribute;\n $items = $this->model->$attribute;\n if (!is_array($items)) {\n $items = [];\n }\n\n $this->_items = $items;\n }", "public function syncOriginalAttributes($attributes): Model\n {\n $attributes = is_array($attributes) ? $attributes : func_get_args();\n\n $modelAttributes = $this->getAttributes();\n\n foreach ($attributes as $attribute) {\n $this->original[$attribute] = $modelAttributes[$attribute];\n }\n\n return $this;\n }", "public function fill(array $attributes)\n {\n foreach ( $attributes as $key => $value) {\n\t\t\t$this->setAttribute($key, $value);\n }\n\n return $this;\n }", "public function set()\n {\n $args = func_get_args();\n\n if ( count($args) == 2 )\n {\n $this->attributes[$args[0]] = $args[1];\n }\n elseif ( count($args) == 1 && is_array($args[0]) ) \n {\n $this->attributes = ( array_merge($this->attributes, $args[0]) );\n }\n\n return $this;\n }", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "private function setModelAttributes($model, $data)\n {\n foreach($data as $var=>$value) {\n if(($model->hasAttribute($var) || isset($model->metadata->relations[$var])) && !in_array($var, $this->restrictedProperties)) {\n $model->$var = $value;\n }\n else\n throw new CHttpException(406, 'Parameter \\'' . $var . '\\' is not allowed for model');\n }\n\n return $model;\n }", "function fill($request) {\n foreach($request->getParams() as $field=>$value) {\n $this->$field = $value;\n }\n }", "public function initialize()\n {\n \t$this->belongsTo('id_usuario', 'IbcUsuario', 'id_usuario', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_periodo', 'CobPeriodo', 'id_periodo', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_contrato', 'CobActaconteo', 'id_contrato', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_ajuste_reportado', 'CobAjusteReportado', 'id_ajuste_reportado', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_actaconteo_persona_facturacion', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona_facturacion', array(\n \t\t\t'reusable' => true\n \t));\n }", "function read(){\n foreach($this as $attribute => $valor){\n $this->$attribute = Request::read($attribute);\n } \n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }", "public function fill(array $attributes)\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n\n return $this;\n }", "public function fill(array $attributes)\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n\n return $this;\n }", "public function fill(array $attributes = [])\n {\n $this->attributes = array_merge($this->attributes, $attributes);\n foreach($this->attributes['items'] as $key => $item) {\n if(is_array($item)) {\n $className = '\\App\\Items\\\\'.ucfirst($item['slug']);\n if(class_exists($className)) {\n $this->attributes['items'][$key] = new $className($item);\n }\n } elseif($item instanceof Item) {\n $this->attributes['items'][$key] = $item;\n }\n }\n foreach($this->attributes['systems'] as $key => $system) {\n if(is_array($system)) {\n $className = '\\App\\Systems\\\\'.ucfirst($system['slug']);\n if(class_exists($className)) {\n $this->attributes['systems'][$key] = new $className($system);\n }\n } elseif($system instanceof Item) {\n $this->attributes['systems'][$key] = $system;\n }\n }\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setNivel_stgr('');\n $this->setDesc_nivel('');\n $this->setDesc_breve('');\n $this->setOrden('');\n $this->setPrimary_key($aPK);\n }", "public function initialize()\n {\n $this->belongsTo(\n 'companies_id',\n 'Canvas\\Models\\Companies',\n 'id',\n ['alias' => 'company']\n );\n\n $this->belongsTo(\n 'apps_id',\n 'Canvas\\Models\\Apps',\n 'id',\n ['alias' => 'app']\n );\n\n $this->belongsTo(\n 'users_id',\n 'Canvas\\Models\\Users',\n 'id',\n ['alias' => 'user']\n );\n\n $this->belongsTo(\n 'system_modules_id',\n 'Canvas\\Models\\SystemModules',\n 'id',\n ['alias' => 'systemModule']\n );\n\n $this->setSource('email_templates_variables');\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_region('');\n $this->setRegion('');\n $this->setNombre_region('');\n $this->setStatus('');\n $this->setPrimary_key($aPK);\n }", "public function initAttribute();", "protected function bindExisting(&$model) {\n\t\tforeach ($model->getAttributeNames() as $attribute) {\n\t\t\t// ignore id and created\n\t\t\tif ($attribute == 'id') continue;\n\t\t\tif ($attribute == 'created') continue; \n\t\t\t$model->$attribute = $this->get($attribute);\n\t\t}\n\t\treturn $model;\n\t}", "protected function initUserAttributes()\n {\n return $this->api('people/~:(' . implode(',', $this->attributeNames) . ')', 'GET');\n }", "function action_unique_attribute_list() {\n $this->layout = null;\n\n $this->model = DB::model('Model')->fetch($_REQUEST['model_id']);\n if ($this->model->value['id']) {\n $this->model->bindMany('Attribute');\n }\n }", "public function copyAttributesToKey()\n\t{\n\t\t$primarykey = $this->factory->getPrimarykey ;\n\t\tforeach( $primarykey->fields as $n=>$field )\n\t\t{\n\t\t\t$this->key[$field] = $this->$field ;\n\t\t}\n\t}", "public function fillAttributes(array $attributes = []): void\n {\n foreach ($attributes as $key => $value) {\n $this->setAttribute($key, $value);\n }\n }", "private function setAttributeFieldValue()\n {\n // Get all our attribute objects\n $proxiedAttrs = $this->getAttributes();\n \n $data = [];\n foreach ($proxiedAttrs as $attrObjArr) {\n foreach ($attrObjArr as $attrObj) {\n $dataKey = $attrObj->getFieldName();\n $dataVal = $this->getRequest()->postVar($dataKey);\n $data[$dataKey] = $dataVal;\n }\n }\n \n $json = $this->dbObject('AttributeData')->toJson($data);\n $this->setField('AttributeData', $json);\n }", "public function setAttributes($attributes){ }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "public function initialize()\n {\n $this->belongsTo(\n 'companies_id',\n Companies::class,\n 'id',\n ['alias' => 'company']\n );\n\n $this->belongsTo(\n 'apps_id',\n Apps::class,\n 'id',\n ['alias' => 'app']\n );\n\n $this->belongsTo(\n 'users_id',\n Users::class,\n 'id',\n ['alias' => 'user']\n );\n\n $this->setSource('users_associated_apps');\n }", "function setNullAllAtributes()\n {\n $aPK = $this->getPrimary_key();\n $this->setId_schema('');\n $this->setId_situacion('');\n $this->setDescripcion('');\n $this->setSuperada('');\n $this->setBreve('');\n $this->setPrimary_key($aPK);\n }", "public function run()\n {\n foreach ($this->attributes() as $attribute) {\n app('rinvex.attributes.attribute')\n ->create($attribute);\n }\n }", "function import() {\n\t\t$this->truncate();\n\t\t$snAttributes = $this->findAllSn();\n\t\tforeach ($snAttributes as $snAttribute) {\n\n\t\t\t$attributes = $this->transformSn($snAttribute);\n\n\t\t\tforeach ($attributes as $attribute) {\n\t\t\t\tif (!$this->hasAny($attribute['Attribute'])) {\n\t\t\t\t\t$this->create();\n\t\t\t\t\tif (!$this->save($attribute)) {\n\t\t\t\t\t\tdebug($attribute);\n\t\t\t\t\t\tdebug($this->validationErrors);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "protected function initializeAttributes() {\n\t\tparent::initializeAttributes();\n\n\t\t$this->attributes['subtype'] = 'procuralog';\n\t}", "public function initialize()\n {\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaExcusa', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo', 'CobActaconteo', 'id_actaconteo', array(\n 'reusable' => true\n ));\n }" ]
[ "0.7153756", "0.6827598", "0.68242425", "0.67079157", "0.65219325", "0.6507535", "0.64191866", "0.6415359", "0.63912696", "0.6379667", "0.6346426", "0.6299038", "0.6296743", "0.6274215", "0.62564826", "0.62238854", "0.62231845", "0.6215017", "0.6213479", "0.61945474", "0.615778", "0.61283106", "0.61237264", "0.610949", "0.60863984", "0.6076915", "0.607366", "0.60658073", "0.60577303", "0.600171", "0.598212", "0.59421116", "0.59361255", "0.5928104", "0.5925878", "0.5921178", "0.5920948", "0.59172046", "0.5894602", "0.5889698", "0.58800465", "0.5878996", "0.58354765", "0.58230054", "0.58040696", "0.5791195", "0.5790125", "0.57778656", "0.5775511", "0.5767954", "0.5740974", "0.57285476", "0.57205033", "0.5715397", "0.57059675", "0.57057655", "0.5703791", "0.5698774", "0.5696658", "0.5690471", "0.5685616", "0.56814605", "0.5672603", "0.5671663", "0.5671004", "0.5635174", "0.5625703", "0.56240046", "0.56235784", "0.56213063", "0.5618983", "0.5598581", "0.55926245", "0.5591275", "0.55860984", "0.5570643", "0.5566048", "0.55627507", "0.5554763", "0.55471677", "0.55471677", "0.5547053", "0.5535858", "0.553154", "0.5529535", "0.55251807", "0.55131954", "0.5513123", "0.55014277", "0.54970914", "0.5495099", "0.54916865", "0.5468723", "0.54662895", "0.54544723", "0.545341", "0.5452849", "0.5448505", "0.5445643", "0.544445" ]
0.60723084
27
to show the name of the Author in the select
public function __toString(){ return $this->nom; // to show the id in the select // return $this->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAuthorname() {}", "public function getAuthor();", "public function getAuthor();", "public function getAuthor();", "function showAuthor()\n {\n $this->out->elementStart('div', 'author');\n\n $this->out->elementStart('span', 'vcard author');\n\n $attrs = array('href' => $this->profile->profileurl,\n 'class' => 'url',\n 'title' => $this->profile->nickname);\n\n $this->out->elementStart('a', $attrs);\n $this->showAvatar();\n $this->out->text(' ');\n $user = common_current_user();\n if (!empty($user) && $user->streamNicknames()) {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->nickname);\n } else {\n $this->out->element('span',array('class' => 'fn'),\n $this->profile->getBestName());\n }\n $this->out->elementEnd('a');\n\n $this->out->elementEnd('span');\n\n $this->showAddressees();\n\n $this->out->elementEnd('div');\n }", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function getAuthorName()\n {\n return 'Fightmaster.publication.author.name';\n }", "public function getAuthor() {}", "public function get_author()\n\t{\n\t\treturn '';\n\t}", "public function getAuthorName() : void {\n\t\treturn $this->authorName;\n\t}", "public function api_getAuthorInfo($author_id = null) {\t\n\t\t$authors = $this->find('all', array(\n\t\t\t'conditions' => array('Author.author_id' => $author_id),\n\t\t\t'fields' => array('Author.document_id', 'Author.fullname'),\n\t\t\t// 'order' => array('Author.lastname' => 'asc'),\n\t\t\t// 'limit' => 3\n\t\t));\n\t\treturn $authors;\n\t}", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function authors(){\n $this->data['authors'] = $this->books_model->getAllAuthors();\n $this->render('books/authors');\n }", "function GetAuthor()\n {\n return 'calguy1000';\n }", "function getAuthors() {\n $db = getDb();\n $query = \"SELECT firstname, lastname FROM authors\";\n\n $result = mysqli_query($db, $query);\n\n if ($result = mysqli_query($db, $query)) {\n $i = 1;\n while ($row = mysqli_fetch_assoc($result)) {\n echo'<option value=\"author'.$i.'\">'.$row[\"firstname\"].\" \". $row[\"lastname\"].'</option>';\n $i++;\n }\n //uvolni pamet\n mysqli_free_result($result);\n } else {\n echo $query.PHP_EOL;\n echo mysqli_error($db);\n }\n mysqli_close($db); \n}", "function print_active_crew_select_menu( $type, $author, $id, $section, $sub ) {\n\t\n\tif( $type != \"post\" ) {\n\n\t\tif( $type == \"pm\" ) {\n\t\t\techo \"<select name='\" . $type . \"Recipient'>\";\n\t\t} else {\n\t\t\techo \"<select name='\" . $type . \"Author'>\";\n\t\t}\n\t\t\n\t\t$users = \"SELECT crew.crewid, crew.firstName, crew.lastName, rank.rankName \";\n\t\t$users.= \"FROM sms_crew AS crew, sms_ranks AS rank \";\n\t\t$users.= \"WHERE crew.crewType = 'active' AND crew.rankid = rank.rankid ORDER BY crew.rankid\";\n\t\t$usersResult = mysql_query( $users );\n\t\t\n\t\tif( empty( $author ) ) { \n\t\t\techo \"<option value='0'>No Author Selected</option>\";\n\t\t}\n\t\t\n\t\twhile( $userFetch = mysql_fetch_assoc( $usersResult ) ) {\n\t\t\textract( $userFetch, EXTR_OVERWRITE );\n\t\t\t\t\n\t\t\tif( $author == $userFetch['crewid'] ) {\n\t\t\t\techo \"<option value='$author' selected>$rankName $firstName $lastName</option>\";\n\t\t\t} else {\n\t\t\t\techo \"<option value='$userFetch[crewid]'>$rankName $firstName $lastName</option>\";\n\t\t\t}\n\t\t}\n\t\n\techo \"</select>\";\n\t\n\t} elseif( $type == \"post\" ) {\n\t\t\n\t\t$authorArray = explode( \",\", $author );\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach( $authorArray as $key=>$value ) {\n\t\t\t\n\t\t\techo \"<select name='\" . $type . \"Author\" . $i . \"'>\";\n\t\t\t\n\t\t\t$users = \"SELECT crew.crewid, crew.firstName, crew.lastName, rank.rankName \";\n\t\t\t$users.= \"FROM sms_crew AS crew, sms_ranks AS rank \";\n\t\t\t$users.= \"WHERE crew.crewType = 'active' AND crew.rankid = rank.rankid ORDER BY crew.rankid\";\n\t\t\t$usersResult = mysql_query( $users );\n\t\t\t\n\t\t\twhile( $userFetch = mysql_fetch_assoc( $usersResult ) ) {\n\t\t\t\textract( $userFetch, EXTR_OVERWRITE );\n\t\t\t\t\n\t\t\t\tif( in_array( $authorArray[$i], $userFetch ) ) {\n\t\t\t\t\techo \"<option value='$authorArray[$i]' selected>$rankName $firstName $lastName</option>\";\n\t\t\t\t} else {\n\t\t\t\t\techo \"<option value='$userFetch[crewid]'>$rankName $firstName $lastName</option>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\techo \"</select>\";\n\t\t\t\n\t\t\t/*\n\t\t\t\tif there are less than 8 array keys, allow a user to add another one\n\t\t\t\tif there is a second array key, allow a user to delete a user, otherwise don't\n\t\t\t*/\n\t\t\tif( $i < JP_AUTHORS ) {\n\t\t\t\techo \"&nbsp;&nbsp;\";\n\t\t\t\t\n\t\t\t\tif(isset($_GET['id']))\n\t\t\t\t{\n\t\t\t\t\t$href = WEBLOC . \"admin.php?page=\" . $section . \"&sub=\" . $sub . \"&id=\" . $_GET['id'] . \"&add=1&postid=\" . $id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$href = WEBLOC . \"admin.php?page=manage&sub=posts&add=1&postid=\" . $id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo \"<a href='\" . $href . \"' class='add_icon image'>&nbsp;&nbsp;&nbsp;&nbsp;</a>\";\n\t\t\t\t\n\t\t\t} if( array_key_exists( \"1\", $authorArray ) ) {\n\t\t\t\techo \"&nbsp;\";\n\t\t\t\t\n\t\t\t\tif(isset($_GET['id']))\n\t\t\t\t{\n\t\t\t\t\t$href2 = WEBLOC . \"admin.php?page=\" . $section . \"&sub=\" . $sub . \"&id=\" . $_GET['id'] . \"&delete=\" . $i . \"&postid=\" . $id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$href2 = WEBLOC . \"admin.php?page=\" . $section . \"&sub=\" . $sub . \"&delete=\" . $i . \"&postid=\" . $id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo \"<a href='\" . $href2 . \"' class='remove_icon image'>&nbsp;&nbsp;&nbsp;&nbsp;</a>\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/* as long as $i is under 7, keep adding 1 to it */\n\t\t\tif( $i < JP_AUTHORS ) {\n\t\t\t\t$i = $i +1;\n\t\t\t}\n\t\t\t\n\t\t\techo \"<br />\\n\";\n\t\t\t\n\t\t}\n\t\t\n\t\t/* count the number of items in the array */\n\t\t$authorCount = count( $authorArray );\n\t\t\n\t\t/* return the array count to be used to put the author string together */\n\t\treturn $authorCount;\n\t\t\n\t}\n\t\n}", "public function get_authors();", "public function author() : string\n {\n if (isset($this->entity->author)) {\n return $this->entity->author->name;\n }\n\n return 'Sin autor';\n }", "public function getAuthorLabel()\n {\n return (string) $this->_theme->themeAuthor->authorLabel;\n }", "abstract public function getAuthor();", "public function getAuthorName()\n\t{\n\t\tif(is_null($this->_authorName)){\n\t\t\t$this->loadData();\n\t\t}\n\t\treturn $this->_authorName;\n\t}", "function get_name_select_edit()\n\t{\n\t\treturn $this->name;\n\t}", "public function getHeaderText() \n {\n\tif ($this->_coreRegistry->registry('simpleblog_author')->getId()) \n\t{\n\t\t return __(\"Edit Author '%1'\", $this->escapeHtml($this->_coreRegistry->registry('simpleblog_author')->getTitle()));\n\t} else { return __('New Author'); }\n\t\n }", "public function author();", "public function getAuthor() {\n return $this->randomQuote->author_name;\n }", "public function __toString(){\n // to show the fullname of the User in the select\n return $this->code;\n // to show the id of the Category in the select\n // return $this->id;\n }", "public function author()\n {\n $this->renderView('author.twig',['articleList' => $this->articleList]);\n }", "function GetAuthor()\n {\n return 'texus';\n }", "public function find_authors(){\n //return $query;\n $this->db->select('name_chn');\n $query=$this->db->get('users');\n return $query;\n }", "public function getAuthor() \r\n { \r\n return $this->_author; \r\n }", "function get_author_name($auth_id = \\false)\n {\n }", "public function authorList()\n\t{\n\t\t$authors = ee('Member')->getAuthors(ee('Request')->get('search'));\n\n\t\tif (AJAX_REQUEST)\n\t\t{\n\t\t\treturn ee('View/Helpers')->normalizedChoices($authors);\n\t\t}\n\n\t\treturn $authors;\n\t}", "public function getFullName() {\r\n $authors = $this->getAuthors();\r\n foreach ($authors as $author) {\r\n echo $author->first_name . ' ' . $author->last_name .'<br>';\r\n }\r\n }", "public function getAuthor(): string\n {\n return $this->_author;\n }", "public function author()\n {\n if ($this->user_id) {\n $field = config(\"binshopsblog.comments.user_field_for_author_name\",\"name\");\n return optional($this->user)->$field;\n }\n\n return $this->author_name;\n }", "public function getAuthorcompany() {}", "function print_author_tag() {\n\t\t\n\t\techo \"<meta name='author' content='{$this->options->site_author}' />\\r\\n\";\n\t}", "public function getAuthorName()\n {\n if ($this->Name) {\n return $this->Name;\n } elseif ($author = $this->Author()) {\n return $author->getName();\n }\n }", "public static function getAuthorDisplayName(Author $author): string {\n if (!empty($author->last_name)) {\n $name = $author->last_name;\n if (!empty($author->initials)) {\n $name .= ' ' . $author->initials;\n }\n }\n else {\n $name = $author->collective_name;\n }\n return $name;\n }", "public function authors_tab_content() {\n\t\techo '<h2>Authors</h2>';\n\t\t$content = get_post_meta( get_the_ID(), 'authordesc', true );\n\t\t$content = htmlspecialchars_decode( $content );\n\t\t$content = wpautop( $content );\n\t\techo $content;\n\t}", "public function get_sidebar_authors() {\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>{{author-title}}:</td></tr>';\n\n /** Use default WordPress Post author. */\n $post = get_post();\n $author = get_the_author_meta( 'display_name', $post->post_author );\n $html .= '<tr class=\"wm-widget-info\"><td>' . $author . '</td></tr>';\n /** Replace the author title to be singular. */\n $html = str_replace( '{{author-title}}', 'Author', $html );\n\n return $html;\n }", "public function show()\n {\n return view('authors.add_author');\n }", "function caldol_modify_author_display_name($author_name, $reply_id){\n\t$author_name = $author_name . \"\";\nreturn $author_name;\n\n}", "public function testSearchBookHasInputValueSelectAuthor()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/books')\n ->resize(1200,1600)\n ->assertSee('List Books')\n ->type('search', 'Pytago')\n ->select('filter', 'author')\n ->click('#btn-search')\n ->visit('/admin/books?search=Pytago&filter=author')\n ->assertQueryStringHas('search', 'Pytago')\n ->assertQueryStringHas('filter', 'author');\n $elements = $browser->elements('#list-books tbody tr');\n $this->assertCount(1, $elements);\n });\n }", "public function authors_name() {\n $authors = $this -> author;\n $res = [];\n\n foreach($authors as $author) {\n array_push($res, $author->name . ' ' . $author -> surname);\n }\n\n return $res;\n }", "function column_author( $item ) {\r\n\t\t$user = get_user_by( 'id', $item->post_author );\r\n\r\n\t\tif ( isset( $user->data->display_name ) ) {\r\n\t\t\treturn sprintf( '<a href=\"%s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' ' . __( 'Author', 'media-library-assistant' ) . '\">%s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t 'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'author' => $item->post_author,\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'Author', 'media-library-assistant' ) . ': ' . $user->data->display_name ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), esc_html( $user->data->display_name ) );\r\n\t\t}\r\n\r\n\t\treturn 'unknown';\r\n\t}", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "public function author() {\n\t\t\t\n\t\t\t$output = array();\n\n\t\t\t$author = $this->post->post_author;\n\t\t\t\n\t\t\t$output['id'] = $author;\n\t\t\t$output['nicename'] = get_the_author_meta('nickname', $author);\n\t\t\t$output['name'] = get_the_author_meta('user_firstname', $author).' '.get_the_author_meta('user_lastname', $author);\n\t\t\t$output['url'] = get_author_posts_url($author);\n\t\t\t$output['description'] = get_the_author_meta('description', $author);\n\t\t\t\n\t\t\treturn $output;\n\t\t}", "public function author()\n {\n return optional($this->author);\n }", "public function ViewAction()\r\n\t{\r\n\t\t$this->View->author = $this->Author->select();\r\n\t}", "function nb_get_author_name( $object, $field_name, $request ) {\n return get_the_author_meta( 'display_name', $object['author'] );\n}", "function getAuthor() \n\t{\n\t\t$author = array();\n\t\tinclude_once \"./Services/MetaData/classes/class.ilMD.php\";\n\t\t$md =& new ilMD($this->getId(), 0, $this->getType());\n\t\t$md_life =& $md->getLifecycle();\n\t\tif ($md_life)\n\t\t{\n\t\t\t$ids =& $md_life->getContributeIds();\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$md_cont =& $md_life->getContribute($id);\n\t\t\t\tif (strcmp($md_cont->getRole(), \"Author\") == 0)\n\t\t\t\t{\n\t\t\t\t\t$entids =& $md_cont->getEntityIds();\n\t\t\t\t\tforeach ($entids as $entid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$md_ent =& $md_cont->getEntity($entid);\n\t\t\t\t\t\tarray_push($author, $md_ent->getEntity());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn join($author, \",\");\n }", "public function wxr_authors_list()\n {\n $db = Typecho_Db::get();\n $dbPrefix = $db->getPrefix();\n\n $user_table = $dbPrefix . 'users';\n $authors = $db->fetchAll($db->query(\"select uid,name,mail from {$user_table} where activated != 0\"));\n $html = '';\n foreach ( $authors as $author ) {\n $html .= \"\\t<wp:author>\";\n $html .= '<wp:author_id>' . $author['uid'] . '</wp:author_id>';\n $html .= '<wp:author_login>' . $author['name'] . '</wp:author_login>';\n $html .= '<wp:author_email>' . $author['mail'] . '</wp:author_email>';\n $html .= '<wp:author_display_name>' . $this->wxr_cdata($author['name']) . '</wp:author_display_name>';\n $html .= '<wp:author_first_name>' . $this->wxr_cdata('') . '</wp:author_first_name>';\n $html .= '<wp:author_last_name>' . $this->wxr_cdata('') . '</wp:author_last_name>';\n $html .= \"</wp:author>\\n\";\n }\n return $html;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthors();", "public function __toString()\n {\n return $this->username;\n // to show the id of the Category in the select\n // return $this->id;\n }", "public function get_author_permastruct()\n {\n }", "function hc_author_field($field , $gravatarSize = ''){\n\t\t$info = hc_get_author_field($field , $gravatarSize);\n\t\techo $info;\n\t}", "function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}", "public function show(Author $author)\n {\n //\n }", "function voyage_mikado_get_the_author_name() {\n if(get_the_author_meta('first_name') !== '' || get_the_author_meta('last_name') !== '') {\n $name = get_the_author_meta('first_name').' '.get_the_author_meta('last_name');\n } else {\n $name = get_the_author_meta('display_name');\n }\n\n return $name;\n }", "function select() {\n // TODO: clb.organization_name should only be selected if a primary relationship exists.\n return \"\n contact_a.id AS contact_id,\n contact_a.last_name,\n contact_a.first_name,\n contact_a.preferred_language,\n ca.street_address as contact_street_address,\n ca.postal_code as contact_postal_code,\n ca.city as contact_city,\n cc.name as contact_country,\n email,\n phone,\n clb.organization_name\n \";\n }", "function medigroup_mikado_get_the_author_name() {\n if(get_the_author_meta('first_name') !== '' || get_the_author_meta('last_name') !== '') {\n $name = get_the_author_meta('first_name').' '.get_the_author_meta('last_name');\n } else {\n $name = get_the_author_meta('display_name');\n }\n\n return $name;\n }", "function getAuthorsName(int $articleAuthorId, array $authors) : string { \n foreach ($authors as $author) {\n if ($author['id'] === $articleAuthorId) {\n $name = $author['full_name'];\n }\n }\nreturn $name;\n}", "public function meta_author_name()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}", "public function get_author() {\n\t\treturn $this->author();\n\t}", "public function getByAuthor()\n {\n return $this->by_author;\n }", "function get_the_author_firstname()\n {\n }", "public function getAuthor($index = 0);", "function makeEditableAuthorList($authors) {\t\t\n\t\treturn \"\n\t\t\t<div id='authorlist' class='authorlist'>\n\t\t\t\t\".$this->makeAuthorList($authors).\"\t\t\t\n\t\t\t</div>\n\t\t\n\t\t\";\n\t}", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthorID();", "function the_author_firstname()\n {\n }", "public function getAuthor() {\n\t\treturn $this->author;\n\t}", "function get_author_link($display, $author_id, $author_nicename = '')\n {\n }", "public function getAuthor() {\n\t\treturn UserManager::getFromBlid($this->blid);\n\t}", "public function __toString(){\n return $this->name;\n // to show the id of the Category in the select\n // return $this->id;\n }", "public function __toString(){\n return $this->name;\n // to show the id of the Category in the select\n // return $this->id;\n }", "public function gettodoAuthor(): string {\n\t\treturn $this->todoAuthor;\n\t}", "public function getAuthor($encoding = 'UTF-8') {}", "public function getAuthorUsername()\n {\n return $this->AUTHOR_USERNAME;\n }", "public function getAuthorId() : string\n {\n return $this->authorId;\n }", "function get_student_name($class_id)\n\t\t{\n\t\t\t$get_student_list = $this->db->get_where('student' , array('class_id' => $class_id))->result_array();\n\t\t\techo '<option value=\"\">Select student</option>';\n\t\t\tforeach ($get_student_list as $row_value)\n\t\t\t{\n\t\t\t\techo '<option value=\"' . $row_value['name'].' '.$row_value['father_name'].'\">' . $row_value['name'] . '</option>';\n\t\t\t}\n\t\t}", "function get_the_author_aim()\n {\n }", "function makeAuthorList($authors) {\n\t\t$alist = \"\n\t\t\t\t<input type='hidden' name='authors' id='authors' value=\\\"\".implode(\",\",$authors).\"\\\" />\n\t\t\t\t<ul class='memberlist_s'>\\n\";\n\t\t$udata = $this->getUserData($authors, array('FirstName','ProfilePicture'));\n\t\tforeach ($udata as $user_id => $u) {\t\t\t\n\t\t\t$alist .= '\n\t\t\t\t<li>\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t<img src=\"'.$u['ProfilePicture']['SmallThumb'].'\" style=\"width:30px;\" />\n\t\t\t\t\t</td><td>\n\t\t\t\t\t<div style=\"padding:2px;\">'.$u['FirstName'].'</div>\n\t\t\t\t\t<div style=\"padding:2px;\"><a href=\"#\" style=\"background:url(/images/famfamfam_mini/action_stop.gif) no-repeat left;padding:2px 2px 2px 18px;\" onclick=\"removeAuthor('.$user_id.'); return false;\">Fjern</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t</li> ';\n\t\t}\n\t\t$alist .= '\n\t\t\t\t</ul>\n\t\t\t\t';\n\t\treturn $alist;\n\t}" ]
[ "0.7014085", "0.66192245", "0.66192245", "0.66192245", "0.66046005", "0.65311795", "0.65311795", "0.6528419", "0.65102595", "0.650702", "0.64678055", "0.64211965", "0.6418339", "0.64004564", "0.64004564", "0.64004564", "0.64004564", "0.64004564", "0.64004564", "0.6358231", "0.6353314", "0.63213843", "0.63068146", "0.6304885", "0.6304283", "0.6298051", "0.62636477", "0.6217328", "0.6209608", "0.62006485", "0.619811", "0.6197826", "0.6192374", "0.61895555", "0.6184698", "0.6177841", "0.6153655", "0.61305183", "0.61176515", "0.61126536", "0.60946673", "0.60885805", "0.60580873", "0.6037131", "0.60351264", "0.6032", "0.60263234", "0.60168576", "0.6015617", "0.60137767", "0.5996199", "0.59777546", "0.5960054", "0.59510493", "0.59445673", "0.5932091", "0.5920352", "0.59183407", "0.59162617", "0.5910266", "0.5910234", "0.5910234", "0.5910234", "0.5910234", "0.5910234", "0.5910234", "0.5910234", "0.5910234", "0.5908253", "0.58928543", "0.5877137", "0.5875571", "0.58710134", "0.5870781", "0.5867506", "0.5860572", "0.5856327", "0.5846195", "0.5840495", "0.58277667", "0.5827431", "0.5824897", "0.5820284", "0.5819545", "0.5817708", "0.5817708", "0.5817708", "0.57798904", "0.5765058", "0.5756292", "0.5754172", "0.5745917", "0.57376647", "0.57376647", "0.5730812", "0.5729966", "0.57198197", "0.57143927", "0.5713815", "0.5713453", "0.5708336" ]
0.0
-1
Resolves the components which calls their init methods automatically
public function initialiseComponentsAndServices() { $this->imager; $this->imageOptimize; $this->staticCache; $this->csrfInjection; $this->assetsPlatform; $this->cpAlerts; $this->redisDebug; $this->localDev; $this->feedMe; $this->blitz; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init()\r\n {\r\n //Copy components to comps, so you can alter components properties\r\n //on init() methods\r\n $comps=$this->components->items;\r\n //Calls children's init recursively\r\n reset($comps);\r\n while (list($k,$v)=each($comps))\r\n {\r\n $v->init();\r\n }\r\n }", "private function initDependencies()\n {\n // == HTML ==========================================================\n $this->di->mapService('core.html.factory', '\\Core\\Html\\HtmlFactory');\n\n // == AJAX ==========================================================\n $this->di->mapService('core.ajax', '\\Core\\Ajax\\Ajax');\n }", "protected function initContainer(): void\n {\n // reserve some ids\n $this->reserveObject('config', $this->getConfig());\n $this->reserveObject('container', $this->delegator);\n\n // resolve all objects defined in di.services\n $this->autoResolve();\n\n // resolve all object referenced in the $config\n $tree = $this->getConfig()->getTree();\n $settings = &$tree->get('');\n $this->deReference($settings);\n }", "public function init() {\n\n // Set required classes for import.\n $this->setImport(array(\n $this->id . '.components.*',\n $this->id . '.components.behaviors.*',\n $this->id . '.components.dataproviders.*',\n $this->id . '.controllers.*',\n $this->id . '.models.*',\n ));\n\n // Set the required components.\n $this->setComponents(array(\n 'authorizer' => array(\n 'class' => 'RAuthorizer',\n 'superuserName' => $this->superuserName,\n ),\n 'generator' => array(\n 'class' => 'RGenerator',\n ),\n ));\n }", "public function init_component_loaders () {\n\t\t$this->load_active_components( 'bundled' );\n\t\t$this->load_active_components( 'downloadable' );\n\t}", "public function init()\n\t{\n\t\t$this->resolvePackagePath();\n\t\t$this->registerCoreScripts();\n\t\tparent::init();\n\t}", "public function init()\n {\n $this->addComponent(CartComponent::class, 'cart', ['showDiscountApplier' => false]);\n $this->addComponent(AddressSelector::class, 'billingAddressSelector', ['type' => 'billing']);\n $this->addComponent(AddressSelector::class, 'shippingAddressSelector', ['type' => 'shipping']);\n $this->addComponent(ShippingMethodSelector::class, 'shippingMethodSelector', ['skipIfOnlyOneAvailable' => true]);\n $this->addComponent(PaymentMethodSelector::class, 'paymentMethodSelector', []);\n $this->setData();\n }", "public function initCustomComponents()\n {\n $components = $this->_initComponents();\n $components = apply_filters(\n 'helsingborg-h22/visual-composer/register-components',\n $components\n );\n foreach ($components as $path => $component) {\n if (\n isset($component['componentName']) &&\n isset($component['namespace'])\n ) {\n require_once $path . '/' . $component['componentName'] . '.php';\n $class = $component['namespace'];\n $class = apply_filters(\n 'helsingborg-h22/visual-composer/init-class-component/' .\n strtolower($component['componentName']),\n $class,\n $component,\n $path\n );\n new $class();\n }\n }\n }", "static function initComponents()\n {\n foreach(self::$components as $component) {\n if ($component['simple'])\n continue;\n\n $file_model = \"components/{$component['component']}/{$component['component']}.model.php\";\n $file_init = \"components/{$component['component']}/{$component['component']}.init.php\";\n if (file_exists($file_init)) {\n require_once ($file_init);\n } else {\n trigger_error(\"File of Init not exists\", E_USER_ERROR);\n }\n if (file_exists($file_model)) {\n require_once ($file_model);\n }\n\n if(method_exists(\"Init{$component['component']}\",$component['view']))\n call_user_func(array(\"Init{$component['component']}\", $component['view']));\n }\n }", "protected function _init()\n\t{\n\t\t// inicializando controladores auxiliares\n\t\t$this->_initControllers();\n\t\t\n\t\treturn;\n\t}", "public function __construct()\n {\n $this->propertyHandler = container_resolve(PropertyHandler::class, [$this]);\n $this->relationHandler = container_resolve(RelationHandler::class, [$this]);\n $this->actionHandler = container_resolve(ActionHandler::class, [$this]);\n }", "protected function configureComponents()\n {\n $this->callAfterResolving(BladeCompiler::class, function () {\n Blade::component('sunfire-base-input-container', 'sunfire-base-input-container');\n });\n }", "public function init()\n {\n /*\n * service component, data provider\n */\n // parent::init();\n }", "public static function Initialize() {\n\n Debugger::debugMessage('Registering components register');\n self::ComponentsRegister();\n }", "public function initialize()\n {\n $autoloader = $this->registerAutoloader();\n $this->registerPlugins($autoloader);\n }", "protected abstract function init();", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function _init()\n {\n }", "public function init()\n {\n $this->loadThemeComponent();\n $this->loadConfig();\n }", "public function init()\n {\n // TODO: initialize by config ordering\n foreach ($this->plugins as $name => $plugin) {\n $plugin->init();\n }\n }", "public function _init(){}", "public function _init() {}", "abstract protected function _init();", "abstract protected function _init();", "protected function initializeContainer()\n {\n $this->container = $this->buildContainer();\n\n // Load all the default services\n $this->getContainerLoader($this->container)->load('services.xml');\n\n $this->container->compile();\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}", "public function init()\n\t{\t\t\n\t\tforeach( (array) $this->args as $id => $args ) :\n\t\t\t$this->Register( $id, $args );\n\t\tendforeach;\n\t}", "protected function _init()\n {\n }", "function init() {\n $this->add(\\JQuery::JS);\n $this->add(\\Bootstrap::JS);\n $this->add(\\JQuery::CONFIG);\n $this->add(\\JQuery::UI);\n $this->add(\\JQuery::INHERIT);\n $this->add(\\JQuery::TIMER);\n $this->addComponent(\\Dialog::OBJECT);\n $this->addComponent(\\Notificator::OBJECT);\n $this->addComponent(\\Tooltip::OBJECT);\n $this->addComponent(\\Form::OBJECT);\n $this->addComponent(\\Grid::OBJECT);\n $this->addComponent(\\Tabs::OBJECT);\n $this->addComponent(\\Wizard::OBJECT);\n $this->addComponent(\\TimelineAbstract::OBJECT);\n $this->addComponent(\\Chart::OBJECT);\n// $this->addComponent(\\Schedule::OBJECT);\n\n $this->disableCache();\n }", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "protected function initializePackageObjects() {}", "public function init()\n {\n parent::init();\n $this->initClass();\n }", "protected function onInit() {}", "protected function __onInit()\n\t{\n\t}", "public function initialize()\n\t{\n\t\tparent::initialize();\n\t\t$this->loadComponent('Paginator');\n\t\t$this->loadComponent('Flash'); // Inclusion of the FlashComponent\n\n\n\t}", "public function init(){\n $this->container = new Container;\n $this->statistic = $this->container->get('common\\repositories\\StatisticRepository');\n }", "private function init()\n\t{\n\t\tforeach (isLoadedClass() as $objName)\n\t\t{\n\t\t\t$this->$objName =& loadClass('', '', $objName);\n\t\t}\n\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'common.components.*',\n\t\t));\n\t}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "public function init()\n {\n $this->config = Yii::app()->params['CaseSearch'];\n $dependencies = array(\n 'OECaseSearch.models.*',\n 'OECaseSearch.components.*',\n );\n foreach ($this->config['parameters'] as $module => $paramList)\n {\n if ($module !== 'core')\n {\n $dependencies = array_merge($dependencies, array(\n \"$module.models.*\",\n ));\n }\n }\n $this->setImport($dependencies);\n\n // Initialise the search provider/s.\n foreach ($this->config['providers'] as $providerID => $searchProvider)\n {\n $this->searchProviders[$providerID] = new $searchProvider($providerID);\n }\n }", "public function init() {\n\t\t$this->add_cpt_support();\n\n\t\t$this->init_components();\n\n\t\tdo_action( 'elementor/init' );\n\t}", "protected function init() {\n }", "protected function init() {\n }", "public function initialize() {\r\n\t\tparent::initialize();\r\n\t\t\r\n\t\t// load mediawiki api component\r\n\t\t$this->loadComponent( 'MediawikiAPI' );\r\n\t\t$this->loadComponent( 'PasswordGenerator' );\r\n\t\t$this->loadComponent( 'EmailSending' );\r\n\t}", "function componentBuilder() { $this->__construct(); }", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "protected function _init()\r\n\t{\r\n\t}", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init() {return;}", "function __initObjects() {\n\t\t$settings = $this->settings[$this->model->alias];\n\t\t$this->time = new TimeHelper();\n\t\t$this->solr = new Apache_Solr_Service($settings['host'], $settings['port'], $settings['path']);\n\t}", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "protected function init()\n {\n }", "public function __construct()\n {\n $this->registerBaseServiceProviders();\n\n $this->registerCoreContainerAliases();\n }", "public function _init() {\r\n\r\n }", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function initialize() {\n\t\t$this->registerMethod(\"getSettings\");\n\t\t$this->registerMethod(\"setSettings\");\n\t}" ]
[ "0.73128", "0.72632545", "0.6834717", "0.6830446", "0.67717636", "0.6696126", "0.6656841", "0.6632223", "0.66311395", "0.6588512", "0.6533613", "0.64981055", "0.6453846", "0.6427226", "0.6424599", "0.6388251", "0.6387867", "0.6387867", "0.6387867", "0.6387867", "0.63870287", "0.63870287", "0.63870287", "0.63870287", "0.63870287", "0.63870287", "0.6387023", "0.6387023", "0.63823056", "0.63776237", "0.63566023", "0.6323418", "0.631937", "0.6310855", "0.6310855", "0.6308261", "0.63005537", "0.62967205", "0.6290215", "0.6286011", "0.62850624", "0.62755144", "0.62755144", "0.62755144", "0.62755144", "0.62755144", "0.62755144", "0.6250042", "0.6250036", "0.6240648", "0.62387294", "0.62379634", "0.6230596", "0.62209153", "0.6216919", "0.62144184", "0.62144184", "0.62144184", "0.62144184", "0.61985415", "0.61968726", "0.6185715", "0.6185715", "0.6173488", "0.6171141", "0.6170625", "0.616638", "0.61545134", "0.61545134", "0.61545134", "0.6151285", "0.6151092", "0.6130017", "0.6130017", "0.6130017", "0.6130017", "0.6130017", "0.6126942", "0.61144024", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.61117136", "0.6111704", "0.6111704", "0.6111704", "0.6111704", "0.6111704", "0.6106786" ]
0.7182063
2
Create new Resource instance from HTTP response.
public static function createFromResponse(ResponseInterface $response, ApiProviderInterface $api, ApiResourceInterface $owner = null) { $data = json_decode((string) $response->getBody(), true); return new static($api, $data, $owner); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createResourceObject(array $response): BaseResource\n {\n return new Ticket($this->client, $response, $this->invoiceId);\n }", "public function deserializeResponse(string $response): Response;", "public static function create(\\GuzzleHttp\\Psr7\\Response $response)\n {\n // - validate body\n $data = json_decode($response->getBody(), true, 512, JSON_BIGINT_AS_STRING);\n if (empty($data)) {\n throw new ApiException('Invalid response body');\n }\n // - validate internal data\n if (isset($data['status'])) {\n if ($data['status'] != 0) {\n throw new ApiException('Remote error: ' .\n (isset($data['status_message']) ? $data['status_message'] : '-'),\n $data['status']);\n }\n $item = new self();\n $item->data = $data;\n return $item;\n }\n throw new ApiException('Invalid response json');\n }", "public function createFromResponse(): Article\n {\n return new Article((array) $this);\n }", "public function __construct($response)\n {\n $this->address = $response['address'];\n $this->url = $response['url'];\n $this->id = $response['id'];\n }", "public function __construct(Response $response)\n {\n $decoded = json_decode($response->getBody());\n\n //If things did not go well.\n if ($response->getStatusCode() >= 400 && $response->getStatusCode() < 600) {\n $this->success = false;\n\n if (isset($decoded->error)) {\n $this->errors = $decoded->error;\n }\n\n if (!$this->errors) {\n // API calls don't always provide an error :(\n $this->errors[] = 'An error occurred, however, no error message was given. Use the response body, HTTP status code and URL to help troubleshoot the issue.';\n }\n\n //If things went well.\n } else {\n $this->body = $decoded;\n }\n\n $this->statusCode = $response->getStatusCode();\n\n //DME's request limit meta data.\n if (isset($response->getHeaders()['x-dnsme-requestId'])) {\n $this->requestId = $response->getHeaders()['x-dnsme-requestId'];\n }\n\n if (isset($response->getHeaders()['x-dnsme-requestsRemaining'])) {\n $this->requestsRemaining = $response->getHeaders()['x-dnsme-requestsRemaining'];\n }\n\n if (isset($response->getHeaders()['x-dnsme-requestLimit'])) {\n $this->requestLimit = $response->getHeaders()['x-dnsme-requestLimit'];\n }\n\n if(!$this->success){\n \tthrow new ResultErrorException($this);\n }\n }", "public static function make(Response $response)\n {\n return new static($response->response, $response->attributes);\n }", "public function parse()\r\n\t{\r\n\t\tif(is_string($this->_raw)) {\r\n\t\t\t$response = self::toArray($this->_format, $this->_raw);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$response = $this->_raw;\r\n\t\t}\r\n\r\n\t\tif(!empty($response['error_code'])) {\r\n\t\t\tthrow new MediaMonks_Service_Hyves_Response_Exception($response['error_message'], $response['error_code']);\r\n\t\t}\r\n\t\t\r\n\t\tif(null == $this->_method && !empty($response['method'])) {\r\n\t\t\t$this->_method = $response['method'];\r\n\t\t\tunset($response['method']);\r\n\t\t}\r\n\t\t\r\n\t\t$this->_info = $response['info'];\r\n\t\tunset($response['info']);\r\n\t\t\r\n\t\t$this->_body = $response;\r\n\t\t\r\n\t\t// pagination\r\n\t\tif(!empty($this->_info['totalresults'])) {\r\n\t\t\t$this->_paginated = true;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_parsed = true;\r\n\t\treturn $this;\r\n\t}", "public static function fromResponse(ResponseInterface $response)\n {\n return new static((string)$response->getBody());\n }", "public function __construct($response)\n {\n // Headers regex\n $pattern = '#HTTP/(\\d\\.\\d|\\d).*?$.*?#ims';\n\n // Extract headers from response\n preg_match_all($pattern, $response, $matches);\n\n list($headers, $body) = explode(\"\\r\\n\\r\\n\", $response, 2);\n\n $headers_string = trim(preg_replace($pattern, '', $headers));\n $parsedHeaders = $this->parseHeaders($headers_string);\n\n // Remove headers from the response body\n\n $this->body = trim(str_replace($headers, '', $response));\n // Convert headers into an associative array\n $this->headers = $parsedHeaders;\n\n // Extract the version and status from the first header\n preg_match('#HTTP/(\\d\\.\\d|\\d)\\s(\\d\\d\\d)\\s(.*)#', $response, $matches);\n\n if($matches && count($matches) >= 3){\n $this->headers['httpVersion'] = $matches[1];\n $this->headers['statusCode'] = $matches[2];\n $this->headers['status'] = $matches[2].' '.$matches[3];\n }\n\n }", "public static function fromResponse(Response $response, $partNumber = 1)\n {\n $responseUri = Url::factory($response->getEffectiveUrl());\n\n $object = new self();\n\n $object->setPartNumber($partNumber)\n ->setContentLength($response->getHeader(Header::CONTENT_LENGTH))\n ->setETag($response->getHeader(Header::ETAG))\n ->setPath($responseUri->getPath());\n\n return $object;\n }", "public static function fromBaseResponse($response)\n {\n $baseResponse = $response->baseResponse;\n\n return new static(\n new Psr7Response($baseResponse->getStatusCode(), $baseResponse->headers->all(), $baseResponse->getContent()),\n $response\n );\n }", "public function __construct($response)\n {\n $this->init($response);\n\n }", "public static function fromString($response_str)\n {\n $code = self::extractCode($response_str);\n $headers = self::extractHeaders($response_str);\n $body = self::extractBody($response_str);\n $version = self::extractVersion($response_str);\n $message = self::extractMessage($response_str);\n return new Microsoft_Http_Response($code, $headers, $body, $version, $message);\n }", "public function createResponse()\n {\n return new Response;\n }", "static function fromResponse(object $deserialized): object\n {\n $instance = self::createObject($deserialized);\n $instance->validate();\n return $instance;\n }", "public static function prepare($response)\n {\n if (! $response instanceof Response) {\n $response = new static($response);\n }\n\n return $response;\n }", "public function __construct(\\GuzzleHttp\\Message\\ResponseInterface $response)\n {\n $this->http_status = intval($response->getStatusCode());\n $this->is_error = !($this->http_status >= 200 && $this->http_status < 300);\n try {\n $this->body = $response->json();\n }\n catch (\\GuzzleHttp\\Exception\\ParseException $e) { }\n \n $this->parse();\n }", "public function __construct($response)\n {\n @list($this->rawHeaders, $this->body) = explode(\"\\r\\n\\r\\n\", $response, 2);\n\n $this->buildHeaders($this->rawHeaders);\n }", "public function __construct(Response $response)\n {\n $this->response = $response;\n }", "public static function createFromResponse(Response $response): ResponseItem\n {\n $parsedResponseBody = $response->getParsedBody();\n if (!property_exists($parsedResponseBody, 'item')) {\n throw new ResponseException('Property item not set');\n }\n\n return new static($parsedResponseBody->item);\n }", "static function parseResponse(string $data): ApiResponse\n {\n $obj = new static;\n $obj->setData($data);\n return $obj;\n }", "public function __construct($response)\n {\n $this->transformResultData($response->results);\n\n }", "protected function _getResponse() {\n\t\treturn new Response;\n\t}", "public function __construct()\n {\n $this->response = new Response();\n }", "function response() {\n return new Response;\n }", "public function __construct($response)\n {\n $this->response = $response;\n }", "public function __construct($response)\n {\n $this->response = $response;\n }", "public function __construct($response)\n {\n $this->response = $response;\n }", "public function __construct($response)\n {\n $this->response = $response;\n }", "public function __construct(HttpResponse $response)\n {\n $this->response = $response;\n }", "public function __construct(Response $guzzleResponse)\n {\n // Save the guzzle response in case an advanced user wants to access it\n $this->guzzleResponse = $guzzleResponse;\n\n // Save the response contents (because it's a stream that can't be re-read)\n $this->guzzleBody = $guzzleResponse->getBody()->getContents();\n\n // Decode the JSON response\n $content = json_decode($this->guzzleBody, true);\n\n // This will be true if there is no JSON to parse or if PHP cannot parse the\n // given JSON\n if($content == null)\n {\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'Malformed JSON response from API server'\n );\n }\n\n // Check that all required key's exist in the response\n foreach(self::REQUIRED_KEYS as $key) {\n if(!array_key_exists($key, $content))\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'API server response missing expected field: '.$key\n );\n }\n\n // Pull out generic response information\n $this->version = $content['version'];\n $this->id = $content['id'];\n $this->ts = $content['ts'];\n $this->type = $content['type'];\n\n // Check HTTP response code for problems\n $success = [200, 201];\n $error = [400, 401, 402, 404, 405, 406, 500];\n $rateLimit = 429;\n if(in_array($guzzleResponse->getStatusCode(), $success)) {\n // Check that the response type is in our type mappings\n if(array_key_exists($this->type, self::RESPONSE_TYPES)) {\n // Check that the data field is there\n if(array_key_exists($this->type, $content))\n $this->responseData = $content[$this->type];\n else\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'JSON response does not contain field of type: \"' . $this->type . '\"'\n );\n }\n else {\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'JSON response contains unknown type: \"' . $this->type . '\"'\n );\n }\n }\n else if($guzzleResponse->getStatusCode() == $rateLimit) {\n if(array_key_exists('rate_limit', $content) &&\n array_key_exists('requests', $content['rate_limit']) &&\n array_key_exists('max', $content['rate_limit']) &&\n array_key_exists('retryAfter', $content['rate_limit']))\n {\n throw new SmartwaiverRateLimitException($guzzleResponse, $this->guzzleBody, $content);\n } else {\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'Malformed rate limit response'\n );\n }\n }\n else if(in_array($guzzleResponse->getStatusCode(), $error)) {\n // Check that a message exists\n if(array_key_exists('message', $content))\n throw new SmartwaiverHTTPException($guzzleResponse, $this->guzzleBody, $content);\n // If not, throw an error, this is unexpected\n else\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'Error response does not include message'\n );\n }\n else {\n // Unknown response from the API server, throw an exception\n throw new SmartwaiverSDKException(\n $guzzleResponse,\n $this->guzzleBody,\n 'Unknown HTTP code returned: ' . $guzzleResponse->getStatusCode()\n );\n }\n }", "public function _response($response) {\n\t\treturn $this->_instance($this->_classes['response'], array(\n\t\t\t'body' => $response\n\t\t));\n\t}", "public static function response(): Response\n {\n return new Response;\n }", "public function response($result, $request)\n {\n return new RouteResource($result);\n }", "public function createResponse()\n {\n return new GuzzleResponse();\n }", "protected function createHttpResponse()\n {\n return new Response();\n }", "public function decode($response);", "private function fetchResource() {\n\t\t$ch = curl_init();\n\t\tif ((php_sapi_name() != 'cli')) {\n\t\t\tcurl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (compatible; ' . TITLE . '/' . HOST . ')');\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 30s\n\t\t$this->content = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t$this->httpCode = $info['http_code'];\n\t\t$this->contentType = $info['content_type'];\n\t\t\n\t\tif (((int) $this->httpCode) >= 400) {\n\t\t\tthrow new Exception('STATUS CODE: ' . $this->httpCode);\n\t\t}\n\t}", "public static function fromResponse(Response $response)\n {\n $responseArray = json_decode($response->getBody(), true);\n\n if (isset($responseArray['item']) === false) {\n throw new \\Exception('Missing item key in response.');\n }\n\n return new self($responseArray['item']);\n }", "public static function fromResponse(Response $response)\n {\n $responseArray = json_decode($response->getBody(), true);\n\n if (isset($responseArray['item']) === false) {\n throw new \\Exception('Missing item key in response.');\n }\n\n return new self($responseArray['item']);\n }", "public static function fromResponse(Response $response)\n {\n $responseArray = json_decode($response->getBody(), true);\n\n if (isset($responseArray['item']) === false) {\n throw new \\Exception('Missing item key in response.');\n }\n\n return new self($responseArray['item']);\n }", "public static function fromResponse(Response $response, string $class): static\n {\n $collection = static::make($response->json('data'))->mapInto($class);\n\n if ($links = $response->json('links')) {\n $collection->setLinks($links);\n }\n\n if ($meta = $response->json('meta')) {\n $collection->setMeta($meta);\n }\n\n return $collection;\n }", "public function __construct(Object $response)\n {\n $this->_response = $this->parseResponseToXML($response);\n }", "public function parseResponse($response) {\n $this->_rawresponse = $response;\n $_response = new Payment_Response($this);\n $this->_response = $_response;\n return $this;\n }", "protected function getResponse(): Response\n {\n return new Response(fopen('data://text/plain,', 'rb'), 200);\n }", "protected function asObject()\n\t{\n\t\treturn \\json_decode($this->response);\n\t}", "protected function parseResponse()\n {\n // get the status code from response.\n $statusCode = $this->httpResponse->getStatusCode();\n\n // set as error, if http status code is not between 200 and 299 (inclusive).\n $this->networkError = !($statusCode >= 200 && $statusCode <= 299);\n\n // decode the response body.\n $body = $this->decodeBody();\n\n // stop when no body is present.\n if ($body) {\n // parse the response id from the body.\n $this->id = (int) array_get($body, 'id', null);\n\n // set as error when there is a an error key and it's not null.\n $this->isError = array_get($body, 'error', null) !== null;\n\n // parse the response data, from result or error.\n $this->data = collect(array_get($body, $this->isError ? 'error' : 'result', []));\n }\n\n // just return the response body.\n return $this->body;\n }", "public function createResponse(): IResponse;", "abstract protected function createResponse(GuzzleResponse $response);", "public function test_can_create_psr7_response(): void {\n\n\t\t$response = HTTP_Helper::response( array( 'key' => 'test_VALUE' ), 500 );\n\n\t\t$body = json_decode( (string) $response->getBody(), true );\n\n\t\t$this->assertInstanceOf( ResponseInterface::class, $response );\n\t\t$this->assertIsArray( $body );\n\t\t$this->assertArrayHasKey( 'key', $body );\n\t\t$this->assertEquals( 'test_VALUE', $body['key'] );\n\t\t$this->assertEquals( 500, $response->getStatusCode() );\n\t}", "public function toObject(): object\n {\n $body = (string) $this->response->getBody();\n\n return json_decode($body) ?? (object) [];\n }", "public static function newInstance($class)\r\n {\r\n // the class exists\r\n $object = new $class();\r\n\r\n if (!($object instanceof sfResponse))\r\n {\r\n // the class name is of the wrong type\r\n $error = 'Class \"%s\" is not of the type sfResponse';\r\n $error = sprintf($error, $class);\r\n\r\n throw new sfFactoryException($error);\r\n }\r\n\r\n return $object;\r\n }", "public function response($result, $request)\n {\n if (! $result) {\n return $this->errorNotFound();\n }\n\n return new RouteResource($result);\n }", "public function response($result, $request)\n {\n if (! $result) {\n return $this->errorNotFound();\n }\n\n return new RouteResource($result);\n }", "public function __construct($response) {\n\t\t$this->response = $response;\n\t\t$this->csv = $response->getBody();\n\t}", "public static function create(ResponseInterface $response): ResponseInterface\n {\n $handler = new static(\n $response->getStatusCode(),\n $response->getHeaders(),\n $response->getBody(),\n $response->getProtocolVersion(),\n $response->getReasonPhrase()\n );\n\n if ($handler instanceof Parsable) {\n $handler->parse();\n }\n\n return $handler;\n }", "private function createResponse($curl, $raw)\n {\n // fixes bug https://sourceforge.net/p/curl/bugs/1204/\n $version = curl_version();\n if (version_compare($version['version'], '7.30.0', '<')) {\n $pos = strlen($raw) - curl_getinfo($curl, CURLINFO_SIZE_DOWNLOAD);\n } else {\n $pos = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n }\n\n list($statsLine, $headers) = $this->parseHeaders(rtrim(substr($raw, 0, $pos)));\n $body = strlen($raw) > $pos ? substr($raw, $pos) : '';\n if (!preg_match('|^HTTP/([12].[01]) ([1-9][0-9][0-9]) (.*?)$|', $statsLine, $matches)) {\n throw new HttpException('Not a HTTP response');\n }\n\n return MessageFactoryDiscovery::find()->createResponse((int) $matches[2], $matches[3], $headers, $body, $matches[1]);\n }", "public function __construct($response){\n \n $this->_helper = new Helper();\n \n $this->_response = $response;\n \n }", "public static function createFromResponse(ResponseInterface $response, Throwable $previous = null): self\n {\n $object = static::parseResponseBody($response);\n\n if (static::isErrorApiResponse($object)) {\n switch ($object->status_code) {\n case self::ACCESS_RESTRICTED_STATUS:\n return new AccessRestrictedException('Access restricted for this origin.', $response->getStatusCode(), $response, $previous);\n\n case self::INVALID_API_KEY_STATUS:\n return new InvalidApiKeyException('Invalid API key provided.', $response->getStatusCode(), $response, $previous);\n\n case self::REVOKED_API_KEY_STATUS:\n return new RevokedApiKeyException('Provided API key revoked.', $response->getStatusCode(), $response, $previous);\n\n case self::ZERO_RESULTS_STATUS:\n return new ZeroResultsException('No results found.', $response->getStatusCode(), $response, $previous);\n\n case self::QUOTA_REACHED_STATUS:\n return new QuotaReachedException('No requests left, consider upgrading.', $response->getStatusCode(), $response, $previous);\n\n case self::OUT_OF_RANGE_STATUS:\n return new OutOfRangeException('Provided coordinate not in range.', $response->getStatusCode(), $response, $previous);\n\n case self::INVALID_REQUEST_STATUS:\n return new InvalidRequestException('Invalid parameters provided.', $response->getStatusCode(), $response, $previous);\n }\n }\n\n switch ($response->getStatusCode()) {\n case 400:\n return new BadRequestException('Bad request.', $response->getStatusCode(), $response, $previous);\n\n case 401:\n return new UnauthorizedException('Unauthorized.', $response->getStatusCode(), $response, $previous);\n\n case 403:\n return new AccessDeniedException('Access denied.', $response->getStatusCode(), $response, $previous);\n\n case 404:\n return new PageNotFoundException('Not found.', $response->getStatusCode(), $response, $previous);\n\n case 500:\n return new ServerErrorException('Server error.', $response->getStatusCode(), $response, $previous);\n }\n\n return new static('API Error.', $response->getStatusCode(), $response, $previous);\n }", "public function response($response)\n {\n\n return new Response($response);\n\n }", "public function __construct( $response, WC_Order $order = null ) {\n\n\t\t// URL decode the response string and parse it\n\t\tparse_str( urldecode( $response ), $this->parameters );\n\t}", "abstract protected function createResource();", "public function __construct()\n {\n return response([],400);\n }", "function __construct(ResourceObject $resource, HTTPRequest $request, HTTPResponse $response) {\n\t\tparent::__construct($resource, $request, $response);\n\n\t\t// prevent warning in litmus check 'delete_fragment'\n\t\tif (strpos($request->uri->get(), '#'))\n\t\t\tthrow new HTTPStatusException(400);\n\n\t\t#[TODO] check authorization\n\t\t#[TODO] also, no auth check on OPTIONS on '/', for silly reasons\n\t\t\n\t\t// check If: header\n\t\tif (!WebDAV::checkIfHeaderConditions($this->request, $this->response))\n\t\t\tthrow HTTPStatusException(412);\n\t}", "function fuel(){\n $Resource = new Resource($this->con);\n $Resource->fromCode('HE3');\n return $Resource;\n }", "public function __construct($response)\n\t{\n\t\tif ($response) {\n\n\t\t\t// Split Array\n\t\t\t$this->response = $response;\n\t\t\tparse_str($response, $this->_response_array);\n\n\t\t\t// Set response fields\n\t\t\tforeach($this->_response_array as $key => $value) {\n\t\t\t\t$key = strtolower($key);\n\t\t\t\tif ($key == 'ack') $this->status = $value;\n\t\t\t\telse if (preg_match('/l_(errorcode|shortmessage|longmessage)([0-9]+)/', $key, $matches)) {\n\t\t\t\t\tif ($this->_response_array['L_SEVERITYCODE' . $matches[2]] == 'Error') $this->errors[$matches[2]][$matches[1]] = $value;\n\t\t\t\t\telse $this->warnings[$matches[2]][$matches[1]] = $value;\n\t\t\t\t}\n\t\t\t\telse $this->{$key} = $value;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this->status = 'Failure';\n\t\t\t$this->errors[] = array('errorcode' => 0, 'shortmessage' => 'Error connecting to PayPal', 'longmessage' => 'Error connecting to PayPal');\n\t\t}\n\t}", "public function create()\n {\n return $this->createResource(sprintf('/%s/%s', MoipResource::VERSION, self::PATH));\n }", "protected function Transform_Response($response)\n\t{\n\t\t\n\t\tif (is_string($response))\n\t\t{\n\t\t\t$response = new OLP_Response($response);\n\t\t}\n\t\t\n\t\t// we want the merged result so we have tokens for promo_id, etc.\n\t\t$data = array_merge($response->Signature()->To_Array(), $response->Collection()->To_Array());\n\t\t\n\t\t$proxy = new stdClass();\n\t\t$proxy->session_id = $response->Unique_ID();\n\t\t$proxy->page = $response->Page();\n\t\t$proxy->data = $data;\n\t\t$proxy->errors = $response->Errors()->To_Array();\n\t\t$proxy->event = array();\n\t\t\n\t\t// if we have a <section> element, turn it into\n\t\t// the eds_page in the response, using XSLT\n\t\tif (count($response->Content()->Sections()))\n\t\t{\n\t\t\t\n\t\t\t// which style-sheet?\n\t\t\t$xslt = DIR_SHARED.\"/xsl/{$response->Page()}.xsl\";\n\t\t\t\n\t\t\tif (is_file($xslt))\n\t\t\t{\n\t\t\t\t// transform our response\n\t\t\t\t$content = Transform_XML($xslt, $response->Received());\n\t\t\t\t$proxy->eds_page = array('content'=>$content, 'type'=>'text/html');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $proxy;\n\t\t\n\t}", "public function get_response_object()\n {\n }", "public function __CONSTRUCT($db) {\r\n $this->db = $db;\r\n $this->response = new Response();\r\n }", "public function __CONSTRUCT($db) {\r\n $this->db = $db;\r\n $this->response = new Response();\r\n }", "function makeResponse($response)\n {\n $result = current(Util::toArray($response));\n\n $response = new Response([\n 'raw_body' => $result,\n\n ## get response message as array\n 'default_expected' => function($rawBody) use ($result) {\n return $result;\n }\n ]);\n // TODO handle exceptions\n\n /** @var iResponse $response */\n $response = $this->exceptionHandler($response);\n \n\n return $response;\n }", "function __construct(ResponseFactory $response)\n {\n $this->response = $response;\n }", "public static function createFromRaw(string $rawResponse, string $responseClassName = Response::class): ResponseInterface\n {\n $response = new $responseClassName();\n\n if (!$response instanceof ResponseInterface) {\n throw new \\InvalidArgumentException(sprintf('The given response class name \"%s\" does not implement the \"%s\" and cannot be created with this method.', $responseClassName, ResponseInterface::class));\n }\n\n // see https://tools.ietf.org/html/rfc7230#section-3.5\n $lines = explode(chr(10), $rawResponse);\n $statusLine = array_shift($lines);\n\n if (substr($statusLine, 0, 5) !== 'HTTP/') {\n throw new \\InvalidArgumentException('The given raw HTTP message is not a valid response.', 1335175601);\n }\n list($httpAndVersion, $statusCode, $reasonPhrase) = explode(' ', $statusLine, 3);\n $version = explode('/', $httpAndVersion)[1];\n if (strlen($statusCode) !== 3) {\n // See https://tools.ietf.org/html/rfc7230#section-3.1.2\n throw new \\InvalidArgumentException('The given raw HTTP message contains an invalid status code.', 1502981352);\n }\n $response = $response->withStatus((integer)$statusCode, trim($reasonPhrase));\n $response = $response->withProtocolVersion($version);\n\n $parsingHeader = true;\n $contentLines = [];\n $headers = new Headers();\n foreach ($lines as $line) {\n if ($parsingHeader) {\n if (trim($line) === '') {\n $parsingHeader = false;\n continue;\n }\n $headerSeparatorIndex = strpos($line, ':');\n if ($headerSeparatorIndex === false) {\n throw new \\InvalidArgumentException('The given raw HTTP message contains an invalid header.', 1502984804);\n }\n $fieldName = trim(substr($line, 0, $headerSeparatorIndex));\n $fieldValue = trim(substr($line, strlen($fieldName) + 1));\n if (strtoupper(substr($fieldName, 0, 10)) === 'SET-COOKIE') {\n $cookie = Cookie::createFromRawSetCookieHeader($fieldValue);\n if ($cookie !== null) {\n $headers->setCookie($cookie);\n }\n } else {\n $headers->set($fieldName, $fieldValue, false);\n }\n } else {\n $contentLines[] = $line;\n }\n }\n if ($parsingHeader === true) {\n throw new \\InvalidArgumentException('The given raw HTTP message contains no separating empty line between header and body.', 1502984823);\n }\n $content = implode(chr(10), $contentLines);\n\n $response->setHeaders($headers);\n $response = $response->withBody(ArgumentsHelper::createContentStreamFromString($content));\n\n return $response;\n }", "public function makeResponse(): ResponseInterface;", "public function createFromResponse(): ContactClient\n {\n return new ContactClient((array) $this);\n }", "abstract protected function parseResponse($response);", "protected function getResponseFactory()\n {\n }", "public function __construct ($response)\r\n\t{\r\n\t\t$this->transactionId = $response ['transactionId'];\r\n\t\t$this->date = $response ['date'];\r\n\t\t$this->comment = $response ['comment'];\r\n\t\t$this->purchasePrice = $response ['purchasePrice'];\r\n\t\t$this->purchaseDate = $response ['purchaseDate'];\r\n\t\t$this->propertySize = $response ['propertySize'];\r\n\t\tif (isset ($response ['multipleOwners']))//individual\r\n\t\t\t$this->multipleOwners = $response ['multipleOwners'];\r\n\t\telse if (isset ($response ['multiple']))//business\r\n\t\t\t$this->multipleOwners = $response ['multiple'];\r\n\t\t$this->share = $response ['share'];\r\n\t\t$this->dateOfBirthOrIDNumber = $response ['dateOfBirthOrIDNumber'];\r\n\t\t$this->erf = $response ['erf'];\r\n\t\t$this->propertyType = $response ['propertyType'];\r\n\t\t$this->farm = $response ['farm'];\r\n\t\tif (isset ($response ['propertyName']))//individual\r\n\t\t\t$this->propertyName = $response ['propertyName'];\r\n\t\telse if (isset ($response ['buyerName']))//business\r\n\t\t\t$this->propertyName = $response ['buyerName'];\r\n\t\t$this->schemeName = $response ['schemeName'];\r\n\t\t$this->schemeNumber = $response ['schemeNumber'];\r\n\t\t$this->portion = $response ['portion'];\r\n\t\t$this->title = $response ['title'];\r\n\t\t$this->township = $response ['township'];\r\n\t\t$this->deedsOffice = $response ['deedsOffice'];\r\n\t\t$this->street = $response ['street'];\r\n\t\t$this->province = $response ['province'];\r\n\t\t$this->streetNumber = $response ['streetNumber'];\r\n\t}", "abstract public function convertFromResponse(SimplifiedResponse $response);", "public function __construct($response)\n {\n if (isset($response)) {\n // Check to make sure that there is an ExecuteResult\n if (isset($response->ExecuteResult)) {\n $response = $response->ExecuteResult;\n\n // Get Success Value\n if (isset($response->Success)) {\n $this->Success = $response->Success;\n }\n // Get Message Value\n if (isset($response->Message)) {\n $this->Message = $response->Message;\n }\n if (isset($response->Addresses->ArrayOfAddressResponse->AddressResponse)) {\n $addresess = $response->Addresses->ArrayOfAddressResponse->AddressResponse;\n if (is_array($addresess) && count($addresess) > 0) {\n foreach ($addresess as $key => $val) {\n $addresess[$key] = (array)$val;\n }\n $this->addresess = $addresess;\n }\n }\n }\n }\n parent::__construct();\n }", "protected function createResponse($json = NULL) {\n $response = new ResourceResponse();\n if ($json) {\n $response->setContent($json);\n }\n return $response;\n }", "public function __construct(stdClass $rawResponse)\n {\n $this->raw = $rawResponse;\n\n if (property_exists($rawResponse, 'code')) {\n $this->code = $rawResponse->code;\n $this->data = $rawResponse->data;\n } else {\n $this->awb = $rawResponse->awb;\n $this->status = $rawResponse->status;\n $this->updateOn = $rawResponse->UpdateOn;\n $this->message = $rawResponse->message;\n }\n }", "protected function decodeResponse($response) {\n $response_obj = null;\n if ( $this->options['format'] === 'object' && ( is_object($response) || is_string($response) ) ) {\n $response_obj = json_decode( $response, false );\n }\n\n return $response_obj;\n\n $this->error_handler( __CLASS__ . ' does not support <em>' . $this->options['format'] . '</em> format.' );\n }", "protected function construct_response()\n {\n $this->feedback['ok'] = $this->ok;\n $this->feedback['code'] = $this->code;\n $this->feedback['resource'] = $this->resource;\n }", "public function rest_api_init( $response ) {\n\t\tparent::rest_api_init( $response );\n\n\t\t// Get domain for requested site.\n\t\t$this->domain = ( new Status() )->get_site_suffix();\n\n\t\treturn $response;\n\t}", "protected static function fromResponse(ResponseInterface $response, $message = null)\n {\n return new static($message, $response->getStatusCode(), (string) $response->getBody());\n }", "abstract protected function getNewResource();", "public function __construct(HocmaiResponse $response)\n {\n $this->response = $response;\n $this->decodedBody = $response->getDecodedBody();\n }", "public function __construct(ResponseInterface $response)\n {\n $this->response = $response;\n }", "private function resultToResource(object $result): CkanResource {\n $resource = new CkanResource();\n\n $resource->setId($result->id);\n $resource->setPackageId($result->package_id);\n $resource->setUrl($result->url);\n $resource->setName($result->name);\n $resource->setDescription($result->description);\n $resource->setMetadataLanguage($result->metadata_language);\n $resource->setLanguage((is_array($result->language) ? $result->language : [$result->language]));\n $resource->setFormat($result->format);\n $resource->setLicenseId($result->license_id);\n\n $resource->setSize($result->size ?? NULL);\n $resource->setDownloadUrl($result->download_url ?? NULL);\n $resource->setMimetype($result->mimetype ?? NULL);\n $resource->setReleaseDate($result->release_date ?? NULL);\n $resource->setRights($result->rights ?? NULL);\n $resource->setStatus($result->status ?? NULL);\n $resource->setLinkStatus(isset($result->link_status) && $result->link_status == 1);\n $resource->setLinkStatusLastChecked($result->link_status_last_checked ?? NULL);\n $resource->setModificationDate($result->modification_date ?? NULL);\n $resource->setLinkedSchemas($result->linked_schemas ?? NULL);\n $resource->setHash($result->hash ?? NULL);\n $resource->setHashAlgorithm($result->hash_algorithm ?? NULL);\n $resource->setDocumentation($result->documentation ?? NULL);\n $resource->setCreated($result->created ?? NULL);\n\n return $resource;\n }", "protected function parseResource($resource)\n {\n return json_decode($resource, true);\n }", "public function getResponseParser()\n {\n return new ResponseParser();\n }", "public function create(): ResponseInterface\n\t{\n\t\t$this->content = [];\n\t}", "public function factory_provider(): Response_Factory {\n\t\treturn new Response_Factory( new HTTP() );\n\t}", "private function parse()\n {\n if ($this->isError()) {\n // error parsing\n if (empty($this->body) || !isset($this->body['errors'])) {\n // response body isn't an error object, return a custom one\n $error = new Entity\\Error();\n $error->message = \"Error $this->http_status\";\n $error->name = \"INVALID REQUEST\";\n $error->at = \"\";\n $this->objects[] = $error;\n } else {\n // parse error\n $errors = $this->body['errors'];\n foreach ($errors as $error) {\n $this->objects[] = Entity\\Error::parse($error);\n }\n }\n } else if (isset($this->body['card'])) {\n // card parsing\n $cards = $this->body['card'];\n foreach ($cards as $card) {\n $this->objects[] = Entity\\Card::parse($card);\n }\n } else if (isset($this->body['paymentmethod'])) {\n // payment parsing\n $this->objects[] = Entity\\Payment::parse($this->body);\n if (isset($this->body['subscription_plan'])) {\n // subscription also found, payment is a subscription\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n }\n } else if (isset($this->body['vendor'])) {\n // vendor parsing\n $this->objects[] = Entity\\Vendor::parse($this->body['vendor']);\n } else if (isset($this->body['item'])) {\n // item parsing\n $this->objects[] = Entity\\Item::parse($this->body['item']);\n } else if (isset($this->body['refunded'])) {\n // refund parsing, same as payment\n $this->objects[] = Entity\\Payment::parse($this->body);\n } else if (isset($this->body['subscription_plan'])) {\n // subscription parsing\n $this->objects[] = Entity\\Subscription::parse($this->body['subscription_plan']);\n } else if (isset($this->body['deleted'])) {\n // nothing to return\n } else {\n throw new \\RuntimeException('Could not recognize response type');\n }\n }", "public function __construct(ResponseFactory $response)\n {\n $this->response = $response;\n }", "protected function asObj($resource, $method=self::GET, $data=[]){\n\n $json = $this->asRaw($resource, $method, $data);\n\n if( empty($json) )\n throw new ClientException(\"Empty response from the API for resource {$resource}.\");\n\n $obj = @json_decode( $json );\n\n if( $json and $obj and isset($obj->status) ){\n\n if( self::SUCCESS == $obj->status ){\n\n //successful request\n\n if( ! isset($obj->data) )\n $obj->data = NULL;\n\n if( ! isset($obj->meta) )\n $obj->meta = NULL;\n\n $this->data = isset($obj->data) ? $obj->data : new \\stdClass();\n $this->meta = isset($obj->meta) ? $obj->meta : new \\stdClass();\n\n return $obj;\n\n }\n else\n throw new ClientException(\"{$obj->code} Error: {$obj->message}\");\n }\n\n throw new ServiceUnavailableException(\"Invalid response from the API for resource {$resource}.\");\n\n }", "abstract function parse_api_response();" ]
[ "0.6414738", "0.62786955", "0.6255751", "0.61802685", "0.6109917", "0.6070441", "0.603984", "0.60393196", "0.60125035", "0.6008985", "0.5992915", "0.5992591", "0.59395856", "0.59146154", "0.59108865", "0.58777547", "0.5871064", "0.5859848", "0.5851065", "0.58345413", "0.58154166", "0.581262", "0.57949734", "0.57894796", "0.5787959", "0.5782086", "0.5764435", "0.5764435", "0.5764435", "0.5764435", "0.575469", "0.57434195", "0.572822", "0.570328", "0.56936985", "0.56788045", "0.5673396", "0.5656025", "0.56429267", "0.5637281", "0.5637281", "0.5637281", "0.5619714", "0.55812013", "0.55777645", "0.5496135", "0.5489373", "0.5481875", "0.54732716", "0.5454544", "0.5433898", "0.54082716", "0.5404216", "0.539374", "0.539374", "0.53925973", "0.5389339", "0.53654605", "0.53513956", "0.5346969", "0.5339946", "0.53327954", "0.5326705", "0.5323129", "0.53188187", "0.5314264", "0.53021204", "0.529915", "0.5296121", "0.529605", "0.5296034", "0.5296034", "0.52830946", "0.52760255", "0.5275546", "0.5273404", "0.5270002", "0.52671266", "0.5259597", "0.5254913", "0.52536327", "0.5252943", "0.5245511", "0.52437603", "0.52384293", "0.5238063", "0.5232092", "0.52315044", "0.52251613", "0.5221133", "0.5202924", "0.51996017", "0.51981914", "0.51975656", "0.5194026", "0.5187042", "0.5185055", "0.51846004", "0.5178817", "0.51751614" ]
0.54384613
50
Display a listing of the resource.
public function CategoriesShow() { $allCategories = Categorie::all(); return view('articles.seeCategories', compact('allCategories')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function CategoriesCreate(CategoriesRequest $request) { $categorie = new Categorie; $categorie->name = $request->newCategorie; $categorie->validation = 1; $categorie->save(); return redirect()->route('showCategories'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(CategoriesRequest $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(CategoriesRequest $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function CategoriesDelete($id) { $categorie = Categorie::find($id); $categorie->delete(); return redirect()->route('showCategories'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Returns information about this plugin.
public function pluginDetails() { return [ 'name' => 'acgp.flyingsite::lang.plugin.name', 'description' => 'acgp.flyingsite::lang.plugin.description', 'author' => 'Air Cadet Gliding Program', 'icon' => 'icon-plane', 'homepage' => 'https://cadetflying.site', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function plugin_info()\n {\n }", "public function getInfo()\n {\n // Verschiedene Info-Parameter für Plugin-Manager.\n return array(\n 'version' => $this->getVersion(),\n 'label' => $this->getLabel(),\n 'author' => 'Net Inventors GmbH',\n 'link' => 'http://www.shopinventors.de',\n 'copyright' => 'Copyright (c) 2015, Net Inventors - Agentur für digitale Medien GmbH',\n 'description' => '<b>Für die Verwendung dieses Plugins benötigen Sie unser Basis-Plugin<br />'\n .\n '<a href=\"http://store.shopware.com/detail/index/sArticle/162025\" target=\"_blank\">'\n .\n 'NetiFoundation</a> in der Version ' .\n $this->getRequiredFoundation() .\n ' oder höher!</b>'\n );\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Service Me',\n 'description' => 'Service Me Components',\n 'author' => 'Darren Miller',\n 'icon' => 'icon-leaf'\n ];\n }", "function getInfo(){\n return array(\n 'author' => 'seism',\n 'email' => '[email protected]',\n 'date' => '2011-5-1',\n 'name' => 'Embed GitHub Plugin',\n 'desc' => 'Show a GitHUb widget in your wiki',\n 'url' => 'http://www.dokuwiki.org/wiki:plugins',\n );\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'music',\n 'description' => 'No description provided yet...',\n 'author' => 'jc91715',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Iklan',\n 'description' => 'Pengaturan Iklan',\n 'author' => 'PanatauSolusindo',\n 'icon' => 'icon-diamond'\n ];\n }", "function getPluginInfo() {\n\n return [\n 'name' => $this->getPluginName(),\n 'description' => 'This plugin implements WebDAV resource sharing',\n 'link' => 'https://github.com/evert/webdav-sharing'\n ];\n\n }", "function getPluginInfo() {\n return [\n 'name' => $this->getPluginName(),\n 'description' => 'Adds JSON support for CardDAV',\n 'link' => 'http://sabre.io/dav/carddav/',\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Core',\n 'description' => 'No description provided yet...',\n 'author' => 'Ams',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'general',\n 'description' => 'General configuration',\n 'author' => 'kironuniversity',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'sasUtilities',\n 'description' => 'Some useful tools for other plugins.',\n 'author' => 'Silver Arrow Software',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'hon.honcuratoruser::lang.plugin.name',\n 'description' => 'hon.honcuratoruser::lang.plugin.description',\n 'author' => 'HON',\n 'icon' => 'icon-leaf'\n ];\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Todo',\n 'description' => 'Just a simple todo widget',\n 'author' => 'Hartviglarsen',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'tattler',\n 'description' => 'No description provided yet...',\n 'author' => 'Grohman',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'SimpleCatalog',\n 'description' => 'This is a simple back-end plugin for managing displayable products.',\n 'author' => 'Wboyz',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Blossom',\n 'description' => 'Plug-in used to develop views for displaying grade information',\n 'author' => 'Jacob Reid',\n 'icon' => 'icon-asterisk'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'xitara.nexus::lang.plugin.name',\n 'description' => 'xitara.nexus::lang.plugin.description',\n 'author' => 'xitara.nexus::lang.plugin.author',\n 'homepage' => 'xitara.nexus::lang.plugin.homepage',\n 'icon' => '',\n 'iconSvg' => 'plugins/xitara/nexus/assets/images/icon-nexus.svg',\n ];\n }", "public function getInfo()\n {\n return array(\n 'version' => $this->getVersion(),\n 'autor' => 'VR pay eCommerce',\n 'copyright' => 'Copyright (c) 2017, VR pay eCommerce',\n 'label' => $this->getLabel(),\n 'supplier' => 'VR pay eCommerce',\n 'description' => 'VR pay eCommerce plugin v'.$this->getVersion(),\n 'support' => '',\n 'link' => 'http://www.vr-epay.info/'\n );\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'EaxOctober',\n 'description' => 'Стандартное расширение Quadrowin',\n 'author' => 'quadrowin',\n 'icon' => 'icon-leaf'\n ];\n }", "public function getInfo()\n {\n return $this->getServer()->getInfo();\n }", "public function pluginDetails() {\n return [\n 'name' => 'elearning',\n 'description' => 'No description provided yet...',\n 'author' => 'hung.do',\n 'icon' => 'icon-leaf'\n ];\n }", "function getPluginInfo() {\n return [\n 'name' => $this->getPluginName(),\n 'description' => 'Adds Text support for CalDAV',\n 'link' => 'http://sabre.io/dav/caldav/',\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'portfolio',\n 'description' => 'Simple portfolio plugin',\n 'author' => 'AngryGantz',\n 'icon' => 'icon-briefcase'\n ];\n }", "function getInfo(){\n return array(\n 'author' => 'Oleg Lavrovsky',\n 'email' => '[email protected]',\n 'date' => '2013-2-1',\n 'name' => 'New Page Button Plugin',\n 'desc' => 'Simplifies page creation for users',\n 'url' => 'http://oleg.utou.ch',\n );\n }", "public function pluginDetails() {\n return [\n 'name' => 'Sampling',\n 'description' => 'No description provided yet...',\n 'author' => 'Sampling',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n\t{\n\t\treturn [\n\t\t\t'name'\t\t\t\t=> 'Framework',\n\t\t\t'description'\t=> trans('axc.framework::lang.plugin.description'),\n\t\t\t'author'\t\t\t=> 'Alex Carrega',\n\t\t\t'icon'\t\t\t\t=> 'icon-cubes'\n\t\t];\n\t}", "public function info()\n {\n return $this->info;\n }", "public function info()\n {\n return $this->info;\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'kodermax.gallery::lang.plugin.name',\n 'description' => 'kodermax.gallery::lang.plugin.description',\n 'author' => 'Maksim Karpychev',\n 'icon' => 'icon-leaf'\n ];\n }", "public function getInfo()\n\t{\n\t\treturn $this->info;\n\t}", "public function getInfo()\n\t{\n\t\treturn $this->info;\n\t}", "public function pluginDetails()\n {\n return [\n 'name' => 'depcore.portfolio::lang.plugin.name',\n 'description' => 'depcore.portfolio::lang.plugin.description',\n 'author' => 'depcore',\n 'icon' => 'icon-portfolio'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Klyp Page Builder',\n 'description' => 'Easily order component on pages.',\n 'author' => 'Klyp',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Food',\n 'description' => 'create a Food Menu with ease.',\n 'author' => 'Milo',\n 'icon' => 'icon-cutlery'\n ];\n }", "public function getInfo ()\n {\n return $this->info;\n }", "public function getPluginInfo()\n {\n return [\n 'name' => $this->getPluginName(),\n 'description' => 'HTML Email delivery (rfc6047) for CalDAV scheduling',\n 'link' => 'http://github.com/tchapi/davis',\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Newsletter',\n 'description' => 'Newsletter contact',\n 'author' => 'Cifq',\n 'icon' => 'icon-leaf'\n ];\n }", "public function getInstanceInfo()\n {\n return $this->get(self::_INSTANCE_INFO);\n }", "abstract public function pluginDetails();", "public function pluginDetails()\n {\n return [\n 'name' => 'rainlab.location::lang.plugin.name',\n 'description' => 'rainlab.location::lang.plugin.description',\n 'author' => 'Alexey Bobkov, Samuel Georges',\n 'icon' => 'icon-globe',\n 'homepage' => 'https://github.com/rainlab/location-plugin'\n ];\n }", "public function pluginDetails() {\n return [\n 'name' => 'Twitch Bot',\n 'description' => 'Run a Twitch/Discord Bot from your site',\n 'author' => 'Joshua Webb',\n 'icon' => 'icon-users'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'cptmeatball.pricetables::lang.plugin.name',\n 'description' => 'cptmeatball.pricetables::lang.plugin.description',\n 'author' => 'cptmeatball',\n 'icon' => 'icon-leaf'\n ];\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function getInfo()\n {\n return $this->info;\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Podcast',\n 'description' => 'Add a podcast list to your website.',\n 'author' => 'Paul Lovato',\n 'icon' => 'icon-microphone'\n ];\n }", "public function pluginDetails() {\n return [\n 'name' => 'janvince.smallextensions::lang.plugin.name',\n 'description' => 'janvince.smallextensions::lang.plugin.description',\n 'author' => 'Jan Vince',\n 'icon' => 'icon-universal-access'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'FloUsps',\n 'description' => 'FloCommerce USPS Shipping Plugin',\n 'author' => 'Radiantweb',\n 'icon' => 'icon-shopping-cart'\n ];\n }", "function getInfo() {\n return array(\n 'author' => 'Sam Wilson',\n 'email' => '[email protected]',\n 'date' => '2012-03-10',\n 'name' => 'Proofread Page',\n 'desc' => 'View images side-by-side with pages, for viewing and editing.',\n 'url' => 'http://www.dokuwiki.org/plugin:proofreadpage',\n );\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'mediumBlog',\n 'description' => 'No description provided yet...',\n 'author' => 'octobro',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Mighty Seo Plus',\n 'description' => 'Addon for Mighty SEO plugin for more advanced SEO settings.',\n 'author' => 'Media1',\n 'icon' => 'icon-leaf',\n 'iconSvg' => 'plugins/media1/mightyseoplus/assets/images/icon.svg'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'userprofile',\n 'description' => 'No description provided yet...',\n 'author' => 'stepanozhigov',\n 'icon' => 'icon-leaf'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Slack',\n 'description' => 'No description provided yet...',\n 'author' => 'Gency',\n 'icon' => 'icon-slack'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'fenncs.newspageviews::lang.plugin.name',\n 'description' => 'fenncs.newspageviews::lang.plugin.description',\n 'author' => 'Fon E. Noel NFEBE',\n 'icon' => 'oc-icon-eye',\n 'homepage' => 'https://github.com/fenn-cs/newspageviews'\n ];\n }", "public function getInfo()\r\n {\r\n return $this->info;\r\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Тинькофф Банк',\n 'description' => 'Проведение платежей через Tinkoff EACQ.',\n 'author' => 'Sozonov Alexey',\n 'icon' => 'icon-shopping-cart',\n 'homepage' => 'https://sozonov-alexey.ru'\n ];\n }", "function info()\n\t{\n\t\treturn array();\n\t}", "public function pluginDetails()\n {\n return [\n 'name' => 'FeedbackSlack',\n 'description' => 'The Slack method for Feedback plugin',\n 'author' => 'eBussola',\n 'icon' => 'icon-slack'\n ];\n }", "public function info()\n {\n return $this->send('info');\n }", "public function getinfo()\n\t{\n\t\treturn $this->connect('getinfo');\n\t}", "public function pluginDetails()\n {\n return [\n 'name' => 'Reminder',\n 'description' => 'Remind for new posts and comments',\n 'author' => 'mnv',\n 'icon' => 'icon-bell'\n ];\n }", "public function pluginDetails(): array\n {\n return [\n 'name' => 'definer.jivosite::lang.plugin.name',\n 'description' => 'definer.jivosite::lang.plugin.description',\n 'author' => 'Definer',\n 'icon' => 'icon-comments'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'pkleindienst.githubprojects::lang.plugin.name',\n 'description' => 'pkleindienst.githubprojects::lang.plugin.description',\n 'author' => 'Pascal Kleindienst',\n 'icon' => 'icon-github',\n 'homepage' => 'https://github.com/PascalKleindienst/octobercms-github-projects'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Import',\n 'description' => 'Import datas from csv files',\n 'author' => 'Tiipiik',\n 'icon' => 'icon-magic'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Contact',\n 'description' => 'Messages from the frontend contact form.',\n 'author' => 'Be Easy',\n 'icon' => 'icon-envelope-o'\n ];\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'feegleweb.changelog::lang.plugin.name',\n 'description' => 'feegleweb.changelog::lang.plugin.description',\n 'author' => 'Dave Shoreman',\n 'icon' => 'icon-list-alt',\n 'homepage' => 'https://github.com/feegleweb/oc-changelog-plugin',\n ];\n }", "public function info()\n {\n $info = array();\n $info['author'] = 'Jason Verhagen';\n $info['organisation'] = 'HolleywoodStudio.com';\n $info['hacked_by'] = null;\n $info['hack_version'] = null;\n $info['version'] = 12;\n $info['locked'] = false;\n $info['parameters'] = array('name', 'api_key', 'playlist_id', 'title', 'template_main', 'template_style', 'start_video', 'max_videos', 'description_type', 'embed_allowed', 'show_player', 'player_align', 'player_width', 'player_height', 'style', 'nothumbplayer', 'thumbnail', 'formorelead', 'formoretext', 'formoreurl');\n return $info;\n }", "public function pluginDetails()\r\n {\r\n return [\r\n 'name' => 'Leads',\r\n 'description' => 'No description provided yet...',\r\n 'author' => 'Appsauces',\r\n 'icon' => 'icon-book'\r\n ];\r\n }", "public function getInfo()\r\n {\r\n return $this->setNuki(\r\n __FUNCTION__\r\n );\r\n }", "public function info()\n {\n return array(\n 'module' => $this->name,\n 'text_type' => __('Show page'),\n 'text_type_long' => __('Show a page in a block'),\n 'allow_multiple' => true,\n 'form_content' => false,\n 'form_refresh' => false,\n 'show_preview' => true,\n 'admin_tableless' => true\n );\n }", "public function info()\n {\n return $this->type('info');\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Debugbar',\n 'description' => 'Debugbar integration for OctoberCMS.',\n 'author' => 'Bedard',\n 'icon' => 'icon-cog',\n 'homepage' => 'https://github.com/scottbedard/oc-debugbar-plugin'\n ];\n }", "function info() {\n\t \treturn $this->description;\n\t }", "public function info();", "public function info();", "public function getInfo()\n\t{\n\t\treturn $this->resource->get($this->name)->getContent();\n\t}", "public function info () {\n\t\treturn array_merge(parent::info(), array(\n\t\t\t'title' => 'Dropbox',\n\t\t\t'description' => 'Store backups to your Dropbox account',\n\t\t\t'icon' => $this->_plugin->url('img/dropbox.png')\n\t\t));\n\t}", "public function get_info()\n {\n return $this->_request('getinfo');\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'luketowers.pwnedpasswords::lang.plugin.name',\n 'description' => 'luketowers.pwnedpasswords::lang.plugin.description',\n 'author' => 'Luke Towers',\n 'icon' => 'icon-check',\n 'homepage' => 'https://github.com/LukeTowers/oc-pwnedpasswords-plugin',\n ];\n }", "public function info()\n {\n $info = array();\n $info['author'] = 'Chris Graham';\n $info['organisation'] = 'ocProducts';\n $info['hacked_by'] = null;\n $info['hack_version'] = null;\n $info['version'] = 2;\n $info['locked'] = false;\n $info['parameters'] = array('username', 'period', 'display', 'title', 'width', 'height');\n return $info;\n }", "public function info(){\n return $this->getAdapter()->info();\n }", "public function getInformation()\n {\n return $this->values[\"info\"];\n }", "function getInfo()\n {\n $info['name'] = _(\"TextMagic via HTTP\");\n $info['desc'] = _(\"This driver allows sending of messages through the TextMagic (http://api.textmagic.com) gateway, using the HTTP API\");\n\n return $info;\n }", "public function getInfo();", "public function getInfo() {}", "public function getInfo() {}", "public function getInfo()\n {\n return array(\n 'version' => $this->getVersion(),\n 'label' => $this->getLabel(),\n 'author' => 'Sören Oehding',\n 'supplier' => 'SO_DSGN',\n 'description' => 'Einfaches Bilder Widget für die Einkaufswelten',\n 'support' => 'Shopware Forum',\n 'link' => 'https://so-dsgn.de'\n );\n }", "public function getInfo()\n\t{\n\t\treturn array();\n\t}", "public function info()\n {\n $info = array();\n $info['author'] = 'Chris Graham';\n $info['organisation'] = 'ocProducts';\n $info['hacked_by'] = null;\n $info['hack_version'] = null;\n $info['version'] = 2;\n $info['locked'] = false;\n $info['parameters'] = array('param', 'zone', 'give_context', 'include_breadcrumbs', 'guid');\n return $info;\n }", "public function pluginDetails()\n {\n return [\n 'name' => 'Rating',\n 'description' => 'Add Rating Stars to Blog Post',\n 'author' => 'Sw33t',\n 'icon' => 'icon-star'\n ];\n }", "public function getInfo()\n {\n return array(\n 'version' => $this->getVersion(),\n 'label' => $this->getLabel(),\n 'description' => file_get_contents(__DIR__ . '/description.txt')\n );\n }" ]
[ "0.797724", "0.7922392", "0.77463794", "0.7735706", "0.76848036", "0.7645479", "0.76429296", "0.7587013", "0.75822604", "0.7577747", "0.75763935", "0.75526416", "0.75190413", "0.75190413", "0.75190413", "0.75190413", "0.75190413", "0.7480916", "0.7479124", "0.7478786", "0.74651486", "0.7460374", "0.7458041", "0.74525577", "0.74475074", "0.74348813", "0.74292207", "0.74273896", "0.7425888", "0.7416709", "0.7386218", "0.7362882", "0.7362882", "0.7354955", "0.73495436", "0.73495436", "0.7348307", "0.7333698", "0.7328996", "0.73270065", "0.7323167", "0.73200995", "0.73171866", "0.731636", "0.73144525", "0.7298677", "0.7280758", "0.7280142", "0.7280142", "0.7280142", "0.7280142", "0.7280142", "0.7280142", "0.7280142", "0.726881", "0.7228061", "0.722551", "0.7217561", "0.72166884", "0.7212704", "0.72125804", "0.7211408", "0.71997476", "0.7191024", "0.71813667", "0.71808326", "0.7175915", "0.71591836", "0.7144992", "0.7134506", "0.71230656", "0.7100029", "0.7096495", "0.70637995", "0.70549446", "0.70282817", "0.70261306", "0.70152575", "0.700897", "0.6975777", "0.69703156", "0.6967635", "0.6956782", "0.6956782", "0.69543695", "0.6953856", "0.69525206", "0.6945851", "0.6944249", "0.6934693", "0.6927176", "0.6904824", "0.6890741", "0.68853027", "0.68853027", "0.6884314", "0.6880448", "0.6875744", "0.6866057", "0.6863736" ]
0.7459702
22
Display a listing of the resource.
public function index() { $user = "me"; $msgLimit = 1000; $client = getClient(); $service = getService($client); $listMessages = listMessages($service, $user, $msgLimit); $arrMessage = array(); $objClientController = new ClientController(); $objMessageController = new MessageController(); $clientStore = 0; $messageStore = 0; foreach($listMessages as $message) { // getting gmail message by id $arrMessage = getMessage($service, $user, $message["id"]); // store client $client = $objClientController->store($arrMessage); $clientId = $client["client_id"]; $store = $client["store"]; if($store) $clientStore++; //store messages if ($clientId) { $message = $objMessageController->store($arrMessage, $clientId); $store = $message["store"]; if($store) $messageStore++; } } unset($objClientController, $objMessageController); if($clientStore > 0 || $messageStore > 0) { $msg = $clientStore . " customers and " . $messageStore . " messages were added!"; return response($msg, 201); } else { $msg = $clientStore . " customers and " . $messageStore . " messages were added!"; return response($msg, 400); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Authorize a resource action based on the incoming request.
public function authorizeResource($model, $name = null, array $options = [], $request = null) { $method = array_last(explode('@', with($request ?: request())->route()->getActionName())); $map = $this->resourceAbilityMap(); if (! in_array($method, array_keys($map))) { return new ControllerMiddlewareOptions($options); } if (! in_array($method, ['index', 'create', 'store'])) { $model = $name ?: strtolower(class_basename($model)); } return $this->middleware("can:{$map[$method]},{$model}", $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorizeAction();", "public function authorize($action, User $user, $entity);", "abstract public function authorize();", "abstract public function authorize();", "public function authorize();", "public function authorize();", "public function authorize () {\n if (!Resources::secure($this->resource, $this->action)) {\n //$this->resourceOK();\n //return $this;\n };\n \n if ($this->token == null) {\n $this->resourceUnauthorized();\n return $this;\n }\n\n if (!User::validToken($this->token)) {\n $this->resourceForbidden();\n return $this;\n }\n $this->resourceOK();\n return $this;\n }", "public function authorize(IPrincipal $user, AuthorizationPolicy|string $policy, object $resource = null): AuthorizationResult;", "public function authorizeAction()\n {\n $this->view->title .= ' - Grant Access';\n\n $id = $this->_getParam('roleId');\n if (empty($id)) throw new InvalidArgumentException('Missing parameter roleId.');\n\n // find current role\n $roleResource = new Application_Model_Mapper_Roles();\n /* @var $role Application_Model_Role */\n $role = current($roleResource->find($id));\n\n $Acl = new Application_Model_Mapper_Acl();\n\n $form = $this->_getForm('aclAdd');\n $form->setAction($form->getAction());\n\n $request = $this->getRequest();\n if ($request->isPost() && $form->isValid($request->getPost())) {\n $values = $form->getValues();\n $i = 0;\n $Acl->cleanByRoleAndResource($values['roleId'], $values['resourceId']);\n foreach ($values['action'] as $action) {\n $data = $values;\n $data['action'] = $action;\n\n $aclItem = $Acl->fetchRowByRoleAndResource($data['roleId'], $data['resourceId'], $action);\n $aclItem->setData($data);\n $aclItem->save();\n }\n $this->_helper->flashMessenger(\"Update $i rule(s) for role \\\"{$role->name}\\\"!\");\n //clean acl cache\n $i = $this->_cleanAclCacheByRole($role);\n $this->_helper->flashMessenger(\"clean $i acl cache for {$role->name}.\");\n }\n\n //get all registered resources\n $Resources = new Application_Model_Mapper_Resources();\n $rowset = $Resources->fetchAll();\n\n $allResources = array();\n foreach ($rowset as $resource) {\n $allResources[$resource->id] = $resource->name;\n }\n\n $form->setDefault('roleId', $role->id);\n //find resources by role\n $rowset = $role->getResources();\n $resources = array();\n foreach ($rowset as $resource) {\n $resources[$resource->id] = $resource;\n }\n //$aResources = array_diff_key($allResources, $resources);\n $rowset = $role->getAcl();\n $acl = array();\n foreach ($rowset as $item) {\n $acl[$item->resourceId][] = $item;\n }\n\n $form->getElement('resourceId')->setMultiOptions($allResources);\n\n $this->view->resources = $resources;\n $this->view->acl = $acl;\n $this->view->form = $form;\n\n $this->view->role = $role;\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize() {\n\n\t\t// the anonymous user's id is 0 - user has not logged in.\n\t\tif ($this->user->get('id') === 0) {\n\n\t\t\t// does the user have permission to perform the desired action on the requested model?\n\t\t\tif ( ! $this->user->has_permission($this->model, $this->method)) {\n\n\t\t\t\t// no. does the user have permission to be redirected to the login?\n\t\t\t\tif ($this->user->has_permission($this->model, 'login')) {\n\t\t\t\t\t$response = new Response(303, Config::get('base_uri','/') . 'login');\n\t\t\t\t}\n\t\t\t\t// no. respond with 401.\n\t\t\t\telse {\n\t\t\t\t\t$response = new Response(401, array(\n\t\t\t\t\t\t'error'\t=>\t'You do not have permission to do that.'\n\t\t\t\t\t), $this->format, '401');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// the user's id is something other than 0 - the user has logged in.\n\t\telse {\n\t\t\t// does the user have permission to perform the desired action on the requested model?\n\t\t\tif ( ! $this->user->has_permission($this->uri->get('model'), $this->method)) {\n\t\t\t\t// no. respond with 403.\n\t\t\t\t$response = new Response(403, array(\n\t\t\t\t\t'error'\t=>\t'You do not belong to a group that has permission to do that.'\n\t\t\t\t), $this->format, '403');\n\t\t\t}\n\t\t}\n\n\t\t// if we've made it this far, the user has the proper permissions.\n\t\t//\tnow we check for CSRF on any request that may alter the database.\n\t\tif (in_array($this->method, array('create','update','delete'))) {\n\n\t\t\t// the client must pass a CSRF token.\n\t\t\t$client_token = $this->data['csrf'] || false;\n\n\t\t\t// which must match the token stored in the session.\n\t\t\t$session_token = $this->session['csrf'] || false;\n\n\t\t\t// no client token or tokens that don't match generates an error.\n\t\t\tif ($client_token === false || $client_token !== $session_token) {\n\t\t\t\t$response = new Response(401, array(\n\t\t\t\t\t'error'\t=>\t'Cross Site Request Forgery'\n\t\t\t\t), $this->format, '401');\n\t\t\t}\n\t\t}\n\t}", "public function authorize($user, CakeRequest $request) {\n }", "abstract public function url_authorize();", "public function authorize() {\r\n\t\t\r\n\t\t$user_id = $this->Session->read('Auth.' . $this->authorizeActionSettings['userIdKey']);\r\n\t\tif (empty($user_id)) {\r\n\t\t\t$this->Session->write('Auth.redirect', Router::reverse($this->request));\r\n\t\t\treturn $this->redirect($this->authorizeActionSettings['loginUrl'], 401);\r\n\t\t}\r\n\t\t\r\n\t\t$client_data = $this->OAuth2->validateAuthorizeRequest();\r\n\t\t\r\n\t\tif (empty($client_data)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$api_key = $client_data['client_id'];\r\n\t\t\r\n\t\t$post_scope = !empty($this->request->data['scope']) ? $this->request->data['scope'] : null;\r\n\t\t$get_scope = !empty($this->request->query['scope']) ? $this->request->query['scope'] : null;\r\n\t\t$scope = !empty($post_scope) ? $post_scope : $get_scope;\r\n\t\t\r\n\t\tif (!isset($this->OAuth2Authorization)) {\r\n\t\t\t$this->loadModel('OAuth2.OAuth2Authorization');\r\n\t\t}\r\n\t\t\r\n\t\t$existing_authorization = $this->OAuth2Authorization->getExisting(\r\n\t\t\t$api_key,\r\n\t\t\t$user_id,\r\n\t\t\t$scope\r\n\t\t);\r\n\t\t\t\r\n\t\t$show_permissions_page = false;\r\n\t\tif (empty($existing_authorization) && $this->request->is('get')) {\r\n\t\t\t$show_permissions_page = true;\r\n\t\t}\r\n\t\t\r\n\t\t$proceed_with_authorization = false;\r\n\t\tif (!empty($existing_authorization) || $this->request->is('post')){\r\n\t\t\t$proceed_with_authorization = true;\r\n\t\t}\r\n\t\t\r\n\t\tif ($show_permissions_page) {\r\n\t\t\r\n\t\t\t$this->set('client', $client_data);\r\n\t\t\t\r\n\t\t} elseif ($proceed_with_authorization) {\r\n\t\t\t\r\n\t\t\t$allow = false;\r\n\t\t\tif (!empty($existing_authorization) || !empty($this->request->data['allow'])) {\r\n\t\t\t\t$allow = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$response = $this->OAuth2->handleAuthorizeRequest($allow, $user_id);\r\n\t\t\t\r\n\t\t\tif (empty($response)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $this->redirect($response->getHttpHeader('Location'), $response->getStatusCode());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "abstract public function authorize(Subscriber $subscriber, Request $request);", "public function authorize()\n {\n // Should be route protected.\n return true;\n }", "public function authorize()\n\t{\n\t\t// Compile the rules\n\t\t$this->compile();\n\t\t\t\n\t\t// Check if this user has access to this request\n\t\tif ($this->user_authorized())\n\t\t\treturn TRUE;\n\n\t\t// Set the HTTP status to 403 - Access Denied\n\t\t$this->request->status = 403;\n\n\t\t// Execute the callback (if any) from the compiled rule\n\t\t$this->perform_callback();\n\n\t\t// Throw a 403 Exception if no callback has altered program flow\n\t\tthrow new Kohana_Request_Exception('You are not authorized to access this resource.', NULL, 403);\n\t}", "public function authorize()\n {\n $model = $this->resource()::$model;\n\n return $this->authorizeIfPolicyExists('viewAny', $model);\n }", "public function authorize(){\n $token = $this->retrieveToken(); $this->setToken($token);\n }", "public function authorize()\n {\n return true; // TODO: authorize implementation\n }", "private function handleRequest(string $resource): string\n {\n $auth = UserSession::getInstance();\n\n // split the requested resource into controller and action\n $components = explode('/', $resource);\n\n $c_name = \"\\\\controllers\\\\\" . ucfirst($components[1]) . 'Controller';\n\n // if the controller does not exist, display an error\n if (!class_exists($c_name))\n return (new Controller('site'))->error('404');\n\n // TODO: rewrite to short url (ie: /site/index -> /index)\n $action = $components[2];\n $p = $components;\n\n // if the action is not specified, display an error\n if (!isset($action))\n return (new Controller('site'))->error('404');\n\n $controller = new $c_name;\n $behaviors = $controller->behaviors();\n foreach ($behaviors['access']['rules'] as $rule)\n {\n // check if the action exists\n if (in_array($action, $rule['actions']) && $rule['allow'])\n {\n $method = 'action' . ucfirst($action);\n\n // the action can be performed by both authenticated and non-authenticated users\n if (in_array('?', $rule['roles']) && in_array('@', $rule['roles']))\n return $controller->$method(isset($p[3]) ? (int) $p[3] : null, isset($p[4]) ? (int) $p[4] : null); // WIP\n\n // the action requires that the user is not authenticated\n if (in_array('?', $rule['roles']) && !$auth->isLoggedIn())\n return $controller->$method();\n\n // the action requires that the user is authenticated and authorized\n if ($auth->isLoggedIn())\n {\n if (in_array(App::$user->role, $rule['roles']))\n {\n // check ownership\n if (App::$user->role === 'customer' && isset($rule['roleCheck']))\n {\n $model = $rule['roleCheck'][0]::{$rule['roleCheck'][1]}(isset($p[3]) ? (int) $p[3] : null);\n if (!$model)\n return (new Controller('site'))->error('404'); // not found\n\n if ($model->created_by !== App::$user->id)\n return (new Controller('site'))->error('403'); // not authorized\n }\n }\n\n else if (!in_array('@', $rule['roles']))\n return (new Controller('site'))->error('403'); // not authorized\n\n // else fix controller rules\n\n return $controller->$method(isset($p[3]) ? (int) $p[3] : null);\n }\n\n else\n {\n return (new Controller('site'))->error('401'); // not authenticated\n }\n }\n }\n\n // the action does not exist, or is not valid, therefore display an error message\n return (new Controller('site'))->error('404');\n }", "private function _isAllowed()\r\n {\r\n $req = $this->app->request();\r\n $resource = strtoupper($req->getMethod()) . $req->getResourceUri() ;\r\n return in_array($resource, $this->config['allowed_resources']);\r\n }", "public function call()\n {\n if (false === $this->shouldAuthenticate()) {\n return $this->next->call();\n }\n\n $app = \\Slim\\Slim::getInstance(getenv('APP_NAME'));\n\n $app->hook('slim.before.dispatch', function() use ($app)\n {\n $resource = $app->router()->getCurrentRoute()->getName();\n $permission = $app->request->getMethod();\n\n $auth = $app->auth;\n $acl = $app->acl;\n\n if (!$auth->hasIdentity()) {\n return $app->redirectTo('intranet.login');\n }\n\n $identity = $auth->getIdentity();\n $app->view()->getInstance()->addGlobal('identity', $identity);\n\n if (!$acl->isAllowed($identity['role'], $resource, $permission)) {\n return $app->redirectTo('intranet.unauthorized');\n }\n });\n\n $this->next->call();\n }", "public function authorize($requestParameters = array());", "public function authorize($options);", "protected function _isAllowedAction($resourceId)\r\n {\r\n return $this->_authorization->isAllowed($resourceId);\r\n }", "protected function _isAllowedAction($resourceId)\r\n {\r\n return $this->_authorization->isAllowed($resourceId);\r\n }", "protected function _isAllowedAction($resourceId)\r\n {\r\n return $this->_authorization->isAllowed($resourceId);\r\n }", "public function authorize()\n {\n return true; // I do not know how to create authorisation for the back-end and the time constraints of the project did not allow me to get to this stage either. It is something I would like to learn to do in the future however.\n }", "public function onResourceIfAllowedAnnotationMethod(FilterControllerEvent $event)\n {\n list($object, $method) = $event->getController();\n $reflectionClass = new \\ReflectionClass(get_class($object));\n $reflectionMethod = $reflectionClass->getMethod($method);\n\n if ($annotation = $this->annotationReader->getMethodAnnotation($reflectionMethod, $this->annotationClass)) {\n $resourceId = $event->getRequest()->attributes->get(sprintf('%sId', $this->resource));\n if (null !== $resourceId) {\n $event->getRequest()->attributes->set(\n $this->resource, $this->getResourceIfAllowed($resourceId, $annotation->getGrant())\n );\n }\n }\n }", "public function authorize()\n {\n \t// var_dump(Auth::check());\n \t// $postId = $this->route('create');\n \t// var_dump($postId);\n \tif(session('statut') == 'admin')\n \t\treturn true;\n \telse\n \t\treturn false;\n\n \t// return Gate::allows('update', Post::findOrFail($postId));\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n return $this->_instance->authorize();\n }", "public function authorize()\n {\n return Gate::authorize('manage-app');\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "protected function _isAllowedAction($resourceId)\n {\n return $this->_authorization->isAllowed($resourceId);\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }", "public function authorize()\n\t{\n\n\t\treturn true;\n\t}", "public function decideOnResource($resource)\n {\n if (!$this->hasAccessToResource($resource)) {\n throw new \\TYPO3\\Flow\\Security\\Exception\\AccessDeniedException('Access denied', 1283175927);\n }\n }", "public function authorize($serviceName, $methodName, $methodAccess);", "public function authorize(UserToken $token);", "public function toAuthorize($action){\r\n\r\n if($action == self::ACTION_AUTHORIZE_CAPTURE){\r\n return self::ACTION_AUTHORIZE;\r\n }\r\n\r\n return $action;\r\n }", "public function authorize()\n {\n switch($this->method()) {\n case 'GET':\n $cvReference = CvReference::findOrFail($this->id);\n $cv = Cv::findOrFail($cvReference->cv_id);\n return $this->user()->can('view', [Cv::class, $cv]);\n case 'POST':\n return $this->user()->can('create', Cv::class);\n case 'PUT':\n case 'PATCH':\n $cvReference = CvReference::findOrFail($this->id);\n $cv = Cv::findOrFail($cvReference->cv_id);\n return $this->user()->can('update', [Cv::class, $cv]);\n case 'DELETE':\n $cvReference = CvReference::findOrFail($this->id);\n $cv = Cv::findOrFail($cvReference->cv_id);\n return $this->user()->can('delete', [Cv::class, $cv]);\n default:break;\n }\n }", "public function authorize()\n {\n return true;\n // return Gate::allows('create-article'); //via form request\n }", "public function authorize()\t{\n\t\treturn true;\n\t}", "public function isAuthorized() {}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}", "public function authorize()\n\t{\n\t\treturn true;\n\t}" ]
[ "0.7414513", "0.7130785", "0.6988308", "0.6988308", "0.67508465", "0.67508465", "0.6702631", "0.64158064", "0.64080954", "0.63223964", "0.6310805", "0.6292154", "0.62204945", "0.6216495", "0.6198458", "0.6140613", "0.6134039", "0.6133433", "0.6127485", "0.6030986", "0.59828794", "0.5975779", "0.5968834", "0.5968747", "0.5962755", "0.5939991", "0.5939991", "0.5939991", "0.592846", "0.590857", "0.5895088", "0.5876868", "0.5876868", "0.5869619", "0.58645684", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58579177", "0.58561444", "0.5848703", "0.58474237", "0.5843523", "0.58347404", "0.58299196", "0.58257765", "0.58182275", "0.58065826", "0.5806406", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125", "0.57997125" ]
0.0
-1
Get the map of resource methods to ability names.
protected function resourceAbilityMap() { return [ 'index' => 'view', 'create' => 'create', 'store' => 'create', 'show' => 'view', 'edit' => 'update', 'update' => 'update', 'destroy' => 'delete', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function resourceAbilityMap()\n {\n return [\n 'edit' => 'update',\n 'update' => 'update',\n 'destroy' => 'delete',\n ];\n }", "protected function resourceAbilityMap()\n {\n return [\n //\n ];\n }", "protected function getAbilityMappings()\n {\n return [\n 'create' => 'store',\n 'edit' => 'update',\n ];\n }", "protected function getMethodsMap()\n {\n return [\n 'add' => 'addItemTo',\n 'set' => 'setProperty',\n 'unset' => 'unsetProperty'\n ];\n }", "protected function _getAuthorizationMapping() {\n\t\treturn array(\n\t\t\t'add' => 'write',\n\t\t\t'delete' => 'write',\n\t\t\t'edit' => 'write',\n\t\t\t'history' => 'read',\n\t\t\t'index' => 'read',\n\t\t\t'users' => 'read',\n\t\t\t'view' => 'read',\n\t\t\t'userlog' => 'read',\n\t\t\t'tasklog' => 'read',\n\t\t);\n\t}", "protected function getPermissionMappings()\n {\n return [];\n }", "private function getRuleToMethodMapping() {\n return array(\n 'compare_vowels' => \"applyCompareVowels\",\n 'arrr_bacon' => \"applyArrrBacon\",\n \"bacon_arrr\" => \"applyBaconArrr\",\n \"pattern\" => \"applyPattern\",\n \"match_making\" => \"applyMatchMaking\"\n );\n }", "static protected function get_resource_actions(): array\n\t{\n\t\treturn [\n\n\t\t\tself::ACTION_INDEX => [ '/{name}', Request::METHOD_GET ],\n\t\t\tself::ACTION_NEW => [ '/{name}/new', Request::METHOD_GET ],\n\t\t\tself::ACTION_CREATE => [ '/{name}', Request::METHOD_POST ],\n\t\t\tself::ACTION_SHOW => [ '/{name}/{id}', Request::METHOD_GET ],\n\t\t\tself::ACTION_EDIT => [ '/{name}/{id}/edit', Request::METHOD_GET ],\n\t\t\tself::ACTION_UPDATE => [ '/{name}/{id}', [ Request::METHOD_PUT, Request::METHOD_PATCH ] ],\n\t\t\tself::ACTION_DELETE => [ '/{name}/{id}', Request::METHOD_DELETE ]\n\n\t\t];\n\t}", "public static function getMap()\n {\n $map = [\n 'project' => ProjectResource::class,\n 'issue' => IssueResource::class\n ];\n return $map;\n }", "public static function attributeMap()\n {\n return [\n 'status' => 'status',\n 'quota' => 'quota'\n ];\n }", "public function getAllowedMethods() {\n //we only have one method so just return the name from the admin panel\n return array('bluedart' => $this->getConfigData('title'));\n }", "public static function getRolesMap()\n {\n return ArrayHelper::map(static::getNotDefaultRoles(), 'name', 'description');\n }", "public static function attributeMap()\n {\n return [\n 'application_id' => 'application_id',\n 'is_default' => 'is_default',\n 'role' => 'role',\n 'type' => 'type',\n '_issues' => '_issues'\n ];\n }", "public function getAllowedMethods()\n {\n return array('bestway'=>$this->getConfigData('name'));\n }", "public function getAllowedMethods()\n {\n return ['loomisrate' => __('Loomis')];\n }", "protected function getSupportedAttributes()\n {\n return [\n ResourceActions::CREATE,\n ResourceActions::DELETE,\n ResourceActions::INDEX,\n ResourceActions::SHOW,\n ResourceActions::UPDATE,\n ];\n }", "public function getResourceActions()\n {\n if (array_key_exists(\"resourceActions\", $this->_propDict)) {\n return $this->_propDict[\"resourceActions\"];\n } else {\n return null;\n }\n }", "public static function attributeMap();", "public function get_icon_name_map() {\n return [];\n }", "public function getRolesMap() {\n\t\treturn Roles::$ROLE_MAP;\n\t}", "static function getPermissionNames() {\n return static::getPermissions()->keys();\n }", "function adleex_resource_define_cap() {\n\t$admin = get_role('administrator');\n\t$admin->add_cap('delete_resources');\n\t$admin->add_cap('edit_resources');\n\t$admin->add_cap('publish_resources');\n\t$admin->add_cap('edit_published_resources');\n\t$admin->add_cap('delete_published_resources');\n\t$admin->add_cap('read_private_resources');\n\t$admin->add_cap('edit_private_resources');\n\t$admin->add_cap('delete_private_resources');\n\t$admin->add_cap('edit_others_resources');\n\t$admin->add_cap('delete_others_resources');\n}", "public function getAllowedMethods()\n {\n return [$this->getCarrierCode() => __($this->getConfigData('name'))];\n }", "public static function attributeMap()\n {\n return [\n 'tenant_id' => 'tenant_id',\n 'expires_in' => 'expires_in',\n 'scopes' => 'scopes'\n ];\n }", "protected function methods() {\n\t\treturn array(\n\t\t\t'status' => 'GET',\n\t\t\t'sessions' => 'POST',\n\t\t);\n\t}", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\r\n {\r\n return self::$attributeMap;\r\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }", "public static function attributeMap()\n {\n return self::$attributeMap;\n }" ]
[ "0.8319399", "0.80452526", "0.71471304", "0.6754547", "0.6465148", "0.6369887", "0.6369881", "0.63488036", "0.63461006", "0.6160315", "0.6110951", "0.5977814", "0.59642", "0.5888764", "0.58881193", "0.58534116", "0.58451504", "0.58186066", "0.5796705", "0.57944775", "0.5781874", "0.57416373", "0.57260925", "0.5689522", "0.5674301", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5672823", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889", "0.5664889" ]
0.8250301
1
/ The following functions are defined in /include/util_functions.php is_extant( $some_value ) make_safe( $some_value ) verify_phone( $phone_number ) add_err( $some_error_message ) chk_regx_add_err( $value_to_check, $error_message_on_failure, $regular_expression ) get_insert_stmt( $table_name, $sql_statement ) get_update_stmt( $table_name, $sql_statement ) errors_exist() The following are defined in /include/QueryObject_PHP4.php new QueryObject( $sql_statement, $database_link ); query_was_good( $QueryObject_instance ) < wont blowup on null ref query_has_results( $QueryObject_instance ) < wont blowup on null ref
function user_home() { $this->secure_page(); // Very important. global $site_globals; // To eliminate typing... $link = $site_globals['link']; $_REQUEST['item_type'] == 'found' ? $lost_flag = '1' : $lost_flag = '0'; $sql = "SELECT item_id,description,item_comment,reward,address,city,state,zip,lost_found_flag,DATE_FORMAT(lost_found_date,'%M %e, %Y') as lfd, DATE_FORMAT(date_posted,'%M %e, %Y') as dp, user_id, photo_path FROM {$site_globals['ITEMS_TABLE']} WHERE user_id='{$_SESSION['user_id']}' AND lost_found_flag='$lost_flag'"; $qryObj = new QueryObject($sql, $link); // The $content template that will be inserted into and displayed with // the master template... $content = $site_globals['TEMPLATE_PATH']."/user_home.template.php"; include $site_globals['TEMPLATE_PATH']."/master.template.php"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function db_query($query, $link_id,$debug=false, $die_on_debug=true, $silent=false,$executedto=\"Local\") {\n if ($link_id!=\"mlks\"){\n\t\n \t\n \n\tif ($GLOBALS['DB_DEBUG']) {\n\t\techo \"<pre>\" . htmlspecialchars($query) . \"(\".$executedto.\")</pre>\";\nif ($die_on_debug&&$GLOBALS['DB_DIE_ON_DEBUG']) die;\n\t\n\t}\n/*\n$query=(substr($query,0,stripos($query,\"FROM\"))).strtolower(substr($query,stripos($query,\"FROM\")));\n$query=LowTblNames($query,\",\");\n*/\n\t$qid = mysqli_query($link_id,$query);\n\n\n\tif (! $qid && ! $silent) {\n\t\tif ($GLOBALS['DB_DEBUG']||$debug) {\n\t\t\techo \"<h2>Can't execute query</h2>\";\n\t\t\techo \"<pre>\" . htmlspecialchars($query) . \"</pre>\";\n\t\t\techo \"<p><b>MySQL Error</b>: \", mysqli_error($link_id);\n\t\t} else {\n\t\t\t$file=fopen(\"./errorlog/mysqlerrors.html\",\"ab\");\n\t\t\tfwrite($file,\"<p>user \".$GLOBALS['USER'][\"user\"][\"firstname\"].\" \".$GLOBALS['USER'][\"user\"][\"lastname\"].\" from \".$GLOBALS['USER'][\"user\"][\"us_cc_id\"].\" at \".date('r').\"</p>\");\n\t\t\tfwrite($file,\"<h2>Can't execute query</h2>\".\"<pre>\" . htmlspecialchars($query) . \"</pre>\".\"<p><b>MySQL Error</b>: \".mysqli_error($link_id));\n\t\t\t$serializedPost = serialize($_POST);\n\t$res = date('l jS \\of F Y h:i:s A');\n\t\n\t$message = \"<br><i>executed at: \".$res.\" details: \".$executedto.\"</i><br><b>\".$query.\" </b>\".$serializedPost.\"<br>\";\t\n\tfwrite($file,$message);\n\t\t\tfclose($file);\n\t\t\techo \"<h2>Database error encountered</h2>\";\n\t\t}\n\n\t\tif (($GLOBALS['DB_DIE_ON_FAIL'])&&(!$silent)) {\n\t\t\techo \"<p>Oops, problem at :</p><p> $executedto </p>\";\n\n\t\t\tdb_log($query,$executedto);\n\t\t\tdie();\n\t\t}\n\t}elseif(! $qid && $silent){\n return $qid;\n }\n\t//db_log($query,$executedto);\n if ($debug) {\n\t\techo \"<pre>\" . htmlspecialchars($query) . \"(\".$executedto.\")</pre>\";\n }\n\treturn $qid;\n }\n //db_log($query,$executedto);\n return \"aaa\";\n}", "function sql_check($query) {\n\tsql_connect();\n\tglobal $defaultdb;\n\t$return = $defaultdb->check($query);\n\treturn $return;\n}", "function __query( &$q ){\n\t\t// esperando o $db->end();\n\t\tif( $this->smart_rollback ){\n\t\t\treturn false;\n\n\t\t}else if( $this->_has_validation_error ){\n\t\t\t// if( $this->_first_query_with_error ){\n\t\t\t// \t$this->_first_query_with_error = false;\n\t\t\t// \t$this->last_return = false;\n\t\t\t// \treturn false;\n\t\t\t// }\n\t\t\tif( $this->transaction_count ){\n\t\t\t\t$this->last_return = false;\n\t\t\t return false;\n\t\t\t}\n\t\t\t$this->_has_validation_error = false;\n\n\n\t\t\t// se for difserente de rollback, algo estah erradoVV\n\t\t}else{\n\t\t\t$this->validation_errors = false;\n\t\t}\n\t\tif( $this->echo_queries ){\n\t\t\tif( $this->echo_queries === DB::PLAIN_TEXT )\n\t\t\t\techo $q;\n\t\t\telse\n\t\t\t\techo strtr($q,array('>'=>'&gt;','<'=>'&lt;','&'=>'&amp;')).'<br/>';\n\t\t}\n\t\tif( $this->mode === DB::POSTGRESQL ){\n\t\t\t$r = pg_query( $this->link, $q );\n\t\t}elseif( $this->mode === DB::MYSQLI ){\n\t\t\t$r = $this->link->query( $q );\n\t\t}else{\n\t\t\t$r = mysql_query( $q, $this->link );\n\t\t}\n\n\t\t$err;\n\t\tif( $this->mode === DB::POSTGRESQL )\n\t\t\t$err = pg_last_error($this->link);\n\t\telseif( $this->mode === DB::MYSQLI )\n\t\t\t$err = $this->link->errno;\n\t\telse\n\t\t\t$err = mysql_errno($this->link);\n\n\t\tif( $err and $this->transaction_count ){\n\t\t\tif( $this->mode === DB::MYSQLI ){\n\t\t\t\t$this->trans_error = $this->link->errno;\n\t\t\t\t$this->trans_errno = $err;\n\t\t\t}elseif( $this->mode === DB::MYSQL ){\n\t\t\t\t$this->trans_error = mysql_errno($this->link);\n\t\t\t\t$this->trans_errno = $err;\n\t\t\t}\n\t\t\t$this->_query('ROLLBACK');\n\t\t\t$this->smart_rollback = true;\n\t\t\t$this->last_return = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif( $err ){\n\t\t\t$this->fire_error( \"<strong>The data base return an error: </strong>\".\n\t\t\t\t$this->db_error() );\n\t\t\t$this->last_return = false;\n\t\t\treturn false;\n\t\t}\n\t\tif( $r === true ){\n\t\t\t$this->last_return = true;\n\t\t\treturn true;\n\t\t}\n\t\t$this->last_return = 2;\n\t\treturn new DB_Result( $r, $this->link, $this->mode );\n\t}", "function SM_dbErrorCheck($rh, $obj=NULL, $fatal=true) {\n\n global $SM_siteManager, $SM_develState;\n\n if (isset($SM_siteManager)) {\n return $SM_siteManager->errorHandler->dbErrorCheck($rh, $obj,$fatal);\n }\n\n if (empty($rh)) {\n\n $msg = \"Database Query Error\";\n\n $lastid = $GLOBALS['SM_LAST_DB_ID'];\n if (empty($lastid))\n $lastid = 'default';\n \n if ($SM_develState && isset($this->dbHL[$lastid])) {\n $edata = $this->dbHL[$lastid]->errorInfo();\n $msg .= $edata[2];\n $msg .= ' <br>Query Was: ['.$this->dbHL[$lastid]->lastQuery.']';\n }\n\n if ($fatal) {\n SM_fatalErrorPage($msg,$obj);\n }\n else {\n // log error\n SM_debugLog($msg,$obj);\n // return\n return true;\n }\n\n }\n\n return false;\n\n}", "function _validateSQL($obj, $session, $sql, $method)\n {\n $use_array = array(\"a_sessionId\" => $session->sessionId, \"a_sessionKey\" => $session->sessionKey, \"a_SQL\" => $sql, \"a_resultType\" => $this->output_type);\n $res = $obj->call(\"validateSQL\", $use_array);\n\n // This is the old version that needed the overload extension\n // $res = $obj->validateSQL($session->sessionId, $session->sessionKey, $sql, $this->output_type);\n return $res;\n }", "function db_query($query) {\n $db = db_connect();\n $result = $db->query($query);\n \n if(!$result) {\n echo \"Query Error: \" . db_error();\n return false;\n }\n\n return $result;\n}", "function msql_error()\n{\n}", "function query_error_check($passed_result, $passed_query, $note=\"\") {\n\tif (!$passed_result) {\n\t\thtml_header('HI Asset DB - Error','');\n\t\tinclude(\"top_menu.php\");\n\t\techo \"<h2>Problem with query - \" . $note . \"</h2>\\n\";\n\t\techo \"<pre>\" . $query . \"\\n\";\n\t\techo pg_last_error();\n\t\techo \"</pre></body></html>\\n\";\n\t\texit();\n\t}\n\treturn;\n}", "function query($query){\n\t\tif(!$this->ready){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$return_val = 0;\n\t\t$this->flush();\n\t\n\t\t// Log how the function was called\n\t\t$this->func_call = \"\\$db->query(\\\"$query\\\")\";\n\t\n\t\t// Keep track of the last query for debug..\n\t\t$this->last_query = $query;\n\t\n\t\tif(defined('SQ_DEBUG') && SQ_DEBUG){\n\t\t\t$this->timer_start();\n\t\t}\n\t\n\t\t$this->result = @mysql_query($query, $this->dbh);\n\t\t$this->num_queries++;\n\t\n\t\tif(defined('SQ_DEBUG') && SQ_DEBUG){\n\t\t\t$this->queries[] = array($query, $this->timer_stop(), $this->get_caller());\n\t\t}\n\t\n\t\t// If there is an error then take note of it..\n\t\tif($this->last_error = mysql_error( $this->dbh )){\n\t\t\tthrow(new SQ_Exception($this->last_error, SQ_MYSQL_ERROR_CODE));\n\t\t}\n\t\n\t\tif(preg_match( '/^\\s*(create|alter|truncate|drop) /i', $query)){\n\t\t\t$return_val = $this->result;\n\t\t}elseif(preg_match( '/^\\s*(insert|delete|update|replace) /i', $query)){\n\t\t\t$this->rows_affected = mysql_affected_rows( $this->dbh );\n\t\t\t// Take note of the insert_id\n\t\t\tif(preg_match('/^\\s*(insert|replace) /i', $query)){\n\t\t\t\t$this->insert_id = mysql_insert_id($this->dbh);\n\t\t\t}\n\t\t\t// Return number of rows affected\n\t\t\t$return_val = $this->rows_affected;\n\t\t}else{\n\t\t\t// Select...\n\t\t\t$i = 0;\n\t\t\twhile($i < @mysql_num_fields( $this->result )){\n\t\t\t\t$this->col_info[$i] = @mysql_fetch_field( $this->result );\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$num_rows = 0;\n\t\t\twhile($row = @mysql_fetch_object( $this->result)){\n\t\t\t\t$this->last_result[$num_rows] = $row;\n\t\t\t\t$num_rows++;\n\t\t\t}\n\t\n\t\t\t@mysql_free_result($this->result);\n\t\n\t\t\t// Log number of rows the query returned\n\t\t\t// and return number of rows selected\n\t\t\t$this->num_rows = $num_rows;\n\t\t\t$return_val = $num_rows;\n\t\t}\n\n\t\treturn $return_val;\n\t}", "function sql_check($query)\n\t{\n $stmt = prepare($query);\n $return = $stmt->rowCount();\n return $return;\n\n\t\t//sql_connect();\n\t\t//global $defaultdb;\n\t\t//$return = $defaultdb->check($query);\n\t\t//return $return;\n\t}", "function sql_query($db_hst, $db_un, $db_pw, $db, $str_SQL = \"\"){//possibly pass db cred data as an array?\n $this->db_hst = $db_hst;\n $this->db_un = $db_un;\n $this->db_pw = $db_pw;\n $this->db = $db;\n \tif($str_SQL <> \"\"){\n \t\t$this->set_sql_string($str_SQL);\n \t\t$this->apply_sql();\n \t}\n \tif($this->bolDebug == 1){echo \"FUNCTION set_sql_string()<br>&nbsp; &nbsp; \\$db_hst=$db_hst, \\$db_un=$db_un, \\$db_pw=$db_pw, \\$db=$db \\$this->str_select_SQL=\" . $this->str_select_SQL . $this->strDebugNewLine;}\n }", "function query( $query ) {\n //return false;\n\n\n $return_val = 0;\n $this->flush();\n\n // Log how the function was called\n $this->func_call = \"\\$db->query(\\\"$query\\\")\";\n\n // Keep track of the last query for debug..\n $this->last_query = $query;\n\n if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )\n $this->timer_start();\n\n $this->result = $this->ezSQL->query($query);\n $this->num_queries++;\n\n if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )\n $this->queries[] = array( $query, $this->timer_stop() );\n\n /* If there is an error then take note of it..\n if ( $this->last_error = mysql_error( $this->dbh ) ) {\n $this->print_error();\n return false;\n }\n */\n\n if ( preg_match( '/^\\s*(create|alter|truncate|drop) /i', $query ) ) {\n $return_val = $this->result;\n } elseif ( preg_match( '/^\\s*(insert|delete|update|replace) /i', $query ) ) {\n $this->rows_affected = $this->ezSQL->rows_affected;\n // Take note of the insert_id\n if ( preg_match( '/^\\s*(insert|replace) /i', $query ) ) {\n $this->insert_id = $this->ezSQL->insert_id;\n }\n // Return number of rows affected\n $return_val = $this->rows_affected;\n } else {\n $return_val = $this->rows_affected;\n }\n\n return $return_val;\n }", "function query($query, $use_prepare=false)\n {\n if ($use_prepare)\n $param = &$this->getParamaters();\n \n\t\t\t// check for ezQuery placeholder tag and replace tags with proper prepare tag\n\t\t\t$query = str_replace(_TAG, '?', $query);\n \n\t\t\t// For reg expressions\n\t\t\t$query = str_replace(\"/[\\n\\r]/\",'',trim($query)); \n\n\t\t\t// initialize return\n\t\t\t$return_val = 0;\n\n\t\t\t// Flush cached values..\n\t\t\t$this->flush();\n\n\t\t\t// Log how the function was called\n\t\t\t$this->log_query(\"\\$db->query(\\\"$query\\\")\");\n\n\t\t\t// Keep track of the last query for debug..\n\t\t\t$this->last_query = $query;\n\n\t\t\t// Perform the query via std SQLite3 query or SQLite3 prepare function..\n if (!empty($param) && is_array($param) && ($this->getPrepare())) {\n $this->result = $this->query_prepared($query, $param);\t\n\t\t\t\t$this->setParamaters();\n } else \n $this->result = $this->dbh->query($query);\n\t\t\t$this->count(true, true);\n\n\t\t\t// If there is an error then take note of it..\n\t\t\tif (@$this->dbh->lastErrorCode())\n\t\t\t{\n\t\t\t\t$err_str = $this->dbh->lastErrorMsg();\n\t\t\t\t$this->register_error($err_str);\n\t\t\t\t$this->show_errors ? trigger_error($err_str,E_USER_WARNING) : null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Query was an insert, delete, update, replace\n\t\t\tif ( preg_match(\"/^(insert|delete|update|replace)\\s+/i\",$query) )\n\t\t\t{\n\t\t\t\t$this->rows_affected = @$this->dbh->changes();\n\t\t\t\t\n\t\t\t\t// Take note of the insert_id\n\t\t\t\tif ( preg_match(\"/^(insert|replace)\\s+/i\",$query) )\n\t\t\t\t{\n\t\t\t\t\t$this->insert_id = @$this->dbh->lastInsertRowID();\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return number of rows affected\n\t\t\t\t$return_val = $this->rows_affected;\n\t\n\t\t\t}\n\t\t\t// Query was an select\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\t// Take note of column info\t\n\t\t\t\t$i=0;\n\t\t\t\t$this->col_info = array();\n\t\t\t\twhile ($i < @$this->result->numColumns())\n\t\t\t\t{\n\t\t\t\t\t$this->col_info[$i] = new StdClass;\n\t\t\t\t\t$this->col_info[$i]->name = $this->result->columnName($i);\n\t\t\t\t\t$this->col_info[$i]->type = null;\n\t\t\t\t\t$this->col_info[$i]->max_length = null;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Store Query Results\n\t\t\t\t$num_rows=0;\n\t\t\t\twhile ($row = @$this->result->fetchArray(SQLITE3_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t// Store result as an objects within main array\n\t\t\t\t\t$obj= (object) $row; //convert to object\n\t\t\t\t\t$this->last_result[$num_rows] = $obj;\n\t\t\t\t\t$num_rows++;\n\t\t\t\t}\n \n\n\t\t\t\t// Log number of rows the query returned\n\t\t\t\t$this->num_rows = $num_rows;\n\t\t\t\t\n\t\t\t\t// Return number of rows selected\n\t\t\t\t$return_val = $this->num_rows;\n\t\t\t\n\t\t\t}\n \n //if (($param) && is_array($param) && ($this->getPrepare()))\n // $this->result->finalize(); \n\n\t\t\t// If debug ALL queries\n\t\t\t$this->trace||$this->debug_all ? $this->debug() : null ;\n\n\t\t\treturn $return_val;\n\t\t\n\t\t}", "function checkSQL($db_link, $sqlquery){\n\t\tif (!$sqlquery) die ('SQL-Statement failed: '.mysqli_error($db_link));\n\t}", "function dbquery() {\n\tglobal $kLastQuery, $kDBConnection;\n\n // connect now, if haven't before\n if (!$kDBConnection) {\n $kDBConnection = dbconnect();\n }\n\n\t$args = func_get_args();\n\t$query = call_user_func_array('dbprep', $args);\n\n\t$kLastQuery = $query;\n\n\t$query = preg_replace('/([^,\\(\\)\\s~]*)~[^,\\(\\)\\s]*/', '$1', $query);\n\t\n\t// if it was a INSERT, UPDATE, or DELETE, see how many rows were affected\n if (preg_match('/^INSERT|^UPDATE|^DELETE/i', $query)) {\n\t\t$result = mysql_query($query) or trigger_error(dberror() . \"\\n\\nThe query was: \" . $query);\n\t\t$count = mysql_affected_rows();\n\t\tif ($count > 1) {\n\t\t\t$fixquery = str_replace('%', '%%', $query);\n\t\t\tEWarning(EC_REALS_DATABASE, \"Query affected multiple rows: $fixquery => $count\",\n\t\t\t\t\t \"Query affected \" . $count . \" rows\");\n\t\t}\n\t} else {\n // Replace ^NINSERT, ^NUPDATE, ^NDELETE with INSERT, UPDATE, DELETE\n $query = preg_replace('/^N(INSERT|UPDATE|DELETE)/i', '$1', $query);\n\t\t$result = mysql_query($query) or trigger_error(dberror() . \"\\n\\nThe query was: \" . $query);\n\t}\n\n\tif (preg_match('/^INSERT/i', $query)) {\n\t\treturn mysql_insert_id();\n\t} elseif (preg_match('/^(UPDATE|DELETE)/i', $query)) {\n\t\treturn mysql_affected_rows();\n\t} else {\n\t\treturn $result;\n\t}\n}", "function sqliQuery($query) {\r\n global $mysqli;\r\n if ($query != \"\") {\r\n $result = $mysqli->query($query);\r\n if (mysqli_error($mysqli)) {\r\n var_dump($query, mysqli_error($mysqli));\r\n $sqlError = true;\r\n } else {\r\n $sqlError = false;\r\n }\r\n return $result;\r\n } else {\r\n return null;\r\n }\r\n}", "function querySQL($sql) {\n die ('unimplemented: '.__CLASS__.'::'.__FUNCTION__.' ('.__LINE__.':'.__FILE__.')');\n }", "function query_db($TYPE,$DB_TABLE,$DB_WHERECLAUSE,$DB_WHERECLAUSEEQUALTO,$TO_BE_FETCHED,$DB_ORDERBY,$DB_GROUPBY = NULL,$INSERT_ITEMS = NULL,$INSERT_VALUES = NULL,$DB_ORDERBY_ORDER = NULL)\n{\n\tglobal $dba;\n\t$return=\"\";\n\t$FETCHED=\"\";\n\tswitch($TYPE){\n\t\tcase 'INSERT':\n\t\t\t$sql = \"INSERT INTO \".$DB_TABLE.\" (\".$INSERT_ITEMS.\")\nVALUES (\".$INSERT_VALUES.\")\";\n\n\t\t\tif(!$result = $dba->query($sql)){\n\t\t\t\t/* SOMETHING HAPPENED; QUERY WENT WONKY */\n\t\t\t\t$result = $dba->error.\" <br /><br /> SQL: \".$sql;\n\t\t\t\techo $result;\n\t\t\t} else {\n\n\t\t\t}\n\t\tbreak;\n\t\tcase 'SELECT':\n\t\t\t//check to see if WHERE clause is not blank\n\t\t\tif($DB_WHERECLAUSE!=\"\"){\n\t\t\t\t// CHECKING FOR SPECIFICS\n\t\t\t\t// -- check to see if there are multiple where options\n\t\t\t\t// first explode the where\n\t\t\t\t$DB_WHERECLAUSE_LIST\t\t= explode(\",\",$DB_WHERECLAUSE);\n\t\t\t\t$DB_WHERECLAUSEEQUALTO_LIST\t= explode(\",\",$DB_WHERECLAUSEEQUALTO);\n\n\t\t\t\t//now check to see if there are more than 1\n\t\t\t\tif((count($DB_WHERECLAUSE_LIST) > 1) && (count($DB_WHERECLAUSEEQUALTO_LIST > 1))){\n\t\t\t\t\t/* MULTIPLE WHERES */\n\t\t\t\t\t$sql = \"SELECT * FROM `\".$DB_TABLE.\"`\";\n\t\t\t\t\tfor($i=0; $i<count($DB_WHERECLAUSE_LIST)-1; $i++){\n\t\t\t\t\t\t//first or extra? if first : WHERE ; else : AND\n\t\t\t\t\t\tif($i==0){$sql .= \"WHERE \";}\n\t\t\t\t\t\tif($i>0){$sql .= \" AND \";}\n\n\t\t\t\t\t\t// Find out if there is a :COMMA: found in the string\n\t\t\t\t\t\t$pos = strpos($DB_WHERECLAUSEEQUALTO_LIST[$i],\":COMMA:\");\n\t\t\t\t\t\tif ($pos != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// rewrite the where\n\t\t\t\t\t\t\t$THEWHERE = str_replace(\":COMMA:\",\",\",$DB_WHERECLAUSEEQUALTO_LIST[$i]);\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$THEWHERE = $DB_WHERECLAUSEEQUALTO_LIST[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$sql .= \"`\".$DB_WHERECLAUSE_LIST[$i].\"` \".$THEWHERE.\"\";\n\t\t\t\t\t}\n\t\t\t\t\tif($DB_ORDERBY_ORDER!=NULL){\n\t\t\t\t\t\tif($DB_GROUPBY!=NULL){$sql .= \" GROUP BY \".$DB_GROUPBY.\" ORDER BY \".$DB_ORDERBY.\" \".$DB_ORDERBY_ORDER.\"\";}else{$sql .= \" ORDER BY \".$DB_ORDERBY.\" \".$DB_ORDERBY_ORDER.\"\";}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($DB_GROUPBY!=NULL){$sql .= \" GROUP BY \".$DB_GROUPBY.\" ORDER BY \".$DB_ORDERBY.\" ASC\";}else{$sql .= \" ORDER BY \".$DB_ORDERBY.\" ASC\";}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* SINGLE WHERE */\n\t\t\t\t\tif($DB_ORDERBY_ORDER!=NULL){\n\t\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT * FROM `\".$DB_TABLE.\"`\n\t\t\t\t\t\t\tWHERE `\".$DB_WHERECLAUSE_LIST[0].\"` = '\".$DB_WHERECLAUSEEQUALTO_LIST[0].\"' ORDER BY \".$DB_ORDERBY.\" \".$DB_ORDERBY_ORDER.\"\n\t\t\t\t\t\t\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT * FROM `\".$DB_TABLE.\"`\n\t\t\t\t\t\t\tWHERE `\".$DB_WHERECLAUSE_LIST[0].\"` = '\".$DB_WHERECLAUSEEQUALTO_LIST[0].\"' ORDER BY \".$DB_ORDERBY.\" ASC\n\t\t\t\t\t\t\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($DB_ORDERBY_ORDER!=NULL){\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\tSELECT * FROM `\".$DB_TABLE.\"` ORDER BY \".$DB_ORDERBY.\" \".$DB_ORDERBY_ORDER.\"\n\t\t\t\t\t\";\n\t\t\t\t} else {\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\tSELECT * FROM `\".$DB_TABLE.\"` ORDER BY \".$DB_ORDERBY.\" ASC\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif(!$result = $dba->query($sql)){\n\t\t\t\t/* SOMETHING HAPPENED; QUERY WENT WONKY */\n\t\t\t\t$result = $dba->error.\" <br /><br /> SQL: \".$sql.\"<br /><br />WHERE CLAUSE: \".$DB_WHERECLAUSE.\"<br /><br />WHERE CLAUSE EQUAL TO: \".$DB_WHERECLAUSEEQUALTO;\n\t\t\t\techo $result;\n\t\t\t} else {\n\t\t\t\t/* GOOD QUERY; DO SHIT */\n\n\t\t\t\t/* OH THIS IS ALL DEBUG SHIT...DO NOT UNCOMMENT THIS\n\t\t\t\t*/\n\t\t\t\t//echo \"WHERE: \".$DB_WHERECLAUSE;\n\t\t\t\t//echo \"<br />WHERE = TO: \".$DB_WHERECLAUSEEQUALTO;\n\t\t\t\t//echo \"<br />TBF: \".$TO_BE_FETCHED;\n\t\t\t\t//echo \"<br />SQL: \".$sql;\n\n\t\t\t\twhile($FETCH=$result->fetch_assoc()){\n\t\t\t\t\t$FETCHED.=$FETCH[$TO_BE_FETCHED].\",\";\n\t\t\t\t\t$return=$FETCHED;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@$result->free();\n\t\tbreak;\n\t\tcase 'UPDATE':\n\t\t\t//check to see if WHERE clause is not blank\n\t\t\tif($DB_WHERECLAUSE!=\"\"){\n\t\t\t\t// CHECKING FOR SPECIFICS\n\t\t\t\t// -- check to see if there are multiple where options\n\t\t\t\t// first explode the where\n\t\t\t\t$DB_WHERECLAUSE_LIST\t\t= explode(\",\",$DB_WHERECLAUSE);\n\t\t\t\t$DB_WHERECLAUSEEQUALTO_LIST\t= explode(\",\",$DB_WHERECLAUSEEQUALTO);\n\n\t\t\t\t//now check to see if there are more than 1\n\t\t\t\tif((count($DB_WHERECLAUSE_LIST) > 1) && (count($DB_WHERECLAUSEEQUALTO_LIST > 1))){\n\t\t\t\t\t/* MULTIPLE WHERES */\n\t\t\t\t\t$sql = \"UPDATE `\".$DB_TABLE.\"` SET \".$INSERT_ITEMS.\" = '\".$INSERT_VALUES.\"' \";\n\t\t\t\t\tfor($i=0; $i<count($DB_WHERECLAUSE_LIST)-1; $i++){\n\t\t\t\t\t\t//first or extra? if first : WHERE ; else : AND\n\t\t\t\t\t\tif($i==0){$sql .= \"WHERE \";}\n\t\t\t\t\t\tif($i>0){$sql .= \" AND \";}\n\t\t\t\t\t\t$sql .= \"`\".$DB_WHERECLAUSE_LIST[$i].\"` \".$DB_WHERECLAUSEEQUALTO_LIST[$i].\"\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* SINGLE WHERE */\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\tUPDATE `\".$DB_TABLE.\"` SET \".$INSERT_ITEMS.\" = '\".$INSERT_VALUES.\"' WHERE `\".$DB_WHERECLAUSE_LIST[0].\"` = '\".$DB_WHERECLAUSEEQUALTO_LIST[0].\"'\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sql = \"\n\t\t\t\t\tUPDATE `\".$DB_TABLE.\"` SET \".$INSERT_ITEMS.\" = '\".$INSERT_VALUES.\"'\n\t\t\t\t\";\n\t\t\t}\n\n\t\t\t//MySqli Update Query\n\t\t\t$results = $dba->query($sql);\n\n\t\t\t//MySqli Delete Query\n\t\t\t//$results = $dba->query(\"DELETE FROM products WHERE ID=24\");\n\n\t\t\tif($results){\n\t\t\t\t//echo 'Success! record updated / deleted';\n\t\t\t}else{\n\t\t\t\techo 'Error : ('. $dba->errno .') '. $dba->error.'<br />';\n\t\t\t\techo \"WHERE: \".$DB_WHERECLAUSE;\n\t\t\t\techo \"<br />WHERE = TO: \".$DB_WHERECLAUSEEQUALTO;\n\t\t\t}\n\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\t//check to see if WHERE clause is not blank\n\t\t\tif($DB_WHERECLAUSE!=\"\"){\n\t\t\t\t// CHECKING FOR SPECIFICS\n\t\t\t\t// -- check to see if there are multiple where options\n\t\t\t\t// first explode the where\n\t\t\t\t$DB_WHERECLAUSE_LIST\t\t= explode(\",\",$DB_WHERECLAUSE);\n\t\t\t\t$DB_WHERECLAUSEEQUALTO_LIST\t= explode(\",\",$DB_WHERECLAUSEEQUALTO);\n\n\t\t\t\t//now check to see if there are more than 1\n\t\t\t\tif((count($DB_WHERECLAUSE_LIST) > 1) && (count($DB_WHERECLAUSEEQUALTO_LIST > 1))){\n\t\t\t\t\t/* MULTIPLE WHERES */\n\t\t\t\t\t$sql = \"DELETE FROM `\".$DB_TABLE.\"`\";\n\t\t\t\t\tfor($i=0; $i<count($DB_WHERECLAUSE_LIST)-1; $i++){\n\t\t\t\t\t\t//first or extra? if first : WHERE ; else : AND\n\t\t\t\t\t\tif($i==0){$sql .= \"WHERE \";}\n\t\t\t\t\t\tif($i>0){$sql .= \" AND \";}\n\t\t\t\t\t\t$sql .= \"`\".$DB_WHERECLAUSE_LIST[$i].\"` \".$DB_WHERECLAUSEEQUALTO_LIST[$i].\"\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* SINGLE WHERE */\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\tDELETE FROM `\".$DB_TABLE.\"` WHERE `\".$DB_WHERECLAUSE_LIST[0].\"` = '\".$DB_WHERECLAUSEEQUALTO_LIST[0].\"'\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sql = \"\n\t\t\t\t\tDELETE FROM `\".$DB_TABLE.\"`\n\t\t\t\t\";\n\t\t\t}\n\n\t\t\t//MySqli Update Query\n\t\t\t$results = $dba->query($sql);\n\n\t\t\t//MySqli Delete Query\n\t\t\t//$results = $dba->query(\"DELETE FROM products WHERE ID=24\");\n\n\t\t\tif($results){\n\t\t\t\t//echo 'Success! record updated / deleted';\n\t\t\t}else{\n\t\t\t\techo 'Error : ('. $dba->errno .') '. $dba->error.'<br />';\n\t\t\t\techo \"WHERE: \".$DB_WHERECLAUSE;\n\t\t\t\techo \"<br />WHERE = TO: \".$DB_WHERECLAUSEEQUALTO;\n\t\t\t}\n\t\tbreak;\n\t\tcase 'TRUNCATE':\n\t\t\t$sql = \"\n\t\t\t\tTRUNCATE TABLE `\".$DB_TABLE.\"`\n\t\t\t\";\n\n\t\t\t//MySqli Update Query\n\t\t\t$results = $dba->query($sql);\n\n\t\t\t//MySqli Delete Query\n\t\t\t//$results = $dba->query(\"DELETE FROM products WHERE ID=24\");\n\n\t\t\tif($results){\n\t\t\t\t//echo 'Success! record updated / deleted';\n\t\t\t}else{\n\t\t\t\techo 'Error : ('. $dba->errno .') '. $dba->error.'<br />';\n\t\t\t\techo \"WHERE: \".$DB_WHERECLAUSE;\n\t\t\t\techo \"<br />WHERE = TO: \".$DB_WHERECLAUSEEQUALTO;\n\t\t\t}\n\t\tbreak;\n\t}\n\treturn $return;\n}", "public function sql_error() {}", "public function sql_error() {}", "function sql_query($query,$dbh=NULL) {\n global $CONF, $SQLCount,$SQL_DBH;\n $SQLCount++;\n//echo '<hr />SQL_DBH: ';\n//print_r($SQL_DBH);\n//echo '<hr />DBH: ';\n//print_r($dbh);\n//echo '<hr />';\n//echo $query.'<hr />';\n $db = (!is_null($dbh) ? $dbh : $SQL_DBH);\n if (is_object($db))\n $res = $db->query($query);\n else\n $res = false;\n if (!$CONF['debug'])\n return $res;\n\n if ($res === false) {\n print(\"SQL error with query $query: \" . '<p />');\n } else if ($res->errorCode() != '00000') {\n $errors = $res->errorInfo();\n print(\"SQL error with query $query: \" . $errors[0].'-'.$errors[1].' '.$errors[2] . '<p />');\n }\n \n return $res;\n }", "function query($query) {\n\t\t\t\n\t\t\t// For reg expressions\n\t\t\t$query = trim($query); \n\t\t\t$is_update = preg_match(\"/^(insert|delete|update|replace)\\s+/i\",$query);\n\n\t\t\tif (!$this->dbh || ($is_update && ! $this->dbh_update !== $this->dbh) ) $this->connect($is_update);\n\n\t\t\t\n\t\t\t// initialise return\n\t\t\t$return_val = 0;\n\n\t\t\t// Flush cached values..\n\t\t\t$this->flush();\n\n\t\t\t// Perform the query via std mysql_query function..\n\t\t\t$this->result = @mysql_query($query,$this->dbh);\n\t\t\t$this->num_queries++;\n\n\t\t\t// If there is an error then take note of it..\n\t\t\tif ( mysql_error() ) {\n\t\t\t\t$this->print_error();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// Query was an insert, delete, update, replace\n\t\t\tif ( $is_update ) {\n\t\t\t\t$this->rows_affected = mysql_affected_rows();\n\t\t\t\t\n\t\t\t\t// Take note of the insert_id\n\t\t\t\tif ( preg_match(\"/^(insert|replace)\\s+/i\",$query) ) {\n\t\t\t\t\t$this->insert_id = mysql_insert_id($this->dbh);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Return number fo rows affected\n\t\t\t\t$return_val = $this->rows_affected;\n\t\t\t} else {\n\t\t\t// Query was an select\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t*** WARN WARN\n\t\t\t\t*** We don't use col info\n\t\t\t\t*** Commented out meanwhile\n\t\t\t\t// Take note of column info\t\n\t\t\t\t$i=0;\n\t\t\t\twhile ($i < @mysql_num_fields($this->result)) {\n\t\t\t\t\t$this->col_info[$i] = @mysql_fetch_field($this->result);\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t// Store Query Results\t\n\t\t\t\t$num_rows=0;\n\t\t\t\twhile ( $row = @mysql_fetch_object($this->result) ) {\n\t\t\t\t\t// Store relults as an objects within main array\n\t\t\t\t\t$this->last_result[$num_rows] = $row;\n\t\t\t\t\t$num_rows++;\n\t\t\t\t}\n\n\t\t\t\t@mysql_free_result($this->result);\n\n\t\t\t\t// Log number of rows the query returned\n\t\t\t\t$this->num_rows = $num_rows;\n\t\t\t\t\n\t\t\t\t// Return number of rows selected\n\t\t\t\t$return_val = $this->num_rows;\n\t\t\t}\n\n\t\t\treturn $return_val;\n\t\t}", "abstract protected function _query($sql);", "function cSsql_write_error($sql_query_result)\r\n{\r\n if (!$sql_query_result)\r\n {\r\n return_error('mysql', mysql_errno(), mysql_error());\r\n //echo('<error type=\"mysql\" no=\"'.mysql_errno().'\">'.mysql_error().'</error>');\r\n }\r\n return !$sql_query_result;\r\n}", "private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }", "function execute_prepared_query($prep_q, $bound_vars, $bound_var_types, $result_expected = false)\n{\n\tglobal $spebs_db;\n\t$pstmt = $spebs_db -> prepare($prep_q);\t\n\tif($spebs_db->errno != 0)\n\t{\n\t\terror_log(\"PREPARE STATEMENT error \".$spebs_db->errno.\": \".$spebs_db->error.\" (Q = \\\"$prep_q\\\")\");\n\t\treturn false;\n\t}\n\t\n\t$bound_varrefs = array();\n\t$bound_varrefs[0] = $bound_var_types;\n\t$i=1;\n\tforeach($bound_vars AS $thisvar)\n\t{\t\n\t\t${\"x$i\"} = $thisvar;\n\t\t$bound_varrefs[$i] = &${\"x$i\"};\n\t\t$i++;\n\t}\n\t$bind_action = call_user_func_array(array($pstmt, 'bind_param'), $bound_varrefs);\n\tif(!$bind_action)\n\t{\t\n\t\terror_log(\"CALL_USER_FUNC_ARRAY error \");\n\t\treturn false;\n\t}\n\tif($pstmt->errno != 0)\n\t{\n\t\terror_log(\"PREPARED QUERY BIND error \".$pstmt->errno.\": \".$pstmt->error);\n\t\treturn false;\n\t}\t\n\tif($pstmt -> execute())\n\t{\n\t\tif(!$result_expected)\n\t\t{\n\t\t\tif(isset($pstmt -> insert_id) && is_int($pstmt -> insert_id) && $pstmt -> insert_id > 0)\n\t\t\t\t$res = $pstmt -> insert_id;\n\t\t\telse\n\t\t\t\t$res = true;\n\t\t\t\t\n\t\t\t$pstmt -> close();\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$results = array();\n\t\t\t$row = array();\n\t\t\t$metadata = $pstmt -> result_metadata();\n\t\t\tforeach($metadata -> fetch_fields() AS $field)\n\t\t\t{\t\n\t\t\t\t$row[$field -> name] = NULL;\n\t\t\t\t$bound_resrefs[] = &$row[$field -> name];\n\t\t\t}\n\t\t\t$bind_action = call_user_func_array(array($pstmt, 'bind_result'), $bound_resrefs);\n\t\t\t$i = 0;\n\t\t\twhile($pstmt -> fetch())\n\t\t\t{\t\n\t\t\t\tforeach($row AS $k => $v)\n\t\t\t\t$results[$i][$k] = $v;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t$pstmt -> close();\n\t\t\treturn $results;\n\t\t}\n\t\t\n\t}\n\telse\n\t{\n\t\terror_log($pstmt->errno.\": \".$pstmt->error);\n\t\t$pstmt -> close();\t\n\t\treturn false;\n\t}\n}", "function db_query ($query)\n{\n global $CONF;\n $link = db_connect ();\n $result = @mysql_query ($query, $link) or die (\"<p />DEBUG INFORMATION:<br />Invalid query: \" . mysql_error());\n if (eregi (\"^select\", $query))\n {\n // if $query was a select statement check the number of rows with mysql_num_rows ().\n $number_rows = mysql_num_rows ($result);\n }\n else\n {\n // if $query was something else, UPDATE, DELETE or INSERT check the number of rows with\n // mysql_affected_rows ().\n $number_rows = mysql_affected_rows ($link);\n }\n $return = array (\n \"result\" => $result,\n \"rows\" => $number_rows\n );\n return $return;\n}", "function prepareQuery($db, $query) {\n if (!($stmt = $db->prepare($query))) {\n echo \"Database query error (\".$db->errno.\"). \".$db->error;\n die();\n }\n return $stmt;\n}", "function pdo_query($sql, $link=NULL, $params=NULL) {\r\n\r\n // separate params from $sql and $link \r\n $params = func_get_args();\r\n $sql = TRIM( array_shift($params) );\r\n $flags = array();\r\n $direct = false;\r\n \r\n\r\n // find pdo $link \r\n if (count($params)) {\r\n // $link can be the first element\r\n if (is_object(reset($params))) {\r\n $link = array_shift($params);\r\n }\r\n // or the last\r\n elseif (is_object(end($params))) {\r\n $link = array_pop($params);\r\n }\r\n }\r\n // or we use the default $pdo\r\n $link = pdo_handle($link);\r\n \r\n // is $params a list to pdo_query(), or just one array with :key=>value pairs?\r\n if (count($params)==1 && is_array($params[0])) {\r\n $params = array_shift($params);\r\n }\r\n\r\n\r\n // add PDO_MySQL driver flag / workaround for specific query types\r\n switch (strtoupper(substr($sql, 0, strspn(strtoupper($sql), \"SELECT,USE,CREATE\")))) {\r\n\r\n // ought to make ->rowCount() work\r\n case \"SELECT\":\r\n $flags[PDO::MYSQL_ATTR_FOUND_ROWS] = true;\r\n break;\r\n\r\n // temporarily disable prepared statement mode for unbindable directives\r\n case \"USE\":\r\n $direct = true;\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\r\n break;\r\n\r\n default:\r\n }\r\n\r\n\r\n // unparameterized query()\r\n if ($direct) {\r\n $stmt = $link->query($sql);\r\n $link->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\r\n }\r\n // or prepare() and execute()\r\n else {\r\n if ($stmt = $link->prepare($sql, $flags)) { // no try-catch in _WARNING mode\r\n $stmt->execute($params);\r\n }\r\n }\r\n \r\n // result\r\n if (!$stmt and PDO_HELPFUL) {\r\n pdo_trigger_error(\"pdo_query() SQL query failed, see pdo_error()\", E_USER_WARNING);\r\n }\r\n elseif (PDO_SEEKABLE & !$direct) {\r\n return new PDOStatement_Seekable($stmt, $params);\r\n }\r\n else {\r\n return $stmt;\r\n }\r\n }", "function error_string($query)\n\t{\n\t\tif(!is_object($query) || !method_exists($query, \"errorInfo\"))\n\t\t{\n\t\t\treturn $this->db->errorInfo();\n\t\t}\n\t\treturn $query->errorInfo();\n\t}", "function query($sql = null)\n\t{\n\t\t// Reset error statuses\n\t\t$this->errno = 0;\n\t\t$this->error = '';\n\n\t\t// Should we set a new query? Allows for tight coding :)\n\t\tif(!is_null($sql))\n\t\t{\n\t\t\t$this->setQuery($sql);\n\t\t}\n\n\t\t// Catch empty SQL statements\n\t\tif(empty($this->sql))\n\t\t{\n\t\t\t$this->sql = '';\n\t\t\treturn true;\n\t\t}\n\n\t\t// If there is no active connection, try to connect\n\t\tif(empty($this->handle))\n\t\t{\n\t\t\tif(!$this->connect())\n\t\t\t{\n\t\t\t\t// If conenction failed, exit\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tswitch($this->dbtype)\n\t\t{\n\t\t\tcase 'mysql':\n\t\t\t\t$result = @mysql_query($this->sql, $this->handle);\n\t\t\t\tbreak;\n\n\t\t\tcase 'mysqli':\n\t\t\t\t$result = @mysqli_query($this->handle, $this->sql);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif($result === FALSE)\n\t\t{\n\t\t\t// @todo Translate\n\t\t\tswitch($this->dbtype)\n\t\t\t{\n\t\t\t\tcase 'mysql':\n\t\t\t\t\t$this->error = 'MySQL query failed with error '.mysql_errno($this->handle).' ('. mysql_error($this->handle) .'). The query was:'.$this->sql;\n\t\t\t\t\t$this->errno = mysql_errno($this->handle);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'mysqli':\n\t\t\t\t\t$this->error = 'MySQL query failed with error '.mysqli_errno($this->handle).' ('. mysqli_error($this->handle) .'). The query was:'.$this->sql;\n\t\t\t\t\t$this->errno = mysqli_errno($this->handle);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->resource = $result;\n\t\t\t$this->sql = '';\n\t\t\treturn true;\n\t\t}\n\n\t}", "abstract public function query($sql, $errorLevel = E_USER_ERROR);", "function _query($sql,$inputarr=false)\n\t{\n\t\t$rs = @ldap_search( $this->_connectionID, $this->database, $sql );\n\t\t$this->_errorMsg = ($rs) ? '' : 'Search error on '.$sql.': '.ldap_error($this->_connectionID);\n\t\treturn $rs;\n\t}", "abstract public function\r\n\t\tget_query_for_something();", "function query($ssql)\n{\n try {\n global $msg;\n $connection = DbConnect();\n $result = $connection->query($ssql);\n if ($connection->errno != 0) {\n echo $connection->error;\n echo \"<br>\" . $connection . \"<br>\" . $ssql;\n exit();\n }\n\n if ($result->num_rows > 0) {\n $DbResult = $result->fetch_all();\n }\n\n $msg = getMessageFromOperationResultToDatabase($connection);\n $connection->close();\n return $DbResult;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n}", "function Sql_queryE( $query ) {\n\tglobal $db;\n\tmysql_query( $query, $db );\n\t$sqlerr=mysql_errno()*1;\n\treturn $sqlerr;\n}", "function _db_error($link = NULL) {\n\treturn @mysql_error($link);\n}", "function query_check($query) {\n global $connection; \n\n $result = mysqli_query($connection, $query); \n\n if (!$result) {\n die(\"<br>QUERY failed!\" . mysqli_error());\n }\n\n return $result;\n}", "function safe_query ($query = \"\")\n{\n\tglobal\t$mylink;\n\t// echo $query.\"<br>\";\n\tif (empty($query)) { return FALSE; }\n\n\t// if (!empty($query_debug)) { print \"<pre>$query</pre>\\n\"; }\n\t$result = mysqli_query($mylink, $query);\n\n\treturn $result;\n}", "function sql_error($dbh=NULL)\n {\n global $SQL_DBH;\n $db = (!is_null($dbh) ? $dbh : $SQL_DBH);\n if ( is_object($db) )\n $error = $db->errorInfo();\n else\n $error = array('Handle is not object','','');\n if ($error[0] != '00000') {\n return $error[0].'-'.$error[1].' '.$error[2];\n }\n else return '';\n }", "function checkQueryIsOK($query)\n{\n//\techo strpos($query,'%');\n\tif(strpos($query,'%')!==false)\n\t\treturn -1;\n\tif(strpos($query,'_')!==false)\n\t\treturn -1;\n\tif(strpos($query,'<')!==false)\n\t\treturn -1;\n\tif(strpos($query,'>')!==false)\n\t\treturn -1;\n\tif(strpos($query,'*')!==false)\n\t\treturn -1;\n\tif(strpos($query,'(')!==false)\n\t\treturn -1;\n\tif(strpos($query,')')!==false)\n\t\treturn -1;\n\tif(strpos($query,'$')!==false)\n\t\treturn -1;\n\tif(strpos($query,'!')!==false)\n\t\treturn -1;\n\tif(strpos($query,'@')!==false)\n\t\treturn -1;\n\tif(strpos($query,'#')!==false)\n\t\treturn -1;\n\tif(strpos($query,'^')!==false)\n\t\treturn -1;\n\tif(strpos($query,'=')!==false)\n\t\treturn -1;\n\tif(strpos($query,'+')!==false)\n\t\treturn -1;\n\tif(strpos($query,'\"')!==false)\n\t\treturn -1;\n\tif(strpos($query,'`')!==false)\n\t\treturn -1;\n\tif(strpos($query,'{')!==false)\n\t\treturn -1;\n\tif(strpos($query,'}')!==false)\n\t\treturn -1;\n\tif(strpos($query,'[')!==false)\n\t\treturn -1;\n\tif(strpos($query,']')!==false)\n\t\treturn -1;\n\tif(strpos($query,'/')!==false)\n\t\treturn -1;\n\tif(strpos($query,'\\\\')!==false)\n\t\treturn -1;\n\tif(strpos($query,'?')!==false)\n\t\treturn -1;\n\tif(strpos($query,';')!==false)\n\t\treturn -1;\n\tif(strpos($query,':')!==false)\n\t\treturn -1;\n\telse\n\t\treturn 1;\n}", "function so_sql()\n\t{\n\t\tthrow new egw_exception_assertion_failed('use __construct()!');\n\t}", "function query($query, $use_prepare=false) {\n\t\treturn false;\n\t}", "function db_query($query) {\n $db = db_connect();\n\n // Query the database\n $result = $db->query($query);\n\t\tif($result === false) {\n\t\t\t\tdb_error($query);\n\t\t\t\treturn false;\n\t\t}\n return $result;\n}", "function runSql ( // r - null == no records found/updated, false == error, success 0,1,2,3....n\n $mysql,\n $abind_params,\n $close = false,\n &$ref_status_text = ''\n){\n\n $ref_status_text = '';\n $conn = '';\n $sth = '';\n $result = false;\n \n $msg = '';\n \n $driver = new mysqli_driver();\n $driver->report_mode = MYSQLI_REPORT_OFF;\n \n //ini_set('display_errors', '0');\n \n try {\n \n if (!$conn = db_connect()) {\n $error = '';\n if (isset($conn->error)) {\n $error = $conn->error;\n }\n formatSessionMessage(\"runSql() db_connect() error\", 'danger', $msg, $error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n return false;\n }\n \n if (@!$sth = $conn->prepare($mysql)) {\n formatSessionMessage(\"runSql() prepare() error\", 'danger', $msg, $conn->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n (!empty($sth) && @$sth->close());\n @$conn->close();\n return false;\n }\n \n if ($abind_params != '') {\n if (@!call_user_func_array(array($sth, 'bind_param'), refValues($abind_params))) {\n $error = '';\n if (isset($sth->error)) {\n $error = $sth->error;\n } else if (isset($conn->error)) {\n $error = $conn->error;\n }\n formatSessionMessage(\"runSql() bind_param() error\", 'danger', $msg, \"rs-3205 $error\");\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n (!empty($sth) && @$sth->close());\n @$conn->close();\n return false;\n }\n }\n \n if (@!$sth->execute()) {\n formatSessionMessage(\"runSql() execute() error: \", 'danger', $msg, $sth->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n \n // ... right from the manual\n // An integer greater than zero indicates the number of rows affected or retrieved. \n // Zero indicates that no records were updated for an UPDATE statement, no rows \n // matched the WHERE clause in the query or that no query has yet been executed.\n // -1 indicates that the query returned an error. \n \n if($close){ // update action\n $result = $sth->affected_rows;\n if ($result === -1) { // There was an error. It didn't execute.\n $ref_status_text = 'error';\n return false;\n } else if ($result === false) { // This isn't spec'd but test anyway.\n $ref_status_text = 'false';\n return false;\n } else if ($result === 0) { // No record was found. No error.\n $ref_status_text = 'zero';\n return null;\n } else {\n $ref_status_text = 'number'; // Record was updated\n return $result;\n }\n } else {\n $meta = $sth->result_metadata();\n \n // http://us2.php.net/manual/en/mysqli-result.fetch-field.php\n // Returns the definition of one column of a result set as an object. Call \n // this function repeatedly to retrieve information about all columns in the result set. \n while ( $field = $meta->fetch_field() ) {\n $parameters[] = &$row[$field->name];\n } \n \n if (!$rtn = call_user_func_array(array($sth, 'bind_result'), refValues($parameters))) {\n if (isset($sth->error)) {\n formatSessionMessage(\"runSql() call_user_func_array() bind_result error: \", 'danger', $msg, \"mpdb-3253 \" . $sth->error);\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n } elseif ($rtn === false) {\n formatSessionMessage(\"runSql() call_user_func_array() false \", 'danger', $msg, \"mpdb-3260\");\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n formatSessionMessage(\"runSql() call_user_func_array() unknown error \", 'danger', $msg, 'mpdb-3267');\n setSessionMessage($msg, 'error');\n $ref_status_text = 'dberror';\n @$sth->close();\n @$conn->close();\n return false;\n }\n \n while ( $sth->fetch() ) { \n $x = array(); \n foreach( $row as $key => $val ) { \n $x[$key] = $val; \n } \n $results[] = $x; \n }\n $result = (isset($results)) ? $results : null; // Nothing? Returns null;\n }\n\n } catch (mysqli_sql_exception $e) {\n $ermsg = \"\n runSql() mysqli_sql_exception \\n\n sql: $mysql \\n\\n\n MYSQL ERROR TO STRING: \" . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n } catch (exception $e) {\n $ermsg = \"\n runSql() exception \\n\n sql: $mysql \\n\\n\n exception: \" . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n }\n \n @ $sth->close();\n @ $conn->close();\n \n return $result;\n\n}", "function dbqueryGMS( $db_link, $query_str, $row_count, $av1)\n{\n\t#$result = $stmt->setFetchMode(PDO::FETCH_NUM); # will return results in array with integer index (not col name)\n\ttry {\n\t\t$result = $db_link->query( $query_str );\n\t\t$row_count = $result->rowCount();\n\t} catch (PDOException $e) {\nprint_r($db_link->errorInfo());\n\t\tgmsError( 'ECDBQUERY', $e->getMessage(), '', '', '' );\n\t\t$row_count = 0;\n\t\treturn null;\n\t}\t\t\n\treturn $result;\n}", "function good_query($string, $debug=0)\n{\n if ($debug == 1)\n print $string;\n\n if ($debug == 2)\n error_log($string);\n\n $result = mysql_query($string);\n\n if ($result == false)\n {\n error_log(\"SQL error: \".mysql_error().\"\\n\\nOriginal query: $string\\n\");\n\t// Remove following line from production servers \n die(\"SQL error: \".mysql_error().\"\\b<br>\\n<br>Original query: $string \\n<br>\\n<br>\");\n }\n return $result;\n}", "function SQL_CHECK ( $NO_ROWS=1, $errmsg=\"An error occured\" )\n {\n global $bx_temp_query, $bx_query_time, $HTTP_SERVER_VARS, $HTTP_POST_VARS;\n $res = mysql_errno();\n $error = mysql_error();\n $error_flag = 0;\n $subtype = 0;\n if ($res==0) {\n // query successfully executed - so check NO_ROWS case\n if (($NO_ROWS) && (mysql_affected_rows()==0)) {\n // error: no rows returned\n $error_flag = 1;\n $subtype = 1;\n }\n }\n else {\n // an error occured\n $error_flag = 1;\n $post=\"\";\n while (list($header, $value) = each($HTTP_POST_VARS)) {\n $post.=\"\\nPOST: \".$header.\" - \".((is_array($value))?implode(\",\",$value):$value).\"\";\n }\n }\n if ($error_flag && DEBUG_MODE==\"no\") {\n echo \"<br><table bgcolor=\\\"#FF0000\\\" border=\\\"0\\\" width=\\\"70%\\\" align=\\\"center\\\" cellpadding=\\\"0\\\" cellspacing=\\\"1\\\">\";\n echo \"<tr><td bgcolor=\\\"#EFEFEF\\\">\";\n echo \"<font color=\\\"red\\\"><b>Sorry....</b><br>An error occured during this request. An detailed error report was sent to <b>admin</b>,<br> so the error will be solved soon.<br><b>Please come back later. Thank you.</b></font></td></tr></table>\";\n // sending the email\n @mail\n (\n SITE_MAIL, SITE_TITLE.\": An SQL error occured\",\n // Message\n SITE_TITLE.\": An SQL error occured:\\n\".\n \"$errmsg\\n\\n\".\n \"MySQL error code: $res\\n\".\n \"MySQL error text: $error\\n\".\n \"Query: $bx_temp_query\\n\".\n \"Query took: $bx_query_time ms\\n\".\n \"Date: \".date('Y-m-d H:i:s').\"\\n\".\n \"IP: \".$HTTP_SERVER_VARS['REMOTE_ADDR'].\"\\n\".\n\t \"Page: http://\".(getenv('HTTP_HOST')?getenv('HTTP_HOST'):$HTTP_SERVER_VARS['HTTP_HOST']).(getenv(REQUEST_URI)?getenv(REQUEST_URI):$HTTP_SERVER_VARS['REQUEST_URI']).\"\\n\".\n \"\".$post.\"\\n\",\n \"From: \".SITE_MAIL.\"\\n\".\n \"Content-type: text/plain\\n\"\n ); \n\t }\n elseif($error_flag && DEBUG_MODE==\"yes\"){\n ?>\n <script language=\"Javascript\">\n <!--\n nWindow = open('','_blank','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=200');\n nWindow.document.writeln('<html><body bgcolor=#C0C0FF>');\n nWindow.document.write(\"SQL Query:<br><?php print nl2br(eregi_replace(\"\\n|\\015|\\012\",\"\",eregi_replace(\"\\\"\",\"''\",$bx_temp_query)));?>\");\n nWindow.document.writeln(\"<br>Query took: <?php print $bx_query_time;?> ms\");\n nWindow.document.write(\"<br>Url: <?php print 'http://'.(getenv('HTTP_HOST')?getenv('HTTP_HOST'):$HTTP_SERVER_VARS['HTTP_HOST']).(getenv(REQUEST_URI)?getenv(REQUEST_URI):$HTTP_SERVER_VARS['REQUEST_URI']);?>\");\n nWindow.document.write(\"<br><font color=red>MySQL error code: <?php print $res;?></font>\");\n nWindow.document.writeln(\"<br><font color=red>MySQL error text: <?php print $error;?></font>\");\n nWindow.document.write(\"<br>Error in: <?php print $errmsg;?>\");\n nWindow.document.write(\"<br><?php print eregi_replace(\"\\n|\\015|\\012\",\"<br>\",eregi_replace(\"\\\"\",\"\\\\''\",$post));?>\");\n nWindow.document.writeln('</body></html>');\n //-->\n </script>\n <?php\n echo \"<br><table bgcolor=\\\"#FF0000\\\" border=\\\"0\\\" width=\\\"70%\\\" align=\\\"center\\\" cellpadding=\\\"2\\\" cellspacing=\\\"1\\\">\";\n echo \"<tr><td bgcolor=\\\"#EFEFEF\\\" style=\\\"padding: 10px;\\\">\";\n echo \"<font color=\\\"red\\\"><b>Sorry....</b><br>An error occured during this request. An detailed error report was sent to <b>admin</b>,<br> so the error will be solved soon.<br><b>Please come back later. Thank you.</b></font></td></tr></table><br>\";\n }\n elseif($NO_ROWS==4){\n ?>\n <script language=\"Javascript\">\n <!--\n nWindow = open('','_blank','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=200');\n nWindow.document.writeln('<html><body bgcolor=#C0C0FF>');\n nWindow.document.write(\"SQL Query:<br><?php print nl2br(eregi_replace(\"\\n|\\015|\\012\",\"\",eregi_replace(\"\\\"\",\"''\",$bx_temp_query)));?>\");\n nWindow.document.writeln(\"<br>Query took: <?php print $bx_query_time;?> ms\");\n nWindow.document.write(\"<br>Url: <?php print 'http://'.(getenv('HTTP_HOST')?getenv('HTTP_HOST'):$HTTP_SERVER_VARS['HTTP_HOST']).(getenv(REQUEST_URI)?getenv(REQUEST_URI):$HTTP_SERVER_VARS['REQUEST_URI']);?>\");\n nWindow.document.write(\"<br>File: <?php print $errmsg;?>\");\n nWindow.document.write(\"<br><?php print eregi_replace(\"\\n|\\015|\\012\",\"<br>\",eregi_replace(\"\\\"\",\"\\\\''\",$post));?>\");\n nWindow.document.writeln('</body></html>');\n //-->\n </script>\n <?php\n }\n elseif($NO_ROWS==5){\n echo \"QUERY: \".$bx_temp_query; \n }\n}", "function execute_query($q)\n{\n\tglobal $spebs_db;\n\t$res = $spebs_db -> query($q);\n\tif($spebs_db->errno != 0)\n\t{\n\t\terror_log(\"QUERY EXECUTE error \".$spebs_db->errno.\": \".$spebs_db->error.\" (Q = \\\"$q\\\")\");\n\t\treturn false;\n\t}\n\treturn $res;\n}", "function sql($sqlstring,$notes='',$allow_fail=0){\n\t\tglobal $is_connected_to_db,$global_link,$main;\n\n\t\t//RESET ERROR STATE\n\t\t$this->query_failed=0;\n\t\t$this->query_error='';\n\n\n\t\t#this function send a query to the db engine and returns the result.\n\t//\techo('icdb='.$is_connected_to_db);\n\t\tif(!$is_connected_to_db){\n\t\t\t$this->db_connect();\n\t\t}\n\t\tglobal $database_queries,$database_query_count,$database_sql_queries;\n\t\t$q=explode(' ',$sqlstring);\n\n#\t\tif(DEBUG){ //THIS IS DBLOG; BUT CANNOT CALL DBLOG; SINCE IS OR ISNT STATIC!\n#\t\t\t$database_query_count++;\n#\t\t\t$database_queries.=\"<h2>--\".$q[0].\"</h2><hr/><pre>\".$sqlstring.'</pre>';\n#\t\t\t$database_sql_queries[]=$sqlstring;\n#\t\t}\n\t\t//p2($global_link);\n\t\t//echo(\"mysql_query Trace\".b2());\n\n\t\t$this->res = $this->real_sql($sqlstring,$this->dblink);\n\t\tif($this->res=='' && $allow_fail==1){\n\t\t\t$this->query_failed=1;\n\t\t\t$this->query_error = \"SQL error: \" . htmlentities($this->real_error());\n\t\t\treturn(\"FAILED\");\n\t\t}\n\t\tif($this->res==''){\n\t\t\t$database_query_count++;\n\t\t\tif(isset($_GET['__output_type']) && $_GET['__output_type']!='HTML'){\n\t\t\t\t$err_text=htmlentities($this->real_error());\n\t\t\t\t$err_text.=(DEBUG? (\"\\n\\n\".htmlentities($sqlstring)):'.');\n\n\t\t\t}else{\n\t\t\t\t$this->head();//ERROR?\n\t\t\t\techo($this->get_log());\n\t\t\t\t$err_text = \"DEBUG=\".DEBUG.\" SQL error: \" . htmlentities($this->real_error()). ($txt .$txt2. \"<br/><pre>\".htmlentities($sqlstring).\"</pre>\");\n\t\t\t}\n\t\t\t#$s = new std();\n\t\t\t$this->error($err_text,'SQL001');\n\t\t\tif(DEBUG){\n\t\t\t\t$this->trace();\n\t\t\t\t$this->foot();\n\t\t\t}\n\t\t\tdie(\"\");\n\t\t}\n\t\treturn($this->res);\n\t}", "function pdo_stmt($stmt) {\r\n\r\n if (is_object($stmt)) {\r\n return $stmt;\r\n }\r\n else {\r\n return new pdo_dummy(\"Your last query was unsuccessful and returned FALSE instead of a fetchable result. See pdo_error() to find out why.\");\r\n }\r\n }", "public function sql_errno() {}", "public function sql_errno() {}", "function Sql_query( $query ) {\n\tglobal $db;\n\tmysql_query( $query, $db );\n\t$sqlerr=mysql_errno()*1;\n\tif ( $sqlerr!=0 ) {\n\t\t$sqlerr=$sqlerr.\": \".mysql_error();\n\t\techo \"<h1>MySQL ERROR $sqlerr.</h1>\";\n\t\techo \"<h3>$query</h3>\";\n\t}\n\treturn $sqlerr;\n}", "function bbq($q, $err=0)\n{\n\tif (dbtype == 'mysql') $r = mysql_query($q, dbconn);\n\tif (dbtype == 'pgsql') $r = pg_query(dbconn, $q);\n\tif (dbtype == 'sqlite') $r = db2::$db->query($q);\n\n\tif ($r) {\n\t\treturn $r;\n\t}\n\tif (!$err) {\n\t\tpf('SQL statement: '. $q);\n\t\tif (dbtype == 'mysql') seterr('MySQL error: '. mysql_error( dbconn));\n\t\tif (dbtype == 'pgsql') seterr('PostgreSQL error: '. pg_last_error(dbconn));\n\t\tif (dbtype == 'sqlite') seterr('SQLite error: '. end(db2::$db->errorInfo()));\n\t}\n}", "function PhpDbCommonFunction($sql, $successtext){\r\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\techo $successtext;\r\n\t\t} else {\r\n\t\t\techo \"Error : \" . $conn->error;\r\n\t\t}\r\n\r\n\t\t$conn->close();\r\n\t}", "function execute_support_queries($mysqli, $queries, $args = NULL, $err_msg = '')\n{\n foreach ($queries as $query)\n {\n $query = trim($query);\n if (empty($query))\n {\n continue;\n }\n if (!empty($args))\n {\n $query = str_ireplace(array_keys($args), $args, $query);\n }\n if (!$mysqli->query($query))\n {\n if (!empty($err_msg))\n {\n $err_msg = sprintf($err_msg, $mysqli->error) . \"\\n$query\\n\";\n }\n else\n {\n $err_msg = $mysqli->error;\n }\n throw new Exception($err_msg);\n }\n }\n return true;\n}", "function msql_fetch_object($result)\n{\n}", "protected function query(string $query = \"\")\n {\n // This keeps the connection alive for very long running scripts\n if ( $this->count(false) >= 500 ) {\n $this->disconnect();\n $this->quick_connect($this->dbuser,$this->dbpassword,$this->dbname,$this->dbhost,$this->dbport,$this->encoding);\n }\n\n // Initialise return\n $return_val = 0;\n\n // Flush cached values..\n $this->flush();\n\n // For reg expressions\n $query = trim($query);\n\n // Log how the function was called\n $this->func_call = \"\\$db->query(\\\"$query\\\")\";\n\n // Keep track of the last query for debug..\n $this->last_query = $query;\n\n // Count how many queries there have been\n $this->count(true, true);\n\n // Start timer\n $this->timer_start($this->num_queries);\n\n // Use core file cache function\n if ( $cache = $this->get_cache($query) )\n {\n // Keep tack of how long all queries have taken\n $this->timer_update_global($this->num_queries);\n\n return $cache;\n }\n\n // If there is no existing database connection then try to connect\n if ( ! isset($this->dbh) || ! $this->dbh )\n {\n $this->connect($this->dbuser, $this->dbpassword, $this->dbhost, $this->dbport);\n $this->select($this->dbname,$this->encoding);\n // No existing connection at this point means the server is unreachable\n if ( ! isset($this->dbh) || ! $this->dbh || $this->dbh->connect_errno )\n return $return_val;\n }\n\n // Perform the query via std mysql_query function..\n $this->result = @$this->dbh->query($query);\n\n // If there is an error then take note of it..\n if ( $str = @$this->dbh->error )\n {\n $this->register_error($str);\n if ($this->show_errors == true){\n trigger_error($query);\n }\n static::logWrite($query,static::TypeLogWrite[\"ERR\"]);\n return false;\n }\n\n // Query was an insert, delete, update, replace\n if ( preg_match(\"/^(insert|delete|update|start|replace|truncate|drop|create|alter|begin|commit|rollback|set|lock|unlock|call)/i\",$query) )\n {\n $is_insert = true;\n $this->rows_affected = @$this->dbh->affected_rows;\n\n // Take note of the insert_id\n if ( preg_match(\"/^(insert|replace)\\s+/i\",$query) )\n {\n $this->insert_id = @$this->dbh->insert_id;\n }\n\n // Return number fo rows affected\n $return_val = $this->rows_affected;\n }\n // Query was a select\n else\n {\n $is_insert = false;\n\n // Take note of column info\n $i=0;\n while ($i < @$this->result->field_count)\n {\n $this->col_info[$i] = @$this->result->fetch_field();\n $i++;\n }\n\n // Store Query Results\n $num_rows=0;\n while ( $row = @$this->result->fetch_object() )\n {\n // Store relults as an objects within main array\n $this->last_result[$num_rows] = $row;\n $num_rows++;\n }\n\n @$this->result->free_result();\n\n // Log number of rows the query returned\n $this->num_rows = $num_rows;\n\n // Return number of rows selected\n $return_val = $this->num_rows;\n }\n\n\n // disk caching of queries\n $this->store_cache($query,$is_insert);\n\n\n // Keep tack of how long all queries have taken\n $this->timer_update_global($this->num_queries);\n\n return $return_val;\n\n }", "function insert_users($firstName, $lastName, $email, $password, $d_o_b, $gender, $status ) {\n\tglobal $cxn;\n\n $errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"INSERT INTO users (firstName, lastName, email, password, d_o_b, gender, status)\n\t\t\t\tVALUES (?, ?, ?, ? ,?, ?, ?)\";\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t\n\t\t$stmt->bind_param(\"sssssss\", $firstName, $lastName, $email, $password, $d_o_b, $gender, $status );\n\t\t$stmt->execute();\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error inserting users, email: \" . $email;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\t$errArr[ERR_INSERT_ID] = $cxn->insert_id;\n\treturn $errArr;\n}", "function check_sql($instring,$maxlen)\n {\n // Handling of quotes\n if(!get_magic_quotes_gpc()) $outstring = addslashes($instring);\n else $outstring = $instring;\n\n // Filter out potentially dangerous constructs\n $outstring = ereg_replace(\"&\",\"\\&\",$outstring);\n $outstring = ereg_replace(\";|\\|\",\"#\",$outstring);\n\n // and/or at start of string and followed by spaces\n //$outstring = ereg_replace(\"^[ ]*and[ ]+|^[ ]*or[ ]+\",\"# \",$outstring);\n\n // and/or preceded and followed by spaces\n //$outstring = ereg_replace(\"[ ]+and[ ]+|[ ]+or[ ]+\",\" # \",$outstring);\n\n $outstring = ereg_replace(\"^[ ]*where\",\"#\",$outstring);\n\n if($maxlen>0) $outstring=substr($outstring,0,$maxlen);\n\n return $outstring;\n }", "public function query($query) {\n\t\t\t$this->sqlError = false;\n\t\t\t$this->sqlErrorNumber = false;\n\t\t\t$this->foundRows = false;\n\t\t\t$this->rowCount = false;\n\t\t\t$this->insertID = false;\n\t\t\tif (substr($query, -1, 1) != ';') $query .= ';';\n\t\t\t$result = mysql_query($query);\n\t\t\tif (mysql_error()) {\n\t\t\t\t$this->sqlError = mysql_error();\n\t\t\t\t$this->sqlErrorNumber = mysql_errno();\n\t\t\t\ttrigger_error('Query Failed: '.$this->sqlError.' <===> Query: '.htmlentities($query), E_USER_ERROR);\n\t\t\t\t$resultObj = new result(false, $this->rowCount, $this->foundRows, $this->insertID, $this->sqlError, $this->sqlErrorNumber);\n\t\t\t\treturn $resultObj;\n\t\t\t} else {\n\t\t\t\t$this->rowCount = strpos($query, 'SELECT') === 0 ? mysql_num_rows($result) : mysql_affected_rows();\n\t\t\t\tif (strpos($query, 'INSERT') === 0) $this->insertID = mysql_insert_id();\n\t\t\t\tif (strpos($query, 'SQL_CALC_FOUND_ROWS') !== false) {\n\t\t\t\t\t$this->foundRows = mysql_result(mysql_query(\"SELECT FOUND_ROWS()\"), 0);\n\t\t\t\t} else {\n\t\t\t\t\t$this->foundRows = $this->rowCount;\n\t\t\t\t}\n\t\t\t\tdebug(htmlentities($query).'<br>Found Rows: '.$this->foundRows.' | Row Count: '.$this->rowCount.' | Insert ID: '.$this->insertID, 'Query Executed', 'echo', 'sql');\n\t\t\t\t$resultObj = new result($result, $this->rowCount, $this->foundRows, $this->insertID, $this->sqlError, $this->sqlErrorNumber);\n\t\t\t\treturn $resultObj;\n\t\t\t}\n\t\t}", "function tpl_function_db_result_call($params, &$template_object)\r\n{\r\n if (empty($params['db_object'])) {\r\n $template_object->trigger_error(\"db_result_call: missing db_object parameter\");\r\n return;\r\n }\r\n \r\n if (! is_object($params['db_object'])) {\r\n $template_object->trigger_error(\"db_result_call: db_object isn't an object\");\r\n return;\r\n }\r\n \r\n $db = $params['db_object'];\r\n \r\n if (empty($params['db_result_object'])) {\r\n $template_object->trigger_error(\"db_result_call: missing db_result_object parameter\");\r\n return;\r\n }\r\n \r\n if (! is_object($params['db_result_object'])) {\r\n $template_object->trigger_error(\"db_result_call: db_result_object isn't an object\");\r\n return;\r\n }\r\n \r\n $result_object = $params['db_result_object'];\r\n \r\n if (empty($params['db_assign'])) {\r\n $template_object->trigger_error(\"db_result_call: missing db_assign parameter\");\r\n return;\r\n }\r\n \r\n if (empty($params['db_function'])) {\r\n $template_object->trigger_error(\"db_result_call: missing db_function parameter\");\r\n return;\r\n }\r\n \r\n $db_function = $params['db_function'];\r\n \r\n $result = $result_object->$db_function();\r\n \r\n $template_object->assign($params['db_assign'], $result);\r\n \r\n if (! empty($params['db_errornumber_assign'])) {\r\n $template_object->assign($params['db_errornumber_assign'], $db->ErrorNo());\r\n }\r\n \r\n if (! empty($params['db_error_assign'])) {\r\n $template_object->assign($params['db_error_assign'], $db->ErrorMsg());\r\n }\r\n \r\n if (! empty($params['db_EOF_assign'])) {\r\n $template_object->assign($params['db_EOF_assign'], $result_object->EOF);\r\n }\r\n}", "public static function query();", "function db_query($query) {\n\t$result = mysql_query($query);\n\t\n\tif(!$result) {\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n\t\n\treturn $result;\n}", "function queryDatabase($query = '') {\n $result = mysql_query($query)\n or die('MYSQL Error: ' . $query . ' ' . mysql_error());\n \n return $result;\n}", "function ingres_query($link, $query, $params = array(), $types = NULL)\n{\n}", "public function exec_qry($sql_to_prep, $array_qry_vals = \"\") {\n \t$type = \"Query\";\n \t$loca = \"exec_qry\";\n \ttry {\n \t\t// $array_qry_vals =somethinglike= array(':calories' => 150, ':color' => 'red');\n \t\t$this->lastQuery = $sql_to_prep;\n \t\t// sth = statement handler\n \t\t$sth = $this->pdo->prepare($sql_to_prep);\n \t\t\n\t\tif (is_a($sth, \"PDOStatement\")){\n \t\t\t// best pass ary params (not: $sth->bindParam(':var', $cals);)\n \t\t\tif (empty($array_qry_vals)) {\n \t\t\t\t$sth->execute();\n \t\t\t\treturn $sth; // success return statement handler\n \t\t\t}\n \t\t\t$sth->execute($array_qry_vals);\n \t\t\treturn $sth; // success return statement handler\n \t\t} else { // FAIL\n \t\t\t// statement failed\n \t\t\t$reas = \"Error with statement\";\n \t\t\t$code = $sql_to_prep;\n \t\t\t$this->db_fail($type, $loca, $reas, $code);\n \t\t}\n \t} catch (PDOException $e) { // FAIL\n \t\t$reas = \"PDOException\";\n \t\t$code = $sql_to_prep . \"<br />\" . $e->getMessage(). \"<br />\";\n \t\t$this->db_fail($type, $loca, $reas, $code);\n \t} /* DEBUG CATCH FINALLY catch (Exception $e) {\n \t\t$reas = \"Gen. Exception\"; // FAIL\n \t\t$code = $sql_to_prep . \"<br />\" . $e->getMessage(). \"<br />\";\n \t\t$this->db_fail($type, $loca, $reas, $code);\n \t} finally { // FAIL (Unanticipated)\n \t\t// success: \n \t\t // Error Code: 00000\n\t\t//\tError Info: \tArray([0] => 00000...\n \t\t\n \t\t$reas = \"try may have failed finally\";\n \t\t$code = $sql_to_prep;\n \t\t$this->db_fail($type, $loca, $reas, $code);\n \t\t\n \t} *** END DEBUG CATCH FINALLYwithin exec_qry */\n }", "public function query($query,$mode='single'){\n\t\t$this->lastsql=$query;\n\t\t\n\t\tswitch($mode){\n\t\t\tcase 1:\n\t\t\tcase '':\n\t\t\tcase 'single':\n\t\t\t\t$this->qresult=@parent::query($this->lastsql);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tcase 'multi':\n\t\t\tcase 'multiple':\n\t\t\t\t$ok=@parent::multi_query($query);\n\t\t\t\tdo{\n\t\t\t \t$this->qresult=@parent::store_result();\n\t\t\t if(($ok==true)&&empty($this->qresult)){\n\t\t\t \t$this->qresult=true;\n\t\t\t }\n\t\t\t }while(@parent::next_result());\n\t\t\t break;\n\t\t}\n\t\t\n\t\tif($this->show_sql){\n\t\t\tprint('<br />'.$this->lastsql.'<br />');\n\t\t}\n\t\t\n\t\tif($this->errno!=0){\n\t\t\tif(($this->show_sql==false) && ($this->show_sql_error==true)){\n\t\t\t\tprint('<br />'.$this->lastsql);\n\t\t\t}\n\t\t\tif($this->show_error){\n\t\t\t\tprint('<br />'.$this->error);\n\t\t\t}\n\t\t}\n\t\tif(@$this->num_fields()){ \n\t\t\tfor($f=0;$f<@$this->num_fields();$f++){\n\t\t\t\t$info=@$this->qresult->fetch_field();\n\t\t\t\t$this->qresult->fields[$f]['name']=@$info->name;\n\t\t\t\t$this->qresult->fields[$f]['orgname']=@$info->orgname;\n\t\t\t\t$this->qresult->fields[$f]['table']=@$info->table;\n\t\t\t\t$this->qresult->fields[$f]['orgtable']=@$info->orgtable;\n\t\t\t\t$this->qresult->fields[$f]['def']=@$info->def;\n\t\t\t\t$this->qresult->fields[$f]['max_length']=@$info->max_length;\n\t\t\t\t$this->qresult->fields[$f]['flags']=@$info->flags;\n\t\t\t\t$this->qresult->fields[$f]['type']=@$info->type;\n\t\t\t\t$this->qresult->fields[$f]['decimals']=@$info->decimals;\n\t\t\t\t$this->qresult->table=@trim($this->qresult->fields[0]['table']);\n\t\t\t\tif(empty($this->qresult->table)){\n\t\t\t\t\t$this->qresult->table=$this->xml_root;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@$this->qresult->field_seek(0);\n\t\t}\n\t\t@$this->num_rows=is_object(@$this->qresult)?@$this->qresult->num_rows:null;\n\t\treturn @$this->qresult;\n\t}", "function parse_exec_free($conn, $query, &$error_str)\n{\n $stmt = OCIParse($conn, $query);\n OCIExecute($stmt, OCI_DEFAULT);\n $err_array = OCIError($stmt);\n if ($err_array) {\n $err_message = $err_array['message'];\n $$error_str = $err_message;\n OCIFreeStatement($stmt);\n $stmt = FALSE;\n } else {\n OCIFreeStatement($stmt);\n $stmt = TRUE;\n }\n return $stmt;\n}", "function isvalidUser($uid, $sqlConnection)\r\n{ $result = array();\r\n\t$sqlSuccess = get_sql_results($result, $sqlConnection,\r\n\t\t\t\"select * from uc_users \".\r\n\t\t\t\"where id = '$uid'\");\r\n\treturn $sqlSuccess;\r\n}", "function query($query)\r\n\t{\r\n\t\t$ret = mysql_query ($query) or die(mysql_error());\r\n\t\treturn $ret;\r\n\t}", "function query($query=\"\")\n\t{\n\t\t$start = $this->getTime();\n\t\tif($query)\n\t\t{\n // debug(\"query\",$query);\n\t\t\t$this->_result_id=mysql_query($query,$this->_link_id);\n\t\t\t$this->_mysql_errno=mysql_errno($this->_link_id);\n\t\t\tif(!$this->_mysql_errno)\n\t\t\t{\n\t\t\t\tif(ereg(\"^insert\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas an insert type query\n\t\t\t\t\t$this->_query_type=4;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^select\", strtolower($query)) || ereg(\"^show\",strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a select or show query type\n\t\t\t\t\t$this->_query_type=1;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^delete\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a delete query type\n\t\t\t\t\t$this->_query_type=3;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^update\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a update query type\n\t\t\t\t\t$this->_query_type=2;\n\t\t\t\t}\n elseif(ereg(\"^create\",strtolower($query)))\n {\n $this->_query_type=5;\n }\n elseif(ereg(\"^drop\",strtolower($query)))\n {\n $this->_query_type=6;\n }\n\n\t\t\t\tif($this->_query_type>0)\n\t\t\t\t{\n\t\t\t\t\tif($this->_query_type>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_num_rows=mysql_affected_rows();\n\t\t\t\t\t}elseif($this->_query_type<5){\n if(is_resource($this->_result_id)){\n $this->_num_rows=mysql_num_rows($this->_result_id);\n }else{\n $this->_num_rows=0;\n }\n\t\t\t\t\t}\n\t\t\t\t\tif($this->_query_type==4)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_insert_id=mysql_insert_id();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_mysql_error=mysql_error();\n\t\t\t}\n\t\t}\n if($this->error_text()){\n Debug(\"Query\",$query);\n Debug(\"Error\",$this->error_text());\n }\n $this->logquery($query,$start);\n\t\treturn $this->_query_type;\n\t}", "function checkMySQL(){\r\n\tif(((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_errno($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false))){\r\n\t\techo \"<BR>***\";\r\n\t\tdie('Error: '.((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\r\n\t}\r\n}", "function db_query($query)\n{\n $ret = mysqli_query(DB::get_connection(), $query, MYSQLI_STORE_RESULT);\n if (!$ret) {\n throw new Exception (mysqli_error(DB::get_connection()));\n }\n\n return $ret;\n}", "function __construct() {\n\t\t// Prepare user defined objects (if any) for hooks which extend query methods\n\t\t$this->preProcessHookObjects = array();\n\t\t$this->postProcessHookObjects = array();\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_db.php']['queryProcessors'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_db.php']['queryProcessors'] as $classRef) {\n\t\t\t\t$hookObject = t3lib_div::getUserObj($classRef);\n\t\t\t\tif (!($hookObject instanceof t3lib_DB_preProcessQueryHook || $hookObject instanceof t3lib_DB_postProcessQueryHook)) {\n\t\t\t\t\tthrow new UnexpectedValueException('$hookObject must either implement interface t3lib_DB_preProcessQueryHook or interface t3lib_DB_postProcessQueryHook', 1299158548);\n\t\t\t\t}\n\t\t\t\tif ($hookObject instanceof t3lib_DB_preProcessQueryHook) {\n\t\t\t\t\t$this->preProcessHookObjects[] = $hookObject;\n\t\t\t\t}\n\t\t\t\tif ($hookObject instanceof t3lib_DB_postProcessQueryHook) {\n\t\t\t\t\t$this->postProcessHookObjects[] = $hookObject;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We check, that we have our own interface that brings the hooks for select queries\n\t\tforeach ($this->preProcessHookObjects as $preProcessHookObject) {\n\t\t\tif (!$preProcessHookObject instanceof Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface) {\n\t\t\t\tthrow new Exception('The registered hook ' . get_class($preProcessHookObject) . ' must implement the interface Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface', 1363902554);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->postProcessHookObjects as $postProcessHookObject) {\n\t\t\tif (!$preProcessHookObject instanceof Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface) {\n\t\t\t\tthrow new Exception('The registered hook ' . get_class($preProcessHookObject) . ' must implement the interface Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface', 1363902554);\n\t\t\t}\n\t\t}\n\t}", "function db_query_parsed($sql, $ignore_errors = 0, $attach_mysql = \"\") {\n global $CONF;\n\n if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) {\n\n $replace = array(\n '{AUTOINCREMENT}' => 'int(11) not null auto_increment', \n '{PRIMARY}' => 'primary key',\n '{UNSIGNED}' => 'unsigned' , \n '{FULLTEXT}' => 'FULLTEXT', \n '{BOOLEAN}' => \"tinyint(1) NOT NULL DEFAULT '\" . db_get_boolean(False) . \"'\",\n '{UTF-8}' => '/*!40100 CHARACTER SET utf8 */',\n '{LATIN1}' => '/*!40100 CHARACTER SET latin1 */',\n '{IF_NOT_EXISTS}' => 'IF NOT EXISTS',\n '{RENAME_COLUMN}' => 'CHANGE COLUMN',\n '{MYISAM}' => 'ENGINE=MyISAM',\n '{INNODB}' => 'ENGINE=InnoDB',\n '{INT}' => 'integer NOT NULL DEFAULT 0',\n '{BIGINT}' => 'bigint NOT NULL DEFAULT 0',\n '{DATE}' => \"timestamp NOT NULL default '2000-01-01'\", # MySQL needs a sane default (no default is interpreted as CURRENT_TIMESTAMP, which is ...\n '{DATECURRENT}' => 'timestamp NOT NULL default CURRENT_TIMESTAMP', # only allowed once per table in MySQL\n );\n $sql = \"$sql $attach_mysql\";\n\n } elseif($CONF['database_type'] == 'pgsql') {\n $replace = array(\n '{AUTOINCREMENT}' => 'SERIAL', \n '{PRIMARY}' => 'primary key', \n '{UNSIGNED}' => '', \n '{FULLTEXT}' => '', \n '{BOOLEAN}' => \"BOOLEAN NOT NULL DEFAULT '\" . db_get_boolean(False) . \"'\",\n '{UTF-8}' => '', # UTF-8 is simply ignored.\n '{LATIN1}' => '', # same for latin1\n '{IF_NOT_EXISTS}' => '', # does not work with PgSQL\n '{RENAME_COLUMN}' => 'ALTER COLUMN', # PgSQL : ALTER TABLE x RENAME x TO y\n '{MYISAM}' => '',\n '{INNODB}' => '',\n '{INT}' => 'integer NOT NULL DEFAULT 0',\n '{BIGINT}' => 'bigint NOT NULL DEFAULT 0',\n 'int(1)' => 'int',\n 'int(10)' => 'int', \n 'int(11)' => 'int', \n 'int(4)' => 'int', \n '{DATE}' => \"timestamp with time zone default '2000-01-01'\", # stay in sync with MySQL\n '{DATECURRENT}' => 'timestamp with time zone default now()',\n );\n\n } else {\n echo \"Sorry, unsupported database type \" . $conf['database_type'];\n exit;\n }\n\n $replace['{BOOL_TRUE}'] = db_get_boolean(True);\n $replace['{BOOL_FALSE}'] = db_get_boolean(False);\n\n $query = trim(str_replace(array_keys($replace), $replace, $sql));\n\n if (safeget('debug') != \"\") {\n printdebug ($query);\n }\n $result = db_query($query, $ignore_errors);\n if (safeget('debug') != \"\") {\n print \"<div style='color:#f00'>\" . $result['error'] . \"</div>\";\n }\n return $result;\n}", "function pp_run_query($query_set)\n{\n global $debug;\n $sql_exeq_words = array(\"CREATE\", \"UPDATE\", \"INSERT\", \"DELETE\");\n $d = getDBLink();\n if (!is_array($query_set)) {\n if (in_array(substr($query_set,0,6), $sql_exeq_words)) {\n $res = $d->ExecuteSQL($query_set);\n } else {\n $res = $d->FetchAll($query_set, null);\n }\n } else {\n $format_str = '';\n $params = array($query_set[0]);\n foreach($query_set[1] as $p) $format_str .= $p[0];\n if ($format_str != \"\") {\n $params[] = $format_str;\n }\n foreach($query_set[1] as $p) $params[] = $p[1];\n if(in_array(substr($query_set[0],0,6), $sql_exeq_words)) $func='ExecuteSQL';\n else {\n $func='FetchAll';\n }\n $res = call_user_func_array(array($d, $func), $params);\n }\n return $res;\n}", "static function query($sql,$err_message=\"Impossibile eseguire la query\"){\n \n //open DB connection\n $mysqli = self::_DbConnect();\n \n //if there's no connection I return false\n if(!$mysqli): return false; endif;\n \n \n //capture query result into an object through Mysqli\n $result = $mysqli->query($sql);\n \n \n //if there's an error pass error message to the view and return false\n if ($mysqli->error):\n die(\n 'ERROR:'.$mysqli->error.PHP_EOL.'ERROR# '.$mysqli->errno.PHP_EOL.'SQL:'.$sql\n );\n return false;\n endif;\n \n //close connection\n mysqli_close($mysqli);\n \n if(isset($result) && is_object($result)){\n \n //if the object is empty I return false\n if (!$result || !$result->num_rows) return false;\n \n \n //generate $data array so that every Sql operation end here.\n //To better separate the DAO.\n //Every result oustide of this class will be managed as an array.\n while ($row=$result->fetch_assoc()):\n \n $Data[] = $row;\n \n endwhile;\n \n }\n \n if(isset($Data))\n return $Data;\n \n \n \n }", "function SQL($sql) {\r\n\tconnect();\r\n\tglobal $l, $errmsg, $db;\r\n\t$r = mysql_db_query($db, $sql , $l);\r\n\t$errmsg = mysql_errno().\": \".mysql_error();\r\n\tif (mysql_error() != \"\") {\r\n\t\terrormsg(\"Database Error\", $errmsg);\r\n\t\t$r = 0;\r\n\t}\r\n\treturn $r;\r\n}", "function __construct()\n\t{\n\t\t$error = 0;\t\n\t\t$dbresult = false;\n\t\t$this->fields = array();\n\t\t$this->tables = array();\n\t\t$this->filters = \"\";\n\t\t$this->groupby = array();\t\t\n\t\t$this->having = \"\";\n\t\t$this->sortfields = array();\n\t\t$this->limit = \"\";\n\t\t$this->values = array();\t\t\n\t}", "function test_sqlFunction()\n {\n $theQuestion = 'Why does this not work?';\n $theAnswer = 'I dont know!';\n\n $question = new MDB_QT(TABLE_QUESTION);\n $newQuest = array(TABLE_QUESTION => $theQuestion);\n $qid = $question->add($newQuest);\n\n $answer = new MDB_QT(TABLE_ANSWER);\n $newAnswer = array(TABLE_QUESTION.'_id' => $qid, TABLE_ANSWER => $theAnswer);\n $aid = $answer->add($newAnswer);\n\n $question->autoJoin(TABLE_ANSWER);\n// $question->setSelect('id, '.TABLE_QUESTION.' as question, '.TABLE_ANSWER.' as answer');\n $question->setSelect('MAX(id),'.TABLE_ANSWER.'.id');\n $this->assertTrue(strpos($question->_buildSelectQuery(), 'MAX('.TABLE_QUESTION.'.id)'));\n\n // check '(question)'\n $question->setSelect('LOWER(question),'.TABLE_ANSWER.'.*');\n $this->assertTrue(strpos($question->_buildSelectQuery(), 'LOWER('.TABLE_QUESTION.'.question)'));\n\n // check 'id,'\n $question->setSelect('id, '.TABLE_ANSWER.'.*');\n $this->assertTrue(strpos($question->_buildSelectQuery(), TABLE_QUESTION.'.id'));\n\n // check 'id as qid'\n $question->setSelect('id as qid, '.TABLE_ANSWER.'.*');\n $this->assertTrue(strpos($question->_buildSelectQuery(), TABLE_QUESTION.'.id as qid'));\n\n // check 'id as qid'\n $question->setSelect('LOWER( question ), '.TABLE_ANSWER.'.*');\n $this->assertTrue(strpos($question->_buildSelectQuery(), 'LOWER( '.TABLE_QUESTION.'.question )'));\n }", "function isValidUserAccount(\n $user_info,\n $which_key = 'id', // userid, id, username\n $ref_status_text = ''\n){\n\n $field_name = '';\n $bind_types = '';\n switch ($which_key) {\n case \"id\" :\n case \"userid\" :\n $field_name = 'id';\n $bind_types .= 'i';\n break;\n case \"username\":\n $field_name = 'username';\n $bind_types .= 's';\n break;\n default :\n $ref_status_text = 'nosuchuserfield';\n return false;\n }\n\n $mysql = \"\n select count(*)\n from users\n where $field_name = ?\n and active_status = 1\";\n \n $status = 0;\n $count = 0;\n \n while (1) {\n \n try {\n $conn = db_connect();\n $sth = $conn->prepare($mysql);\n $sth->bind_param($bind_types, $user_info);\n $sth->execute();\n $sth->bind_result($count);\n $sth->fetch();\n } catch (mysqli_sql_exception $e) {\n $ermsg = 'isValidUserAccount() \\n' .\n 'sql: ' . $mysql . \"\\n\\n\" .\n 'user ' . $user_info . \"\\n\" .\n 'MYSQL ERROR TO STRING: ' . $e->__toString();\n writeDataToFile($ermsg, __FILE__, __LINE__);\n $ref_status_text = 'dberror';\n break;\n }\n\n if ($count == 1) {\n $status = 1;\n } elseif ($count > 1) {\n $ref_status_text = 'multipleuseraccounts';\n }\n break;\n }\n @$sth->close();\n return $status;\n}", "private function _executeQuery() \n\t{\n\t\t$this->_stmt->execute ( $this->_stmtData );\n\t\t\n\t\tif ($this->_stmt->rowCount () > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $this->_stmt->errorInfo();\n\t\t}\n\t}", "protected static function basicQuery($query) {\n\t\tif(!static::connect())\n\t\t\treturn null;\n\n\t\t$ret = false;\n\t\t$res = static::$sql->query($query);\n\n\t\t//INSERT, UPDATE OR DELETE, give insert id else true\n\t\tif ($res === true) {\n\t\t\t$ret = static::$sql->insert_id;\n\t\t\tif ($ret <= 0)\n\t\t\t\t$ret = true;\n\t\t} elseif (!static::$sql->errno) {\n\t\t\t$ret = array();\n\n\t\t\twhile($data = $res->fetch_assoc())\n\t\t\t\t$ret[] = $data;\n\t\t} else\n\t\t\tthrow new SQLException(static::$sql->error);\n\n\t\t// MySQLi result\n\t\tif (is_object($res))\n\t\t\t$res->close();\n\n\t\treturn $ret;\n\t}", "function db_query($query,$exit=0) {\r\n\r\n\tif ($exit) {\r\n\t\t\r\n\t\techo $query;\r\n\t\texit;\r\n\t\t\r\n\t} else {\r\n\t\r\n\t\t$rc = @mysql_query($query);\r\n\t\t\r\n\t\tif ($rc) return $rc;\r\n\t\telse {\r\n\t\t\r\n\t\t\techo $query;\r\n\t\t\texit;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function queryDebug($resultVar){\n\tif (!$resultVar) {\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n}", "public function query($query = \"NONEE\"){\n\t\t\n\t\tif($update = $query === \"NONEE\")\n\t\t\t$query = $this->query; \t\t\t\t\t\n\t\t\n\t\t$this->query_total++;\n\t\t\n\t\t$query_check = trim($query);\n\t\t\n\t\tif($this->debug){\n\t\t\techo \"<br/><strong style=\\\"color:#E4C100\\\">&lt;DEBUG&gt;</strong><br/>\";\n\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#D3C26E;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : \"\";\n\t\t\techo \"<span style=\\\"color:#E4C100\\\">\".$query.\"</span><br/><strong style=\\\"color:#E4C100\\\">&lt;/DEBUG&gt;</strong><br/>\";\n\t\t}\n\t\t\n\t\t$resultset = $this->showErrors ? mysqli_query($this->connection,$query) : @mysqli_query($this->connection,$query);\n\t\t\n\t\t$proceed_log = $this->log && ( \n\t\t(stripos($query_check,\"INSERT\") === 0 && $this->log_options{0} === '1')\n\t\t||\n\t\t(stripos($query_check,\"DELETE\") === 0 && $this->log_options{1} === '1')\n\t\t||\n\t\t(stripos($query_check,\"UPDATE\") === 0 && $this->log_options{2} === '1')\n\t\t||\n\t\t(stripos($query_check,\"SELECT\") === 0 && $this->log_options{3} === '1'));\n\t\t\n\t\tif(stripos($query_check,\"INSERT\") === 0 || stripos($query_check,\"DELETE\") === 0 || stripos($query_check,\"UPDATE\") === 0)\n\t\t\tif(!$resultset)\n\t\t\t\t$this->transaction = false;\n\t\t\n\t\tif($proceed_log){\n\t\t\t$log_fields = \"query,date,user\";\n\t\t\t$log_values=\"'\".$this->secure($query).\"',NOW(),\".$this->log_user;\n\t\t}\n\t\t\n\t\tif(!$resultset){\n\t\t\tif($this->showErrors){ \n\t\t\t\techo \"<br/><strong style=\\\"color:red\\\">&lt;QERROR&gt;</strong><br/>\";\n\t\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#E88888;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : $this->comment.\"nada\";\n\t\t\t\techo \"<span style=\\\"color:red\\\">\".mysqli_error($this->connection).\" at \".$query_check.\"</span><br/><strong style=\\\"color:red\\\">&lt;/QERROR&gt;</strong><br/>\";\n\t\t\t}\n\t\t\tif($proceed_log){\n\t\t\t\t$log_fields .= \",error\";\n\t\t\t\t$log_values .= \",'\".mysqli_error($this->connection).\"'\";\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($proceed_log){\t\t\t\n\t\t\t@mysqli_query($this->connection,\"INSERT INTO \".$this->log_table.\"($log_fields) VALUES($log_values)\");\n\t\t}\n\t\t\n\t\tif(!$resultset && $this->closeOnError) \n\t\t\texit;\n\t\t\n\t\tif($update)\n\t\t\t$this->resultset = $resultset;\n\t\t\n\t\treturn $resultset; \n\t}", "public function testCanExecuteSqlQueries()\n\t {\n\t\t$this->assertEquals(false, $this->object->exec(\"SELECT * FROM nonexistenttable\"));\n\t\t$this->assertInstanceOf(\"\\Logics\\Foundation\\SQL\\MySQLresult\", $this->object->exec(\"SELECT * FROM MySQLdatabase\"));\n\n\t\t$this->object = new MySQLdatabase($GLOBALS[\"DB_HOST\"], \"nonexistentdb\", $GLOBALS[\"DB_USER\"], $GLOBALS[\"DB_PASSWD\"]);\n\t\t$this->assertEquals(false, $this->object->exec(\"SELECT * FROM MySQLdatabase\"));\n\t }", "function validate_cred($email_local = null, $password_local = null){\n global $email;\n global $pwd;\n if ($email_local != null && $password_local != null){\n \n }\n else{\n $email_local = isset($_REQUEST[$email]) ? $_REQUEST[$email] : null;\n $password_local = isset($_REQUEST[$pwd]) ? $_REQUEST[$pwd] : null;\n \n }\n\n if ($email_local != null && $password_local != null){\n $conn = open_db_connection('localhost', ['new_user','Redbirdp1'], 'login');\n if ($conn ->connect_errno){\n echo('connection failed: ' . $conn->connect_error);\n }\n $statement = new Statement();\n // $statement->select([\"*\"])->from()->table(\"members\")->where(\"username\")->equals($email_local);\n $statement->select([\"*\"])->from()->table(\"members\");\n //echo $statement->get_statement();\n $result = query_db($conn, $statement);\n \n if ($result != null)\n {\n if ($result->num_rows > 0) {\n // output data of each row\n $flag = false;\n while($row = $result->fetch_row()) {\n //echo \"<br>\". $row;\n //echo \"<br>\" . $email_local . \" \" . $password_local;\n //echo \"<br>\" . $row[0];\n //echo \"<br>\" . $row[1];\n if ($row[0] == $email_local && $row[1] == $password_local){\n $flag = true;\n break;\n }\n }\n if ($flag){\n return true;\n }\n else{\n return false;\n }\n } else {\n echo \"0 results\";\n }\n return true;\n }\n echo '<br>Authentificaiton failed not a valid user';\n return true;\n }\n\n return false;\n\n}", "function dbh_query_bind( $sql ) {\n if ( isset( $GLOBALS['orm_dbh'] ) ) $use_dbh = $GLOBALS['orm_dbh'];\n if ( ORM_SQL_PROFILE ) START_TIMER('dbh_query_bind');\n $bind_params = array_slice( func_get_args(), 1 );\n ### Allow params passed in an array or as args\n if ( is_a( $bind_params[ count($bind_params) - 1 ], 'PDO' ) || is_a( $bind_params[ count($bind_params) - 1 ], 'PhoneyPDO' ) ) $use_dbh = array_pop($bind_params);\n if ( ! isset( $GLOBALS['orm_dbh'] ) ) $GLOBALS['orm_dbh'] = $use_dbh; # steal their DBH for global use, hehehe\n if ( count( $bind_params ) == 1 && is_array(array_shift(array_values($bind_params))) ) { $bind_params = array_shift(array_values($bind_params)); };\n# if (ORM_SQL_DEBUG) trace_dump();\n reverse_t_bools($bind_params);\n if (ORM_SQL_DEBUG) bug($sql, $bind_params);\n try { \n $sth = $use_dbh->prepare($sql);\n $rv = $sth->execute($bind_params);\n } catch (PDOException $e) {\n trace_dump();\n $err_msg = 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line();\n if ( strlen($err_msg) > 1024 ) {\n bug($err_msg,$sql,$bind_params,$e->getMessage());\n $sql = substr($sql,0,1020 + strlen($sql) - strlen($err_msg) ).'...';\n }\n trigger_error( 'There was an error running a SQL statement, ['. $sql .'] with ('. join(',',$bind_params) .'): '. $e->getMessage() .' in ' . trace_blame_line(), E_USER_ERROR);\n return false;\n }\n if ( ORM_SQL_PROFILE ) END_TIMER('dbh_query_bind');\n return $sth;\n }", "function q($sql,$conn) {\n\t$dev = FALSE;\n\n\t$res =& $conn->query($sql);\n\tif(PEAR::isError($res)) {\n\t\tif($dev) {\n\t\t\techo $res->getMessage().'<br />';\n\t\t\techo '<pre>';\n\t\t\tprint_r($conn->dsn);\n\t\t\techo '</pre>';\n\t\t}\n\t\treturn FALSE;\n\t} else {\n\t\treturn $res;\n\t}\n}", "function qtype_calculated_find_formula_errors($formula) {\n/// Returns false if everything is alright.\n/// Otherwise it constructs an error message\n // Strip away dataset names\n while (ereg('\\\\{[[:alpha:]][^>} <{\"\\']*\\\\}', $formula, $regs)) {\n $formula = str_replace($regs[0], '1', $formula);\n }\n\n // Strip away empty space and lowercase it\n $formula = strtolower(str_replace(' ', '', $formula));\n\n $safeoperatorchar = '-+/*%>:^~<?=&|!'; /* */\n $operatorornumber = \"[$safeoperatorchar.0-9eE]\";\n\n\n while (ereg(\"(^|[$safeoperatorchar,(])([a-z0-9_]*)\\\\(($operatorornumber+(,$operatorornumber+((,$operatorornumber+)+)?)?)?\\\\)\",\n $formula, $regs)) {\n\n switch ($regs[2]) {\n // Simple parenthesis\n case '':\n if ($regs[4] || strlen($regs[3])==0) {\n return get_string('illegalformulasyntax', 'quiz', $regs[0]);\n }\n break;\n\n // Zero argument functions\n case 'pi':\n if ($regs[3]) {\n return get_string('functiontakesnoargs', 'quiz', $regs[2]);\n }\n break;\n\n // Single argument functions (the most common case)\n case 'abs': case 'acos': case 'acosh': case 'asin': case 'asinh':\n case 'atan': case 'atanh': case 'bindec': case 'ceil': case 'cos':\n case 'cosh': case 'decbin': case 'decoct': case 'deg2rad':\n case 'exp': case 'expm1': case 'floor': case 'is_finite':\n case 'is_infinite': case 'is_nan': case 'log10': case 'log1p':\n case 'octdec': case 'rad2deg': case 'sin': case 'sinh': case 'sqrt':\n case 'tan': case 'tanh':\n if ($regs[4] || empty($regs[3])) {\n return get_string('functiontakesonearg','quiz',$regs[2]);\n }\n break;\n\n // Functions that take one or two arguments\n case 'log': case 'round':\n if ($regs[5] || empty($regs[3])) {\n return get_string('functiontakesoneortwoargs','quiz',$regs[2]);\n }\n break;\n\n // Functions that must have two arguments\n case 'atan2': case 'fmod': case 'pow':\n if ($regs[5] || empty($regs[4])) {\n return get_string('functiontakestwoargs', 'quiz', $regs[2]);\n }\n break;\n\n // Functions that take two or more arguments\n case 'min': case 'max':\n if (empty($regs[4])) {\n return get_string('functiontakesatleasttwo','quiz',$regs[2]);\n }\n break;\n\n default:\n return get_string('unsupportedformulafunction','quiz',$regs[2]);\n }\n\n // Exchange the function call with '1' and then chack for\n // another function call...\n if ($regs[1]) {\n // The function call is proceeded by an operator\n $formula = str_replace($regs[0], $regs[1] . '1', $formula);\n } else {\n // The function call starts the formula\n $formula = ereg_replace(\"^$regs[2]\\\\([^)]*\\\\)\", '1', $formula);\n }\n }\n\n if (ereg(\"[^$safeoperatorchar.0-9eE]+\", $formula, $regs)) {\n return get_string('illegalformulasyntax', 'quiz', $regs[0]);\n } else {\n // Formula just might be valid\n return false;\n }\n\n}", "function setQuery($ezSQL='') {\n global $_ezQuery, $_ezMysqli;// $_ezCubrid, $_ezOracle8_9, $_ezOracleTNS; 'recordset' ,'oracle8_9', 'oracletns',\n global $_ezPdo, $_ezPostgresql, $_ezRecordset, $_ezSqlite3, $_ezSqlsrv;\n if (in_array(strtolower($ezSQL), array( 'cubrid', 'mysqli', 'pdo', 'postgresql', 'sqlite3', 'sqlsrv' ))) {\n switch(strtolower($ezSQL)) {\n // case 'cubrid':\n // $_ezQuery = $_ezCubrid;\n // break;\n case 'mysqli':\n $_ezQuery = $_ezMysqli;\n break;\n // case 'oracle8_9':\n // $_ezQuery = $_ezOracle8_9;\n // break;\n // case 'oracletns':\n // $_ezQuery = $_ezOracleTNS;\n // break;\n case 'pdo':\n $_ezQuery = $_ezPdo;\n break;\n case 'postgresql':\n $_ezQuery = $_ezPostgresql;\n break;\n case 'recordset':\n $_ezQuery = $_ezRecordset;\n break;\n case 'sqlite3':\n $_ezQuery = $_ezSqlite3;\n break;\n case 'sqlsrv':\n $_ezQuery = $_ezSqlsrv;\n break; \n }\n return (!empty($_ezQuery)) ? true: false; \n } else {\n\t\t\t$_ezQuery = null;\n unset($_ezQuery);\n return false; \n }\n }", "function setQuery($ezSQL='') {\n global $_ezQuery, $_ezMysqli;// $_ezCubrid, $_ezOracle8_9, $_ezOracleTNS; 'recordset' ,'oracle8_9', 'oracletns',\n global $_ezPdo, $_ezPostgresql, $_ezRecordset, $_ezSqlite3, $_ezSqlsrv;\n if (in_array(strtolower($ezSQL), array( 'cubrid', 'mysqli', 'pdo', 'postgresql', 'sqlite3', 'sqlsrv' ))) {\n switch(strtolower($ezSQL)) {\n // case 'cubrid':\n // $_ezQuery = $_ezCubrid;\n // break;\n case 'mysqli':\n $_ezQuery = $_ezMysqli;\n break;\n // case 'oracle8_9':\n // $_ezQuery = $_ezOracle8_9;\n // break;\n // case 'oracletns':\n // $_ezQuery = $_ezOracleTNS;\n // break;\n case 'pdo':\n $_ezQuery = $_ezPdo;\n break;\n case 'postgresql':\n $_ezQuery = $_ezPostgresql;\n break;\n case 'recordset':\n $_ezQuery = $_ezRecordset;\n break;\n case 'sqlite3':\n $_ezQuery = $_ezSqlite3;\n break;\n case 'sqlsrv':\n $_ezQuery = $_ezSqlsrv;\n break; \n }\n return (!empty($_ezQuery)) ? true: false; \n } else {\n\t\t\t$_ezQuery = null;\n unset($_ezQuery);\n return false; \n }\n }", "function query() {}", "function insert_stmt()\n {\n if ( (! array_key_exists(\"cust_fname\", $_POST)) or\n ($_POST[\"cust_fname\"] == \"\") or\n (! isset($_POST[\"cust_fname\"])) )\n {\n destroy_and_exit(\"must insert a First Name!\");\n }\n elseif ( (! array_key_exists(\"cust_lname\", $_POST)) or\n ($_POST[\"cust_lname\"] == \"\") or\n (! isset($_POST[\"cust_lname\"])) )\n {\n destroy_and_exit(\"must insert a Last Name!\");\n }\n elseif ( (! array_key_exists(\"cust_phone\", $_POST)) or\n ($_POST[\"cust_phone\"] == \"\") or\n (! isset($_POST[\"cust_phone\"])) )\n {\n destroy_and_exit(\"must insert a phone number!\");\n }\n elseif ( (! array_key_exists(\"cust_email\", $_POST)) or\n ($_POST[\"cust_email\"] == \"\") or\n (! isset($_POST[\"cust_email\"])) )\n {\n destroy_and_exit(\"must insert a Customer Email!\");\n }\n \n $username = $_SESSION[\"username\"];\n $password = $_SESSION[\"password\"];\n \n $conn = hsu_conn_sess($username, $password);\n\n $cus_fname = trim(htmlspecialchars($_POST['cust_fname']));\n $cus_lname = trim(htmlspecialchars($_POST['cust_lname']));\n $cus_pho = trim(htmlspecialchars($_POST['cust_phone']));\n $cus_email = trim(htmlspecialchars($_POST['cust_email']));\n\n ?>\n \n <p> [<?= $cus_fname ?>] </p>\n <p> [<?= $cus_lname ?>] </p>\n <p> [<?= $cus_pho ?>] </p>\n <p> [<?= $cus_email ?>] </p>\n <?php\n \n $adding_cus = \"begin project_insert(:cust_fname, :cust_lname, :cust_phone, :cust_email); end; \";\n \n $somethingcool = oci_parse($conn, $adding_cus);\n \n oci_bind_by_name($somethingcool, \":cust_fname\", $cus_fname);\n oci_bind_by_name($somethingcool, \":cust_lname\", $cus_lname);\n oci_bind_by_name($somethingcool, \":cust_phone\", $cus_pho);\n oci_bind_by_name($somethingcool, \":cust_email\", $cus_email);\n \n oci_execute($somethingcool, OCI_DEFAULT);\n \n oci_commit($conn);\n \n oci_free_statement($somethingcool);\n \n $outputting_stmt = \"select *\n from Customer\";\n \n $somethingcoolpart2 = oci_parse($conn, $outputting_stmt);\n \n oci_execute($somethingcoolpart2, OCI_DEFAULT);\n \n ?> \n <p> <a href=\"<?= htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) ?>\">\n Start Over </a> </p>\n <?php\n \n \n oci_free_statement($somethingcoolpart2);\n \n oci_close($conn);\n }", "function fvls_db_ExecuteQuery($sql){\n\t\tglobal $FLVS_db_link;\n\t\tif( !$FLVS_db_link instanceof MySQLi )\n\t\t\treturn false;\n\n\t\tif ( !($response = $FLVS_db_link->query( $sql ) ) ){\n\t\t\tif( defined('FVLS_DEVELOPER_MODE') && FVLS_DEVELOPER_MODE )\n\t\t\t echo \"FV Link Shortener Error: mySQL Query Error - $FLVS_db_link->error | $sql\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $response;\n\t}", "function query($_sSql) {\n global $oDb;\n if($oDb === NULL) {\n $oDb = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n if(!$oDb->connect_error) {\n query('SET NAMES utf8;');\n }\n }\n return $oDb->query($_sSql);\n}", "function check_results($results) {\r\n global $dbc;\r\n\r\n if($results != true)\r\n echo '<p>SQL ERROR = ' . mysqli_error( $dbc ) . '</p>' ; \r\n}", "function crit_error($error) { }" ]
[ "0.60461295", "0.59926385", "0.5912881", "0.5909245", "0.585579", "0.58307177", "0.5824334", "0.580395", "0.57913244", "0.5762837", "0.5760874", "0.5714867", "0.570937", "0.56582975", "0.564811", "0.5642686", "0.56323284", "0.5620333", "0.5620168", "0.5620168", "0.5596662", "0.5594503", "0.5592493", "0.5587928", "0.557606", "0.5566086", "0.553802", "0.5532299", "0.55212766", "0.55180556", "0.55173177", "0.54967064", "0.54917216", "0.5491492", "0.5470439", "0.54497725", "0.54381573", "0.54329395", "0.54276866", "0.54250014", "0.54153275", "0.5402158", "0.5402064", "0.5401113", "0.53987443", "0.5391383", "0.538828", "0.53852814", "0.5375499", "0.5362774", "0.5345404", "0.5312451", "0.5312451", "0.53099227", "0.5292652", "0.52808577", "0.5269899", "0.5265976", "0.52614695", "0.52594775", "0.52587104", "0.5255069", "0.52549607", "0.5254801", "0.5250776", "0.52496624", "0.5247617", "0.5247277", "0.5239014", "0.5234753", "0.5232133", "0.52283424", "0.52269185", "0.5223354", "0.5222954", "0.5214003", "0.52071387", "0.52053666", "0.5203042", "0.51975554", "0.51925135", "0.51876795", "0.51869017", "0.51839536", "0.5180259", "0.5179696", "0.5178642", "0.51781595", "0.51774013", "0.5176739", "0.5175632", "0.51699126", "0.5169136", "0.51600957", "0.51600957", "0.5151691", "0.5142135", "0.5140656", "0.5138646", "0.5128552", "0.5125913" ]
0.0
-1
Returns multiple wishlist item id
public function getId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMultipleWishlistId();", "public function getWishlistItemId();", "public function getWishlistId();", "public function setMultipleWishlistId($id);", "public function setWishlistItemId(int $id);", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "public function getItemIds();", "function count_wishlist() {\n $total_items = 0;\n if (is_array($this->wishID)) {\n reset($this->wishID);\n while (list($wishlist_id, ) = each($this->wishID)) {\n $total_items++;\n }\n }\n\n return $total_items;\n }", "public function setWishlistId(int $id);", "public function getId($item);", "public function getId_item()\n {\n return $this->id_item;\n }", "public function getItemId();", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "function get_item_id($item_name) {\n $item_list = make_get_call(\"items\");\n \n foreach ($item_list as $key => $value) {\n if (strtolower($value) == $item_name) return $key;\n }\n \n return $item_list;\n }", "public function getItems()\r\n {\r\n return $this->user->wishlistItems;\r\n }", "public function get($id) {\n $wishList = WishList::where(\"users_id\",$id)->with(\"product\")->get();\n return $wishList;\n }", "public function getItemIds(){\n\t return $this->getIds();\n\t}", "public function getListId();", "public function itemids() {\n\t\t$q = SalesHistoryDetailQuery::create();\n\t\t$q->select(SalesHistoryDetail::get_aliasproperty('itemid'));\n\t\t$q->filterByOrdernumber($this->oehhnbr);\n\t\treturn $q->find()->toArray();\n\t}", "function getByUserID($user_id) {\n return $this->find('list', array(\n 'conditions' => array(\n 'Wishlist.user_id' => $user_id\n ),\n 'fields' => array(\n 'Wishlist.product_entity_id'\n )\n ));\n }", "function fn_wishlist_get_count()\n{\n $wishlist = array();\n $result = 0;\n\n if (!empty(Tygh::$app['session']['wishlist'])) {\n $wishlist = & Tygh::$app['session']['wishlist'];\n $result = !empty($wishlist['products']) ? count($wishlist['products']) : 0;\n }\n\n /**\n * Changes wishlist items count\n *\n * @param array $wishlist wishlist data\n * @param int $result wishlist items count\n */\n fn_set_hook('wishlist_get_count_post', $wishlist, $result);\n\n return empty($result) ? -1 : $result;\n}", "public function wishlistAdd($requestParams,$wishlist,$productId){\n $response = array();\n if (! $productId) {\n /**\n * Set product not fount error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Product Not Found' );\n } else {\n /**\n * Get product collection\n * @var $product\n */\n $product = Mage::getModel ( 'catalog/product' )->load ( $productId );\n if (! $product->getId () || ! $product->isVisibleInCatalog ()) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Cannot specify product.' );\n } else {\n try {\n /**\n * Get parameters.\n */\n $buyRequest = new Varien_Object ( $requestParams );\n /**\n * Whislist add new product.\n */\n $result = $wishlist->addNewItem ( $product, $buyRequest );\n if (is_string ( $result )) {\n Mage::throwException ( $result );\n }\n $wishlist->save ();\n Mage::dispatchEvent ( 'wishlist_add_product', array (\n 'wishlist' => $wishlist,\n 'product' => $product,\n 'item' => $result\n ) );\n /**\n * Set success message.\n */\n Mage::helper ( 'wishlist' )->calculate ();\n $message = $product->getName ().' has been added to your wishlist.';\n $response ['status'] = 'SUCCESS';\n $response ['message'] = $message;\n /**\n * Unset registry.\n */\n Mage::unregister ( 'wishlist' );\n return $response;\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'An error occurred while adding item to wishlist: %s', $e->getMessage () );\n return $response;\n }\n }\n }\n }", "public function getproductsunderwishlist($wishlist_id)\n\t{\n $ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, API_BASE .\"/wishlist/\".$wishlist_id);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t 'Authorization: Basic ' . $this->session->userdata('auth') ));\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = json_decode( $content );\n\n\t\treturn ( $response );\n\t}", "public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }", "public function index($id)\n {\n $wishList = WishList::where('user_id',$id)->get();\n if ($wishList) {\n return success($wishList);\n } else {\n return error(400, 'Can not get item');\n }\n }", "public function products_id()\n {\n foreach ($_SESSION['cart'] as $id => $quaty){\n $product_id[] = \"($id, $quaty)\";\n $product = Data::find_by_id($id);\n $id = array('id' => 'No: '. $product->id, 'name' => ' '. $product->name, 'price' => ' €'.$product->price, 'quaty' => ' qty '.$quaty, 'cost' => ' = €'.$product->price * $quaty .'</br>');\n foreach ($id as $key => $value){\n echo /*$key .' = '.*/ $value; /*echo \", \"; &nbsp; = spatie*/\n }\n }\n // $insert_id = implode(',', $product_id);\n }", "public abstract static function getListID();", "public function getItemIds()\n {\n $this->loadItems();\n $items = [];\n foreach ($this->items as $item) {\n $items[] = $item->getId();\n }\n return $items;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "public function getIdItem() {\n return intval($this->idItem);\n }", "public function getItemByMultiple($item_data)\n\t{\n\t\t$where = array();\n\t\tif(isset($item_data['it_id'])){\n\t\t\t$where['it_id'] = $item_data['it_id'];\n\t\t}\n\t\tif(isset($item_data['owner_id'])){\n\t\t\t$where['owner_id'] = $item_data['owner_id'];\n\t\t}\n\t\treturn \\ORM::for_table($this->table)->where($where)->find_one();\n\t}", "function getWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n\n if ($wishlist) {\n $result = $wishlist->getProductIds();\n } else {\n $result = null;\n }\n\n return new Response($result);\n }", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "public function ItemParams2( $observer )\n {\n $items=$observer->getItems();\n foreach($items as $item){\n ////Mage::log($item->getId());\n $quoteItems = $item->getQuote()->getAllVisibleItems();\n foreach ($quoteItems as $quoteItem) {\n ////Mage::log($quoteItem->getItemId());\n //Mage::log($quoteItem->getItemId());\n}\n}\n\n }", "function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }", "public static function getGatewayListID(){\n $row = Gateway::where(array('Status'=>1))->lists('Title', 'GatewayID');\n if(!empty($row)){\n $row = array(\"\"=> \"Select a Gateway\")+$row;\n }\n return $row;\n }", "public function additemtowishlist($productid){\n\t\tif($this->checkwishlist($productid)){\n\t\t\t$object=array(\n\t\t\t\t'UserID' => $this->session->userdata('userid'),\n\t\t\t\t'UserEmail' => $this->session->userdata('useremail'),\n\t\t\t\t'Product_Id' => $productid\n\t\t\t);\n\t\t\t$this->db->insert('tbl_wishlist', $object);\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "function woo_bundles_wishlist_after_list_item_name( $item, $wishlist ) {\n\n\t\tif ( $item[ 'data' ]->is_type( 'bundle' ) && ! empty( $item[ 'stamp' ] ) ) {\n\t\t\techo '<dl>';\n\t\t\tforeach ( $item[ 'stamp' ] as $bundled_item_id => $bundled_item_data ) {\n\t\t\t\techo '<dt class=\"bundled_title_meta wishlist_bundled_title_meta\">' . get_the_title( $bundled_item_data[ 'product_id' ] ) . ' <strong class=\"bundled_quantity_meta wishlist_bundled_quantity_meta product-quantity\">&times; ' . $bundled_item_data[ 'quantity' ] . '</strong></dt>';\n\t\t\t\tif ( ! empty ( $bundled_item_data[ 'attributes' ] ) && $this->is_wc_21() ) {\n\t\t\t\t\t$attributes = '';\n\t\t\t\t\tforeach ( $bundled_item_data[ 'attributes' ] as $attribute_name => $attribute_value ) {\n\n\t\t\t\t\t\t$taxonomy = wc_attribute_taxonomy_name( str_replace( 'attribute_pa_', '', urldecode( $attribute_name ) ) );\n\n\t\t\t\t\t\t// If this is a term slug, get the term's nice name\n\t\t\t if ( taxonomy_exists( $taxonomy ) ) {\n\t\t\t \t$term = get_term_by( 'slug', $attribute_value, $taxonomy );\n\t\t\t \tif ( ! is_wp_error( $term ) && $term && $term->name ) {\n\t\t\t \t\t$attribute_value = $term->name;\n\t\t\t \t}\n\n\t\t\t \t$label = wc_attribute_label( $taxonomy );\n\n\t\t\t // If this is a custom option slug, get the options name\n\t\t\t } else {\n\t\t\t\t\t\t\t$attribute_value\t= apply_filters( 'woocommerce_variation_option_name', $attribute_value );\n\t\t\t\t\t\t\t$bundled_product = get_product( $bundled_item_data[ 'product_id' ] );\n\t\t\t\t\t\t\t$product_attributes = $bundled_product->get_attributes();\n\t\t\t\t\t\t\tif ( isset( $product_attributes[ str_replace( 'attribute_', '', $attribute_name ) ] ) ) {\n\t\t\t\t\t\t\t\t$label = wc_attribute_label( $product_attributes[ str_replace( 'attribute_', '', $attribute_name ) ][ 'name' ] );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$label = $attribute_name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$attributes = $attributes . $label . ': ' . $attribute_value . ', ';\n\t\t\t\t\t}\n\t\t\t\t\techo '<dd class=\"bundled_attribute_meta wishlist_bundled_attribute_meta\">' . rtrim( $attributes, ', ' ) . '</dd>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</dl>';\n\t\t\techo '<p class=\"bundled_notice wishlist_component_notice\">' . __( '*', 'woocommerce-product-bundles' ) . '&nbsp;&nbsp;<em>' . __( 'Accurate pricing info available in cart.', 'woocommerce-product-bundles' ) . '</em></p>';\n\t\t}\n\t}", "public function index($wishlistid)\n {\n $wish['wishlistid'] = $wishlistid;\n\n $validation = Validator::make($wish,[\n 'wishlistid'=>'exists:wishes,wishlistid',\n ]);\n\n if($validation->fails())\n {\n $failedRules = $validation->failed();\n $field = '';\n\n if(isset($failedRules['wishlistid']['Exists']))\n {\n $message = 'Wishlist id not found.';\n $field = 'wishlistid';\n }\n\n return response()->json(['status'=>'400','message'=>$message,'field'=>$field]);\n }\n else\n {\n $wishes = $this->wish->getWishesByWishlistId($wishlistid);\n $userid = $this->wishlist->getCreatedById($wishlistid);\n\n $getFavoriteBookmarkForStream = $this->favoritebookmark->getFavoriteBookmarkForStream($userid);\n foreach($wishes as $w)\n {\n $w->favorited = '0';\n $w->bookmarked = '0';\n foreach($getFavoriteBookmarkForStream as $gfbfs)\n {\n if($w->id == $gfbfs['wishid'])\n {\n if($gfbfs['type'] == '2')\n {\n $w->favorited = '1';\n }\n if($gfbfs['type'] == '1')\n {\n $w->bookmarked = '1';\n }\n }\n }\n $w->favoritecount = $this->favoritebookmark->countFavoriteBookmark($w->id, '2');\n $w->bookmarkcount = $this->favoritebookmark->countFavoriteBookmark($w->id, '1');\n }\n\n return response()->json(['status'=>'200','message'=>'Ok','wishes'=>$wishes]);\n }\n }", "function getItemKeys ( $list, $nr_of_items = 1, $randomize = true )\n\t{\n\t\t$total_items = count( $list );\n\t\tif ( $nr_of_items > $total_items ) {\n\t\t\t$nr_of_items = $total_items;\n\t\t}\n\t\t//@TODO Make randomization an option in the widget and shortcode\n\t\tif ( $randomize ) {\n\t\t\t$return = ( array ) array_rand( $list, $nr_of_items );\n\t\t} else {\n\t\t\tfor ($i = 0; $i < $nr_of_items; $i++) {\n\t\t\t\t$return[]=$i;\n\t\t\t}\n\t\t}\n\t\treturn ($return);\n\t}", "public function get_item_id(){\n $this->db->select('itemID')->from('item')->where('itemID', );\n $query = $this->db->get();\n \n if($query->num_rows() == 1)\n {\n $row = $query->row(0);\n return $row->itemID;\n }\n }", "public function addWishlist($id){\n if (Auth::check()) {\n if (Wishlist::where('product_id',$id)->where('user_id',Auth::id())->exists()) {\n return response()->json([\n 'error' => \"This Product Already Add Wishlist\",\n ]);\n }\n else {\n Wishlist::insert([\n 'user_id' => Auth::id(),\n 'product_id' => $id,\n 'created_at' => Carbon::now()\n ]);\n return response()->json([\n 'success' => \"Add Wishlist Successfully\"\n ]);\n }\n }\n else {\n return response()->json([\n 'error' => \"Please Login First\"\n ]);\n }\n }", "public function getItemId()\n {\n return $this->item_id;\n }", "public function getLoveId($loveArray=null,$key=\"item_id\"){\n if($loveArray !=null ){\n $list_id=array_map(function($value) use($key){\n return $value[$key];\n },$loveArray);\n return $list_id;\n }\n }", "public function getWishlist()\n {\n// 'cust_id' => 'required',\n// ]);\n//\n// if ($validator->fails()) {\n// return response()->json(array('status' => false, 'message' => $validator->messages()), 500);\n// }\n try{\n\n $wishlist = Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n\n if(count($wishlist) > 0){\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$wishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n return response()->json(array('status' => true,'wishlist' => $products), 200);\n }else{\n return response()->json(array('status' => false,'message' => 'no wishlist found.'), 200);\n }\n }catch (\\Exception $e){\n return response()->json(array('error'=>'something went wrong','message'=> $e->getMessage()));\n }\n\n\n }", "public function getCheckoutIds()\n {\n if ($this->instanceOfThis->cart->hasProducts() > 0)\n {\n $cartProducts = $this->instanceOfThis->cart->getProducts();\n\n $productsArr = [];\n\n foreach ($cartProducts as $product)\n {\n $productsArr[] = $product['product_id'];\n }\n\n $productsIDs = implode(\",\", $productsArr);\n\n $this->data .= \"\n /* --- checkoutIds --- */\n _ra.checkoutIdsInfo = [\n $productsIDs\n ];\n\n if (_ra.ready !== undefined) {\n _ra.checkoutIds(_ra.checkoutIdsInfo);\n };\n \";\n\n return $this->data;\n }\n }", "public abstract function get_ids();", "public function wish_list_data($user_id)\r\n {\r\n \r\n /*$que = \"select w.user_id as wish_user_id,w.product_id as wish_product_id,l.status as is_like,p.* from wish_list w join products p on w.product_id=p.id join like_product l on l.product_id=p.id where w.user_id=\".$user_id.\" order by w.id desc\";*/\r\n\t\t \r\n\t\t $que = \"select w.user_id as wish_user_id,w.product_id as wish_product_id,p.* from wish_list w join products p on w.product_id=p.id where w.user_id=\".$user_id.\" order by w.id desc\";\r\n //return $this->db->$que->get()->result_array();\r\n $query = $this->db->query($que);\r\n return $query->result_array();\r\n }", "function wp_parse_id_list($input_list)\n {\n }", "function column_id($item)\n {\n // links going to /admin.php?page=[your_plugin_page][&other_params]\n // notice how we used $_REQUEST['page'], so action will be done on curren page\n // also notice how we use $this->_args['singular'] so in this example it will\n // be something like &person=2\n\n $actions = array(\n\n //'edit' => sprintf('<a href=\"admin.php?page=%snew_meal_item&action=edit&id=%s\">%s</a>', $_REQUEST[''], $item['item_id'], __('Edit', 'bc_booking_system')),\n 'delete' => sprintf('<a href=\"?tab=wspra_api_log&page=%s&action=delete&id=%s\">%s</a>', sanitize_text_field($_REQUEST['page']), esc_attr($item['id']), __('Delete', 'bc_booking_system')),\n //'view' => sprintf('<a href=\"?page=%s&action=view&id=%s\">%s</a>', $_REQUEST['page'], $item['ID'], __('View', 'bc_booking_system')),\n );\n\n return sprintf('%s %s',\n\n $item['id'],\n $this->row_actions($actions)\n );\n\n }", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "public function get_user_wishlist($member_id)\n\t{\n\t\t$this->db->select('brand.brand_name, product.*, wishlist.date_added, wishlist.wishlist_id');\n\t\t$this->db->where('product.brand_id = brand.brand_id AND product.product_id = wishlist.product_id AND wishlist.member_id = '.$member_id);\n\t\t$this->db->order_by('wishlist.date_added', 'DESC');\n\t\t$query = $this->db->get('product, wishlist, brand');\n\t\t\n\t\treturn $query;\n\t}", "public function getAllIdCurrentItems($itemQuote) {\r\n $arrIdItemCurrent = array();\r\n\r\n foreach ($itemQuote as $item) {\r\n $arrIdItemCurrent[] = $item->getId();\r\n }\r\n\r\n return $arrIdItemCurrent;\r\n }", "public function list_id()\n\t{\n\t\treturn $this->list;\n\t}", "public function getPurchasableId();", "public function getSimilarRecommListIds()\n {\n if ($this->_aSimilarRecommListIds === null) {\n $this->_aSimilarRecommListIds = false;\n\n if ($oProduct = $this->getProduct()) {\n $this->_aSimilarRecommListIds = array($oProduct->getId());\n }\n }\n\n return $this->_aSimilarRecommListIds;\n }", "function edd_social_discounts_get_shared_product_ids() {\n\t// get all discount IDs\n\t$discounts = edd_get_discounts();\n\t$discount_ids = array();\n\t$share_ids = array();\n\t\n\tif ( $discounts ) {\n\t\tforeach ( $discounts as $discount ) {\n\t\t\t$discount_ids[] = $discount->ID;\n\t\t}\n\t}\n\n\tforeach ( $discount_ids as $id ) {\n\t\t$products = get_post_meta( $id, '_edd_discount_social_discount_products', true );\n\n\t\tif ( $products ) {\n\t\t\tforeach ($products as $product) {\n\t\t\t\tarray_push( $share_ids, $product );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (array) apply_filters( 'edd_social_discounts_get_share_array', $share_ids );\n}", "private function item_ids()\r\n {/*{{{*/\r\n\t\t$items = array();\r\n $ids = array(); \r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n foreach($items as $item)\r\n $ids[] = basename($item, '.xml');\r\n\t\tsort($ids);\r\n\t\treturn array_reverse($ids);\r\n\t}", "function get_warehouse_ids() {\n return array('CA', 'KY', 'TN', 'WA', 'MN', 'OR', 'TX');\n}", "function displayWishLists()\n{\n $customerId = 1;\n $wishlists = wishlistsDB::getWishlistsByCustomer($customerId);\n foreach ($wishlists as $wishlist) {\n $wid= $wishlist->getWishlistId();\n\n $wname = $wishlist->getWishlistName();\n\n echo \"<div id='wishlistName'>\";\n echo $wname;\n echo \"</div>\";\n echo \"<input type='submit' class='btn btn-default' value='Add to Wishlist' name='pushToList' id='pushToList' onclick=\\\"addtoList('$wid');\\\" />\";\n echo \"<br/><br/>\";\n }\n echo \"<input type='submit' name='newWishlist' class='btn btn-default' value='Create new Wishlist' onclick=\\\"newList();\\\"/>\";\n\n}", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "private function getWarehouseIds(): array\n {\n return [1,2];\n }", "protected function _getUrlStore($item)\n {\n\tMage::log(\"wishlist\");\n $storeId = null;\n if ($item instanceof Celebros_Salesperson_Model_Api_QwiserProduct) {\n \tif(key_exists(Mage::Helper('salesperson/mapping')->getMapping('visible'),$item->Field) && key_exists(Mage::Helper('salesperson/mapping')->getMapping('store_id'),$item->Field)){\n\t if ($item->Field[Mage::Helper('salesperson/mapping')->getMapping('visible')] == '1' ) {\n\t $storeId = $item->Field[Mage::Helper('salesperson/mapping')->getMapping('store_id')];\n\t }\n \t}\n }\n return Mage::app()->getStore($storeId);\n }", "function wcs_get_order_items_product_id( $item_id ) {\n\tglobal $wpdb;\n\n\t$product_id = $wpdb->get_var( $wpdb->prepare(\n\t\t\"SELECT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta\n\t\t WHERE order_item_id = %d\n\t\t AND meta_key = '_product_id'\",\n\t\t$item_id\n\t) );\n\n\treturn $product_id;\n}", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "static public function GetGETItemId() {\n if (isset(self::$itemId))\n return self::$itemId;\n else\n return false;\n }", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "public function getBuyerId();", "public function utilityIds()\n {\n $this->attributes['utilityIds'] = $this->utilities->pluck('id');\n }", "function add_wishlist($_id_member,$_id_product,$_id_source)\n\t\t{\n\t\t\t//must make a rule to get different product detail depend on id_source\n\t\t\t\n\t\t\t$_id_member_session = $this->CI->session->userdata('id_member');\n\t\t\t//Must relate with model wishlist return must an integer\n\t\t\t$_wishlist_already_added = $this->CI->model_product->is_added_stuff($_id_product,$_id_member);\n\t\t\t/*if(!$_wishlist_already_added)\n\t\t\t{\n\t\t\t\t$this->model_zhout->update_wishlist_status($_id_product);\n\t\t\t\t$this->model_wishlist->insert_wishlist($_id_member,$_id_product);\n\t\t\t\t$data['message'] = ''\n\t\t\t\treturn \n\t\t\t}*/\n\t\t}", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public static function getId(){\n return 'bigitems';\n }", "public static function getCartItemIds()\n\t{\n\t\t$ids = array();\n\n\t\tforeach (Data::getOrderItems(null) as $item) {\n\t\t\t$ids []= $item['PRODUCT_ID'];\n\t\t}\n\n\t\treturn $ids;\n\t}", "public function getId()\n {\n return $this->source['order_item_id'];\n }", "public function getId()\n {\n return $this->_list->getId();\n }", "public function listId() {\n\t\treturn $this->academic_session->all()->pluck('id')->all();\n\t}", "public function arrayItems() {\r\n $quoteId = Mage::getSingleton('checkout/session')->getQuote()->getId();\r\n $session = Mage::getModel('giftwrap/selection')->getSelectionByQuoteId(\r\n $quoteId);\r\n $productIds = array();\r\n if ($session) {\r\n foreach ($session as $value) {\r\n $productIds[] = $value['itemId'];\r\n }\r\n }\r\n return $productIds;\r\n }", "function getID(){ return (int)$this->productInfo['products_id']; }", "public function getAddUrlWithParams($item, array $params = array())\n {Mage::log(\"wishlist\");\n $productId = null;\n if ($item instanceof Celebros_Salesperson_Model_Api_QwiserProduct) {\n \tif(key_exists(Mage::Helper('salesperson/mapping')->getMapping('id'),$item->Field)){\n \t$productId = $item->Field[Mage::Helper('salesperson/mapping')->getMapping('id')];\n \t}\n }\n if ($item instanceof Mage_Wishlist_Model_Item) {\n $productId = $item->getProductId();\n }\n\n if ($productId) {\n $params['product'] = $productId;\n return $this->_getUrlStore($item)->getUrl('wishlist/index/add', $params);\n }\n\n return false;\n }", "function getItemid() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$user = & JFactory::getUser() ;\r\n\t\t$sql = \"SELECT id FROM #__menu WHERE link LIKE '%index.php?option=com_osmembership%' AND published=1 AND `access` IN (\".implode(',', $user->getAuthorisedViewLevels()).\") ORDER BY `access`\";\t\t\t\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$itemId = $db->loadResult();\t\t\r\n\t\tif (!$itemId) {\r\n\t\t\t$Itemid = JRequest::getInt('Itemid');\r\n\t\t\tif ($Itemid == 1)\r\n\t\t\t\t$itemId = 999999 ;\r\n\t\t\telse \r\n\t\t\t\t$itemId = $Itemid ;\t\r\n\t\t}\t\t\t\r\n\t\treturn $itemId ;\t\r\n\t}", "public function product_wishlist($user_id)\n\t{\n\t\t$ch = curl_init();\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, API_BASE .\"/wishlist/user/\".$user_id);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t 'Authorization: Basic ' . $this->session->userdata('auth') ));\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = json_decode( $content );\n\n\t\treturn ( $response );\n\t}", "public function getItemID()\n {\n return $this->itemID;\n }", "public function getItemID()\n {\n return $this->itemID;\n }", "public static function winnersIds()\n {\n return DB::table('competitionentries')->where('winner', '=', 1)->get();\n }", "function cart_wishlist_update($mode,$db,$item,$cart_id,$user_name,$json_update,$cart_expire,$available){\n $paid = 0;\n if($mode == 'wishlist'){\n $cartQ = $db->query(\"SELECT * FROM wishlist WHERE username = '{$user_name}'\");\n }else{\n $cartQ = $db->query(\"SELECT * FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n }\n\n $return = mysqli_num_rows($cartQ);\n if($return != 1){\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n if($mode != 'wishlist'){\n $items_json = json_encode($item);\n $db->query(\"INSERT INTO cart (items,username,expire_date) VALUES ('{$items_json}','{$user_name}','{$cart_expire}')\");\n $cart_id = $db->insert_id; //return the last inserted item in database\n $_SESSION['cartid'] = $cart_id;\n $_SESSION['success_flash'] = ' Item added to Cart successfully.';\n }else{\n $db->query(\"INSERT INTO wishlist (id,username,items,expire_date) VALUES ('{$cart_id}','{$user_name}','{$json_update}','{$cart_expire}')\");\n $_SESSION['success_flash'] = 'wishlist update successful..';\n }\n }else{\n $cart = mysqli_fetch_assoc($cartQ);\n $previous_items = json_decode($cart['items'],true); //makes it an associated array not an object\n $item_match = 0;\n $new_items = array();\n //$_SESSION['success_flash'] = $product['title']. ' in loop.';\n foreach ($previous_items as $pitem){\n if($item[0]['id'] == $pitem['id'] && $item[0]['size'] == $pitem['size']){\n\n if($mode == 'cart'){\n if($available == 0){\n $pitem['quantity'] = $pitem['quantity']; // do not update quantity for same item\n }else{\n $pitem['quantity'] =$pitem['quantity'] + $item[0]['quantity'];\n }\n }else{\n $pitem['quantity'] =$pitem['quantity'] + $item[0]['quantity'];\n }\n $item_match = 1;\n }\n $new_items[] = $pitem;\n }\n\n if($item_match != 1){\n $new_items = array_merge($item,$previous_items);\n }\n $items_json = json_encode($new_items);\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n if($mode != 'wishlist'){\n $db->query(\"UPDATE cart SET items = '{$items_json}', expire_date = '{$cart_expire}' WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n $_SESSION['success_flash'] = 'cart update successful..';\n }else{\n $db->query(\"UPDATE wishlist SET items = '{$items_json}', expire_date = '{$cart_expire}' WHERE username = '{$user_name}'\");\n $_SESSION['success_flash'] = 'wishlist update successful..';\n }\n\n }\n}", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getId() {\n if($this->items!==false)\n return @current($this->items)->id_str;\n return false;\n }", "private function getIdBuysOfThisUser(User $u) {\n\n $query = \"SELECT ID_BUY FROM BUY WHERE ID_USER = \" . $u->getId() . \" GROUP BY ID_BUY ORDER BY ID_BUY DESC\";\n\n $result = parent::query($query);\n\n $buysId = [];\n $index = 0;\n\n while ($row = $result->fetch_assoc()) {\n $buysId[$index] = (int) $row['ID_BUY'];\n $index++;\n }\n\n return $buysId;\n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "public function getApplyItemId()\n {\n return $this->get(self::_APPLY_ITEM_ID);\n }", "function getItemIdByWikiPageAndGroupId($wikipage, $group_id) {\n $ids = array();\n $sql = sprintf('SELECT item_id'.\n ' FROM plugin_docman_item i'.\n ' WHERE i.wiki_page = \\'%s\\''.\n ' AND i.group_id = %d'.\n ' AND '. Docman_ItemDao::getCommonExcludeStmt('i')\n , db_es($wikipage), db_ei($group_id) \n );\n $res = $this->retrieve($sql);\n if($res && !$res->isError()) {\n\t if($res->rowCount() > 1) {\n $res->rewind();\n while($res->valid()) {\n\t\t $row = $res->current();\n $ids[] = $row['item_id'];\n $res->next();\n }\n return $ids;\n }\n else {\n $res->rewind();\n if($res->valid()) {\n $row = $res->current();\n $id = $row['item_id'];\n return $id;\n }\n }\n }\n else {\n return null;\n }\n }", "public function matchAll(WishlistItemInterface $wishlist_item, array $wishlist_items);", "public function getAllIds()\n {\n if (is_null($this->_itemIds)) {\n $this->_itemIds = parent::getAllIds();\n }\n return $this->_itemIds;\n }", "public function getIds();" ]
[ "0.85623133", "0.7994373", "0.77892303", "0.69232863", "0.6614264", "0.65120983", "0.62209964", "0.60974455", "0.60883564", "0.6043183", "0.5988286", "0.59730417", "0.594972", "0.58625734", "0.5842688", "0.5821572", "0.57435393", "0.5737017", "0.57279104", "0.57151616", "0.5709264", "0.5678626", "0.5656897", "0.5656202", "0.5591219", "0.55711347", "0.5564496", "0.5555445", "0.55494046", "0.55494046", "0.55494046", "0.5535019", "0.55235136", "0.55217195", "0.5521044", "0.55209297", "0.55133104", "0.55132544", "0.5503583", "0.5500623", "0.54869056", "0.54860383", "0.54782474", "0.54740524", "0.54660285", "0.54515815", "0.5450081", "0.5446614", "0.5442369", "0.54402375", "0.5427461", "0.54198885", "0.5406936", "0.53960234", "0.5394681", "0.5384829", "0.5376475", "0.5370907", "0.536409", "0.5361966", "0.5359603", "0.5354545", "0.53543687", "0.5351856", "0.5350452", "0.5350329", "0.5347255", "0.5347255", "0.5336055", "0.53231734", "0.5319147", "0.5317206", "0.5305312", "0.5299335", "0.5296021", "0.5293337", "0.529254", "0.5290702", "0.5284074", "0.52728003", "0.52725476", "0.52668303", "0.52663845", "0.5263645", "0.52614284", "0.52614284", "0.52602834", "0.5260158", "0.5257174", "0.5257174", "0.5257174", "0.5257174", "0.5257174", "0.52555794", "0.52458984", "0.52297497", "0.5227912", "0.5224166", "0.5217131", "0.52162147", "0.5211477" ]
0.0
-1
Set multiple wishlist item id
public function setId($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMultipleWishlistId($id);", "public function getMultipleWishlistId();", "public function setWishlistItemId(int $id);", "public function getWishlistItemId();", "public function setWishlistId(int $id);", "public function getWishlistId();", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setMetafieldWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products !== null or $products !== \"\") {\n $wishlist->setProductIds($productIds);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productIds);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if($value !== \"null\") {\n $productIds .= ',' . $value;\n }\n }\n } else {\n if($wishlistDecoded['metafields'][0]['value'] === \"null\") {\n $productIds = $productId;\n } else {\n $productIds = $wishlistDecoded['metafields'][0]['value'] .',' . $productId;\n }\n\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n } else {\n $data = [\n \"metafield\" => [\n \"namespace\" => \"wishlist\",\n \"key\" => \"wishlist-products\",\n \"value\" => '' . $productId . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . 'customers/'.$customerId.'/metafields.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n return new Response('wishlist saved');\n }", "function setItemId($a_item_id)\n\t{\n\t\t$this->item_id = $a_item_id;\n\t}", "public function setId($id)\r\n {\r\n $this->data['itemid'] = (int) $id;\r\n }", "public function actionAddToWishlist($product_id, $user_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('wishlist', $saveArr)->execute();\n exit;\n }", "public function updateQuantityFromArrayOfWishlistIds(array $wishlistIds)\r\n {\r\n foreach ($wishlistIds as $itemId => $itemQuantity) {\r\n if (!is_numeric($itemQuantity)) {\r\n continue;\r\n }\r\n if ($itemQuantity <= 0) {\r\n Wishlist::find($itemId)->delete();\r\n continue;\r\n }\r\n $this->updateWishlistId($itemId, $itemQuantity);\r\n }\r\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "private function updateWishlistId(int $wishlistId, int $quantity)\r\n {\r\n $wishlistItem = Wishlist::find($wishlistId);\r\n $wishlistItem->quantity = $quantity;\r\n $wishlistItem->save();\r\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "public function changeShelfWish($id){\n $library = Library::find(Auth::user()->library->id);\n $do = ['do'=> 0];\n $library->books()->attach($id, $do);\n return redirect('/library/showWishList');\n }", "public function updateItem($_id) {\n\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "protected function _construct()\n {\n $this->_init('cminds_multiwishlist/item', 'wishlist_item_id');\n }", "public function massQuoteIdAction()\n {\n $offerIds = $this->getRequest()->getParam('offer');\n if (!is_array($offerIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('mfb_myflyingbox')->__('Please select offers.')\n );\n } else {\n try {\n foreach ($offerIds as $offerId) {\n $offer = Mage::getSingleton('mfb_myflyingbox/offer')->load($offerId)\n ->setQuoteId($this->getRequest()->getParam('flag_quote_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d offers were successfully updated.', count($offerIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('mfb_myflyingbox')->__('There was an error updating offers.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }", "public function additemtowishlist($productid){\n\t\tif($this->checkwishlist($productid)){\n\t\t\t$object=array(\n\t\t\t\t'UserID' => $this->session->userdata('userid'),\n\t\t\t\t'UserEmail' => $this->session->userdata('useremail'),\n\t\t\t\t'Product_Id' => $productid\n\t\t\t);\n\t\t\t$this->db->insert('tbl_wishlist', $object);\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function setId_item($id_item)\n {\n $this->id_item = $id_item;\n\n return $this;\n }", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "public function addToFavorite($account_id, $item_id);", "function setItems($items);", "public function addselectedtocartAction() {\n $messages = array();\n $urls = array();\n $wishlistIds = array();\n $notSalableNames = array(); // Out of stock products message\n\n\t\t$ids = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('ids'));\n\t\t$qtys = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('qtys'));\n\t\t\n\t\t$ids_arr = explode(',', $ids);\n\t\t$qtys_arr = explode(',', $qtys);\n\t\t\n\t\t$i=0;\n\t\tforeach($ids_arr as $id)\n\t\t{\n\t\t\t$id = intval($id);\n\t\t\t$qty = intval($qtys_arr[$i]);\n\t\t\tif($id != '' && $qty != '')\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t$product = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->load($id)\n\t\t\t\t\t\t->setQty($qty);\n\t\t\t\t\tif ($product->isSalable()) {\n\t\t\t\t\t\tMage::getSingleton('checkout/cart')->addProduct($product,$qty);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$notSalableNames[] = $product->getName();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$url = Mage::getSingleton('checkout/session')->getRedirectUrl(true);\n\t\t\t\t\tif ($url)\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = Mage::getModel('core/url')\n\t\t\t\t\t\t\t->getUrl('catalog/product/view', array(\n\t\t\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t\t\t'wishlist_next' => 1\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t$urls[] = $url;\n\t\t\t\t\t\t$messages[] = $e->getMessage();\n\t\t\t\t\t\t$wishlistIds[] = $id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//$item->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n }\n\t\t\t$i++;\n\t\t}\n\t\tMage::getSingleton('checkout/cart')->save();\n\n if (count($notSalableNames) > 0) {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Following product(s) is currently out of stock:'));\n array_map(array(Mage::getSingleton('checkout/session'), 'addNotice'), $notSalableNames);\n }\n\n if ($urls) {\n Mage::getSingleton('checkout/session')->addError(array_shift($messages));\n $this->getResponse()->setRedirect(array_shift($urls));\n\n Mage::getSingleton('checkout/session')->setWishlistPendingUrls($urls);\n Mage::getSingleton('checkout/session')->setWishlistPendingMessages($messages);\n Mage::getSingleton('checkout/session')->setWishlistIds($wishlistIds);\n }\n else {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Product(s) Added successfully'));\n $this->_redirect('wishlist/index');\n }\n }", "public function wishlistAdd($requestParams,$wishlist,$productId){\n $response = array();\n if (! $productId) {\n /**\n * Set product not fount error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Product Not Found' );\n } else {\n /**\n * Get product collection\n * @var $product\n */\n $product = Mage::getModel ( 'catalog/product' )->load ( $productId );\n if (! $product->getId () || ! $product->isVisibleInCatalog ()) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Cannot specify product.' );\n } else {\n try {\n /**\n * Get parameters.\n */\n $buyRequest = new Varien_Object ( $requestParams );\n /**\n * Whislist add new product.\n */\n $result = $wishlist->addNewItem ( $product, $buyRequest );\n if (is_string ( $result )) {\n Mage::throwException ( $result );\n }\n $wishlist->save ();\n Mage::dispatchEvent ( 'wishlist_add_product', array (\n 'wishlist' => $wishlist,\n 'product' => $product,\n 'item' => $result\n ) );\n /**\n * Set success message.\n */\n Mage::helper ( 'wishlist' )->calculate ();\n $message = $product->getName ().' has been added to your wishlist.';\n $response ['status'] = 'SUCCESS';\n $response ['message'] = $message;\n /**\n * Unset registry.\n */\n Mage::unregister ( 'wishlist' );\n return $response;\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'An error occurred while adding item to wishlist: %s', $e->getMessage () );\n return $response;\n }\n }\n }\n }", "function cart_wishlist_update($mode,$db,$item,$cart_id,$user_name,$json_update,$cart_expire,$available){\n $paid = 0;\n if($mode == 'wishlist'){\n $cartQ = $db->query(\"SELECT * FROM wishlist WHERE username = '{$user_name}'\");\n }else{\n $cartQ = $db->query(\"SELECT * FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n }\n\n $return = mysqli_num_rows($cartQ);\n if($return != 1){\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n if($mode != 'wishlist'){\n $items_json = json_encode($item);\n $db->query(\"INSERT INTO cart (items,username,expire_date) VALUES ('{$items_json}','{$user_name}','{$cart_expire}')\");\n $cart_id = $db->insert_id; //return the last inserted item in database\n $_SESSION['cartid'] = $cart_id;\n $_SESSION['success_flash'] = ' Item added to Cart successfully.';\n }else{\n $db->query(\"INSERT INTO wishlist (id,username,items,expire_date) VALUES ('{$cart_id}','{$user_name}','{$json_update}','{$cart_expire}')\");\n $_SESSION['success_flash'] = 'wishlist update successful..';\n }\n }else{\n $cart = mysqli_fetch_assoc($cartQ);\n $previous_items = json_decode($cart['items'],true); //makes it an associated array not an object\n $item_match = 0;\n $new_items = array();\n //$_SESSION['success_flash'] = $product['title']. ' in loop.';\n foreach ($previous_items as $pitem){\n if($item[0]['id'] == $pitem['id'] && $item[0]['size'] == $pitem['size']){\n\n if($mode == 'cart'){\n if($available == 0){\n $pitem['quantity'] = $pitem['quantity']; // do not update quantity for same item\n }else{\n $pitem['quantity'] =$pitem['quantity'] + $item[0]['quantity'];\n }\n }else{\n $pitem['quantity'] =$pitem['quantity'] + $item[0]['quantity'];\n }\n $item_match = 1;\n }\n $new_items[] = $pitem;\n }\n\n if($item_match != 1){\n $new_items = array_merge($item,$previous_items);\n }\n $items_json = json_encode($new_items);\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n if($mode != 'wishlist'){\n $db->query(\"UPDATE cart SET items = '{$items_json}', expire_date = '{$cart_expire}' WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n $_SESSION['success_flash'] = 'cart update successful..';\n }else{\n $db->query(\"UPDATE wishlist SET items = '{$items_json}', expire_date = '{$cart_expire}' WHERE username = '{$user_name}'\");\n $_SESSION['success_flash'] = 'wishlist update successful..';\n }\n\n }\n}", "public function setApplyItemId($value)\n {\n return $this->set(self::_APPLY_ITEM_ID, $value);\n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "protected function createWishlist(array $params, int $wishlistId)\n {\n $multipleWishlist = $this->multipleWishlistFactory->create();\n $multipleWishlist->setWishlistId($wishlistId);\n $multipleWishlist->setName($params['name']);\n $multipleWishlist->setSharingCode($this->mathRandom->getUniqueHash());\n\n try {\n $this->multipleWishlistRepository->save($multipleWishlist);\n } catch (CouldNotSaveException $e) {\n $this->logger->error($e->getMessage());\n return false;\n }\n\n return true;\n }", "public function wishlist($action = null, $id = null) {\n $company_id = $this->Session->read('CompanyLoggedIn.Company.id');\n\n // verifica se vai cadastrar uma oferta especifica para usuario\n if ($action == 'offer_user') {\n $this->Session->write('CadOfferUser.id_linha_wishlist', $id);\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n\n // verifica post e se vai inserir uma oferta especifica p/ usuario\n if ($this->request->is('post')) {\n\n if ($this->request->data ['excluir_wishlist'] == true) {\n $render = true;\n $this->layout = '';\n\n // faz update de wishlist para excluir desejo\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'INACTIVE'\n )\n );\n\n $desejosDel = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if (!$desejosDel ['status'] == 'SAVE_OK') {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else if ($this->request->data ['id_oferta'] > 0) {\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'ACTIVE',\n 'offer_id' => $this->request->data ['id_oferta']\n )\n );\n\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n } else {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else {\n $mensagem = \"Voce nao selecinou nenhuma oferta para este desejo. Tente novamente\";\n }\n }\n\n $limit = 6;\n $update = true;\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n )\n )\n );\n $contador = $this->Utility->urlRequestToGetData('companies', 'count', $params);\n\n // verifica se esta fazendo uma requisicao ajax\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 2;\n if ($limit >= $contador) {\n $limit = $contador;\n $update = false;\n }\n }\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n ),\n 'limit' => $limit\n ),\n 'User',\n 'UsersWishlist',\n 'CompaniesCategory'\n );\n $desejos = $this->Utility->urlRequestToGetData('companies', 'all', $params);\n\n // pegando ofertas de empresa\n $params = array(\n 'Offer' => array(\n 'fields' => array(\n 'Offer.id',\n 'Offer.title'\n ),\n 'conditions' => array(\n 'Offer.company_id' => $company_id,\n 'Offer.status' => 'ACTIVE'\n ),\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $ofertas = $this->Utility->urlRequestToGetData('offers', 'all', $params);\n\n $this->set(compact('ofertas', 'desejos', 'limit', 'contador', 'update', 'mensagem'));\n\n if (!empty($render))\n $this->render('Elements/ajax_desejos');\n }", "function addCategory($object) {\n $object->Item->ShopId = 'yourReturnedCategoryIdOnMarketplace_'.rand(1000, 9999); \n}", "protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}", "public function addWishlist($id){\n if (Auth::check()) {\n if (Wishlist::where('product_id',$id)->where('user_id',Auth::id())->exists()) {\n return response()->json([\n 'error' => \"This Product Already Add Wishlist\",\n ]);\n }\n else {\n Wishlist::insert([\n 'user_id' => Auth::id(),\n 'product_id' => $id,\n 'created_at' => Carbon::now()\n ]);\n return response()->json([\n 'success' => \"Add Wishlist Successfully\"\n ]);\n }\n }\n else {\n return response()->json([\n 'error' => \"Please Login First\"\n ]);\n }\n }", "public function offers_suppression_list_put($id)\n {\n //print_r($data);\n // die();\n $this->verify_request();\n // $headers = $this->input->request_headers();\n // // Extract the token\n // echo $token = $headers['Authorization'];die;\n $data=$this->put(); \n $this->db->update('suppression_list',$data,array('sup_list_id' => $id));\n $status = parent::HTTP_OK;\n $this->response(['Item updated successfully.'], $status);\n }", "function ajouterArticleWishList($libelleProduit,$idProduit,$qteProduit,$prixProduit,$enseigne, $idEnseigne, $pourcentageReverse,$mediaProduit){\n /*echo 'fonction ajouter <br>';\n echo '<br>'.$libelleProduit.'<br>'.$idProduit.'<br>'.$qteProduit.'<br>'.$prixProduit.'<br>'.$enseigne.'<br>'.$idEnseigne.'<br>'. $pourcentageReverse.'<br>'.$mediaProduit;\n */\n //Si le wishlist existe\n if (creationwishlist() && !isVerrouilleWishlist())\n {\n //Si le produit existe déjà on ajoute seulement la quantité\n $positionProduit = array_search($libelleProduit, $_SESSION['wishlist']['libelleProduit']);\n\n if ($positionProduit !== false)\n {\n $_SESSION['wishlist']['qteProduit'][$positionProduit] += $qteProduit ;\n }\n else\n {\n //Sinon on ajoute le produit\n array_push( $_SESSION['wishlist']['libelleProduit'],$libelleProduit);\n array_push( $_SESSION['wishlist']['idProduit'],$idProduit);\n array_push( $_SESSION['wishlist']['qteProduit'],$qteProduit);\n array_push( $_SESSION['wishlist']['prixProduit'],$prixProduit);\n array_push( $_SESSION['wishlist']['enseigne'],$enseigne);\n array_push( $_SESSION['wishlist']['idEnseigne'],$idEnseigne);\n array_push( $_SESSION['wishlist']['mediaProduit'],$mediaProduit);\n array_push( $_SESSION['wishlist']['pourcentageReverse'],$pourcentageReverse);\n }\n }\n else\n echo \"Un problème est survenu veuillez contacter l'administrateur du site.\";\n}", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "private function _setListId()\r\n { \r\n if (Mage::getSingleton('admin/session')->isLoggedIn()) {\r\n $storeId = Mage::app()->getRequest()->getParam('store_id');\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId', $storeId); \r\n } else {\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId');\r\n }\r\n }", "function addconfig_to_favoritesAction()\n\t{\n\t\t$session = Mage::getSingleton('customer/session');\n\t\t $this->_customerId = $session->getCustomer()->getId();\n\t\t $list = Mage::getModel('amlist/list');\n\t \t $listId = $this->getRequest()->getParam('list');\n\t\t $post = $this->getRequest()->getPost();\n\t\t $products = $post['product'];\n\t\t if (!$listId){ //get default - last\n\t $listId = Mage::getModel('amlist/list')->getLastListId($this->_customerId);\n\t \t }\n\t \t if (!$listId) \n\t\t { \n\t\t //create new\n\t\t //print_r($post['selected_productid']);\n\t\t //exit;\n\t Mage::getSingleton('amlist/session')->setAddProductId($post['selected_productid']);\n\t\t Mage::getSingleton('amlist/session')->setAddAllProductId($products);\n\t $this->_redirect('amlist/list/edit/');\n\t return;\n\t }\n\t\t\tif($post['selected_productid'])\n\t\t\t{\n\t\t\t\t\n\t\t\t\tforeach($products as $_product)\n\t\t\t\t{\n\t\t\t\t\tif($post['selected_productid']==$_product[product]):\n\t\t\t\t\t\t$item = Mage::getModel('amlist/item')\n\t\t\t\t\t\t->setProductId($_product[product])\n\t\t\t\t\t\t->setListId($listId) \n\t\t\t\t\t\t->setQty($_product[qty])\n\t\t\t\t\t\t->setBuyRequest(serialize($_product));\n\t\t\t\t\t\t$item->save();\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t}\n\t\t\t\t Mage::getSingleton('core/session')->addSuccess($this->__('Product has been successfully added to the folder.'));\n\t\t\t\t $this->_redirectReferer();\n\t\t\t}\n\t}", "public function utilityIds()\n {\n $this->attributes['utilityIds'] = $this->utilities->pluck('id');\n }", "function SetBidList(&$list)\n\t{\n\t\t$this->_bidList = array();\n\t\t$existingBidList = $this->GetBidList();\n\t\tforeach ($existingBidList as $bid)\n\t\t{\n\t\t\t$bid->supplierId = '';\n\t\t\t$bid->Save(false);\n\t\t}\n\t\t$this->_bidList = $list;\n\t}", "function setId($id) {\r\n\t\t// Set item id and wipe data\r\n\t\t$this->_id\t = $id;\r\n\t\t$this->_item\t\t= null;\r\n\t}", "function count_wishlist() {\n $total_items = 0;\n if (is_array($this->wishID)) {\n reset($this->wishID);\n while (list($wishlist_id, ) = each($this->wishID)) {\n $total_items++;\n }\n }\n\n return $total_items;\n }", "function add_wishlist($_id_member,$_id_product,$_id_source)\n\t\t{\n\t\t\t//must make a rule to get different product detail depend on id_source\n\t\t\t\n\t\t\t$_id_member_session = $this->CI->session->userdata('id_member');\n\t\t\t//Must relate with model wishlist return must an integer\n\t\t\t$_wishlist_already_added = $this->CI->model_product->is_added_stuff($_id_product,$_id_member);\n\t\t\t/*if(!$_wishlist_already_added)\n\t\t\t{\n\t\t\t\t$this->model_zhout->update_wishlist_status($_id_product);\n\t\t\t\t$this->model_wishlist->insert_wishlist($_id_member,$_id_product);\n\t\t\t\t$data['message'] = ''\n\t\t\t\treturn \n\t\t\t}*/\n\t\t}", "public function cartAction()\n {\n if (!$this->_validateFormKey()) {\n return $this->_redirect('*/*');\n }\n $itemId = (int) $this->getRequest()->getParam('item');\n\n /* @var $item Mage_Wishlist_Model_Item */\n $item = Mage::getModel('wishlist/item')->load($itemId);\n if (!$item->getId()) {\n return $this->_redirect('*/*');\n }\n $wishlist = $this->_getWishlist($item->getWishlistId());\n if (!$wishlist) {\n return $this->_redirect('*/*');\n }\n\n // Set qty\n $qty = $this->getRequest()->getParam('qty');\n if (is_array($qty)) {\n if (isset($qty[$itemId])) {\n $qty = $qty[$itemId];\n } else {\n $qty = 1;\n }\n }\n $qty = $this->_processLocalizedQty($qty);\n if ($qty) {\n $item->setQty($qty);\n }\n\n /* @var $session Mage_Wishlist_Model_Session */\n $session = Mage::getSingleton('wishlist/session');\n $cart = Mage::getSingleton('checkout/cart');\n\n $redirectUrl = Mage::getUrl('*/*');\n\n try {\n $options = Mage::getModel('wishlist/item_option')->getCollection()\n ->addItemFilter(array($itemId));\n $item->setOptions($options->getOptionsByItem($itemId));\n \n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null;\n if($itemBuyRequest['super_attribute']) {\n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n $itemBuyRequest->setData('product', $childProduct->getId());\n } \n\n $buyRequest = Mage::helper('catalog/product')->addParamsToBuyRequest(\n $this->getRequest()->getParams(),\n array('current_config' => $itemBuyRequest)\n );\n \n // Overwrite stored product with loaded simple configurable because it holds stock info\n if($childProduct) {\n $buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n }\n $item->mergeBuyRequest($buyRequest);\n \n if ($item->addToCart($cart, true)) {\n $cart->save()->getQuote()->collectTotals();\n }\n\n $wishlist->save();\n Mage::helper('wishlist')->calculate();\n\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n }\n Mage::helper('wishlist')->calculate();\n\n $product = Mage::getModel('catalog/product')\n ->setStoreId(Mage::app()->getStore()->getId())\n ->load($item->getProductId());\n $productName = Mage::helper('core')->escapeHtml($product->getName());\n $message = $this->__('%s was added to your shopping cart.', $productName);\n Mage::getSingleton('catalog/session')->addSuccess($message);\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $session->addError($this->__('This product(s) is currently out of stock'));\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n Mage::getSingleton('catalog/session')->addNotice($e->getMessage());\n $redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));\n } else {\n Mage::getSingleton('catalog/session')->addNotice($e->getMessage());\n $redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $session->addException($e, $this->__('Cannot add item to shopping cart'));\n }\n\n Mage::helper('wishlist')->calculate();\n\n return $this->_redirectUrl($redirectUrl);\n }", "public function setIds($arrIds);", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "function set_list_id($list_id) {\n $this->_subscribers_base_route = $this->_base_route.'subscribers/'.$list_id;\n }", "function addtoBasket($product_id, $can_update = '0', $to_wishlist = '0')\r\n\t{\r\n\t\t$to_wishlist = (isset($_REQUEST[\"wishlist_$_REQUEST[product_id]\"]) && $_REQUEST[\"wishlist_$_REQUEST[product_id]\"] == 1 ) ? '1' : '0';\r\n\t\tif($to_wishlist==1) $can_update=1;\r\n\r\n\t\t$product_id = (int)$product_id;\r\n\t\t$amount = (int)$_REQUEST['amount'];\r\n\t\tif (($amount > '0') && ($can_update == '1' || !isset($_SESSION['Product'][$_REQUEST['product_id']]) || !in_array($_REQUEST['id'], $_SESSION['Product'])))\r\n\t\t{\r\n\t\t\tif(isset($_REQUEST['product_id']) && is_numeric($_REQUEST['product_id']))\r\n\t\t\t{\r\n\r\n\t\t\t\tif($to_wishlist!=1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$_SESSION['Product'][$_REQUEST['product_id']] = $amount;\r\n\r\n\t\t\t\t\t// Mögliche Varianten in Session\r\n\t\t\t\t\t// Hier wird ein Produkt aus dem Wunschzettel abgelegt\r\n\t\t\t\t\tif(isset($_REQUEST['vars']) && $_REQUEST['vars'] != '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(isset($_REQUEST['vars']) && $_REQUEST['vars'] != '')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$Vars_To_Session = $_REQUEST['vars'];\r\n\t\t\t\t\t\t\t$_SESSION['ProductVar'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$Vars_To_Session = chop(base64_decode($_REQUEST['vars']));\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t$_SESSION['ProductVar'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Hier wird ein normal (nicht aus dem Wunschzettel) abgelegt\r\n\t\t\t\t\tif(isset($_POST['product_vars']) && is_array($_POST['product_vars']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Vars_To_Session = implode(',', $_REQUEST['product_vars']);\r\n\t\t\t\t\t\t$_SESSION['ProductVar'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// In Wunschliste?\r\n\t\t\t\tif($to_wishlist==1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_merkliste WHERE Benutzer = '\".$_SESSION['cp_benutzerid'].\"'\");\r\n\t\t\t\t\t$row = $sql->fetchrow();\r\n\t\t\t\t\tif(is_object($row) && $row->Id != '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Vorhandene Einträge auslesen und aktualisieren\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'] = unserialize($row->Inhalt);\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist_Vars'] = unserialize($row->Inhalt_Vars);\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'][$_REQUEST['product_id']] = $amount;\r\n\t\t\t\t\t\t$Vars_To_Session = implode(',', $_REQUEST['product_vars']);\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist_Vars'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'][$_REQUEST['product_id']] = $amount;\r\n\r\n\t\t\t\t\t\t$GLOBALS['db']->Query(\"UPDATE \" . PREFIX . \"_modul_shop_merkliste\r\n\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\tInhalt = '\".serialize($_SESSION['Product_Wishlist']).\"',\r\n\t\t\t\t\t\t\tInhalt_Vars = '\".serialize($_SESSION['Product_Wishlist_Vars']).\"'\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tBenutzer = '\".$_SESSION['cp_benutzerid'].\"'\");\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Neu\r\n\t\t\t\t\t\t// mögliche Varianten\r\n\t\t\t\t\t\t$Db_Vars = '';\r\n\t\t\t\t\t\tif(isset($_POST['product_vars']) && is_array($_POST['product_vars']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$Vars_To_Session = implode(',', $_REQUEST['product_vars']);\r\n\t\t\t\t\t\t\t$_SESSION['Product_Wishlist_Vars'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t\t\t$Db_Vars = serialize($_SESSION['Product_Wishlist_Vars']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'][$_REQUEST['product_id']] = $amount;\r\n\t\t\t\t\t\t$GLOBALS['db']->Query(\"INSERT INTO \" . PREFIX . \"_modul_shop_merkliste\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tId,\r\n\t\t\t\t\t\t\tBenutzer,\r\n\t\t\t\t\t\t\tIp,\r\n\t\t\t\t\t\t\tInhalt,\r\n\t\t\t\t\t\t\tInhalt_Vars\r\n\t\t\t\t\t\t) VALUES (\r\n\t\t\t\t\t\t\t'',\r\n\t\t\t\t\t\t\t'\".$_SESSION['cp_benutzerid'].\"',\r\n\t\t\t\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"',\r\n\t\t\t\t\t\t\t'\".serialize($_SESSION['Product_Wishlist']).\"',\r\n\t\t\t\t\t\t\t'$Db_Vars'\r\n\t\t\t\t\t\t)\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\theader(\"Location:\" . $_SERVER['HTTP_REFERER']);\r\n\t\texit;\r\n\t}", "public function set_id($ids) {\n $this->id = $ids; \n }", "function removeProductFromWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productIdToDelete = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'wishlist-products');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if((string) $productIdToDelete !== (string) $value) {\n if($productIds == '') {\n $productIds .= $value;\n } else {\n $productIds .= ',' . $value;\n }\n }\n }\n }\n\n if($productIds === '') {\n $productIds = \"null\";\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n }\n\n return new Response('wishlist saved');\n }", "public function setNameAndId() {}", "public function match(WishlistItemInterface $wishlist_item, array $wishlist_items);", "function addVako($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoIdOnMarketplace_'.rand(1000, 9999); \n}", "function addArticle($object) {\n $object->Item->ShopId = 'yourReturnedArticleIdOnMarketplace_'.rand(1000, 9999); \n}", "function wp_parse_id_list($input_list)\n {\n }", "protected function _update_cookies(){\n\t\t\t$cookie = yith_getcookie( 'yith_wcwl_products' );\n\t\t\t$new_cookie = array();\n\n\t\t\tif( ! empty( $cookie ) ) {\n\t\t\t\tforeach ( $cookie as $item ) {\n\t\t\t\t\tif ( ! isset( $item['add-to-wishlist'] ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$new_cookie[] = array(\n\t\t\t\t\t\t'prod_id' => $item['add-to-wishlist'],\n\t\t\t\t\t\t'quantity' => isset( $item['quantity'] ) ? $item['quantity'] : 1,\n\t\t\t\t\t\t'wishlist_id' => false\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tyith_setcookie( 'yith_wcwl_products', $new_cookie );\n\t\t\t}\n\t\t}", "public function appendItemIds($value)\n {\n return $this->append(self::_ITEM_IDS, $value);\n }", "public function index($wishlistid)\n {\n $wish['wishlistid'] = $wishlistid;\n\n $validation = Validator::make($wish,[\n 'wishlistid'=>'exists:wishes,wishlistid',\n ]);\n\n if($validation->fails())\n {\n $failedRules = $validation->failed();\n $field = '';\n\n if(isset($failedRules['wishlistid']['Exists']))\n {\n $message = 'Wishlist id not found.';\n $field = 'wishlistid';\n }\n\n return response()->json(['status'=>'400','message'=>$message,'field'=>$field]);\n }\n else\n {\n $wishes = $this->wish->getWishesByWishlistId($wishlistid);\n $userid = $this->wishlist->getCreatedById($wishlistid);\n\n $getFavoriteBookmarkForStream = $this->favoritebookmark->getFavoriteBookmarkForStream($userid);\n foreach($wishes as $w)\n {\n $w->favorited = '0';\n $w->bookmarked = '0';\n foreach($getFavoriteBookmarkForStream as $gfbfs)\n {\n if($w->id == $gfbfs['wishid'])\n {\n if($gfbfs['type'] == '2')\n {\n $w->favorited = '1';\n }\n if($gfbfs['type'] == '1')\n {\n $w->bookmarked = '1';\n }\n }\n }\n $w->favoritecount = $this->favoritebookmark->countFavoriteBookmark($w->id, '2');\n $w->bookmarkcount = $this->favoritebookmark->countFavoriteBookmark($w->id, '1');\n }\n\n return response()->json(['status'=>'200','message'=>'Ok','wishes'=>$wishes]);\n }\n }", "function displayWishLists()\n{\n $customerId = 1;\n $wishlists = wishlistsDB::getWishlistsByCustomer($customerId);\n foreach ($wishlists as $wishlist) {\n $wid= $wishlist->getWishlistId();\n\n $wname = $wishlist->getWishlistName();\n\n echo \"<div id='wishlistName'>\";\n echo $wname;\n echo \"</div>\";\n echo \"<input type='submit' class='btn btn-default' value='Add to Wishlist' name='pushToList' id='pushToList' onclick=\\\"addtoList('$wid');\\\" />\";\n echo \"<br/><br/>\";\n }\n echo \"<input type='submit' name='newWishlist' class='btn btn-default' value='Create new Wishlist' onclick=\\\"newList();\\\"/>\";\n\n}", "protected function addItemsToCart(array $wishlistItems, CartInterface $quote): void\n {\n foreach ($wishlistItems as $item) {\n $product = $item['product'];\n\n $data = [];\n if ($product->getTypeId() === Configurable::TYPE_CODE) {\n $data['super_attribute'] = $item['super_attribute'];\n }\n\n $buyRequest = new DataObject();\n $buyRequest->setData($data);\n\n $quoteItem = $quote->addProduct($product, $buyRequest);\n $quoteItem->setQty($item['qty']);\n }\n\n try {\n $this->quoteRepository->save($quote);\n } catch (Exception $e) {\n throw new GraphQlNoSuchEntityException(__('There was an error when trying to save wishlist items to cart'));\n }\n }", "function addArticleCrossselling($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedCrosssellingIdOnMarketplace_'.rand(1000, 9999); \n \n}", "public function updateItem($itemId, $buyRequest, $params = null)\n {\n $item = null;\n if ($itemId instanceof Mage_Wishlist_Model_Item) {\n $item = $itemId;\n } else {\n $item = $this->getItem((int)$itemId);\n }\n if (!$item) {\n Mage::throwException(Mage::helper('wishlist')->__('Cannot specify wishlist item.'));\n }\n\n $product = $item->getProduct();\n $productId = $product->getId();\n if ($productId) {\n if (!$params) {\n $params = new Varien_Object();\n } else if (is_array($params)) {\n $params = new Varien_Object($params);\n }\n $params->setCurrentConfig($item->getBuyRequest());\n $buyRequest = Mage::helper('catalog/product')->addParamsToBuyRequest($buyRequest, $params);\n\n $product->setWishlistStoreId($item->getStoreId());\n $items = $this->getItemCollection();\n $isForceSetQuantity = true;\n foreach ($items as $_item) {\n /* @var $_item Mage_Wishlist_Model_Item */\n if ($_item->getProductId() == $product->getId()\n && $_item->representProduct($product)\n && $_item->getId() != $item->getId()) {\n // We do not add new wishlist item, but updating the existing one\n $isForceSetQuantity = false;\n }\n }\n $resultItem = $this->addNewItem($product, $buyRequest, $isForceSetQuantity);\n /**\n * Error message\n */\n if (is_string($resultItem)) {\n Mage::throwException(Mage::helper('checkout')->__($resultItem));\n }\n\n if ($resultItem->getId() != $itemId) {\n if ($resultItem->getDescription() != $item->getDescription()) {\n $resultItem->setDescription($item->getDescription())->save();\n }\n $item->isDeleted(true);\n $this->setDataChanges(true);\n } else {\n $resultItem->setQty($buyRequest->getQty() * 1);\n $resultItem->setOrigData('qty', 0);\n }\n } else {\n Mage::throwException(Mage::helper('checkout')->__('The product does not exist.'));\n }\n return $this;\n }", "public function setId($id)\n\t{\n\t\tparent::setId($id);\n\t\t$params = $this->getParams();\n\n\t\t// Set elementlist params from picklist params\n\t\t$params->set('allow_frontend_addto', (bool) $params->get('allowadd', false));\n\t}", "function setSyncItemsCodeProduct()\n {\n }", "function carspotAPI_save_appProduct_ids( $post_id )\n\t{\n\t\tif( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n\t\t \n\t\t/*if our nonce isn't there, or we can't verify it, bail*/\n\t\tif( !isset( $_POST['meta_box_nonce_product'] ) || !wp_verify_nonce( $_POST['meta_box_nonce_product'], 'my_meta_box_nonce_product' ) ) return;\n\t\t \n\t\t/*if our current user can't edit this post, bail*/\n\t\tif( !current_user_can( 'edit_post' ) ) return;\n\t\t\n\t\t/*Make sure your data is set before trying to save it*/\n\t\tif( isset( $_POST['package_product_code_android'] ) ){\n\t\t\tupdate_post_meta( $post_id, 'package_product_code_android', $_POST['package_product_code_android'] );\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tupdate_post_meta( $post_id, 'package_product_code_android', '' );\n\t\t}\n\t\t/*For IOS */\n\t\tif( isset( $_POST['package_product_code_ios'] ) ){\n\t\t\tupdate_post_meta( $post_id, 'package_product_code_ios', $_POST['package_product_code_ios'] );\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tupdate_post_meta( $post_id, 'package_product_code_ios', '' );\n\t\t}\t\t\n\t}", "public function matchAll(WishlistItemInterface $wishlist_item, array $wishlist_items);", "function addArticleAttribut($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedAttributIdOnMarketplace_'.rand(1000, 9999); \n}", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function getId($item);", "public function getItemIds();", "public function setSharepointIds($val)\n {\n $this->_propDict[\"sharepointIds\"] = $val;\n return $this;\n }", "public function FavoriteAdd($idItem){\n try{\n $this->executeQuery([\"idUser\"=>$this->idUser,\"idItem\"=>$idItem],\"favoriteAdd\",\"/[^0-9]/\");\n }catch(Exception $e){\n\n }\n }", "public function products_id()\n {\n foreach ($_SESSION['cart'] as $id => $quaty){\n $product_id[] = \"($id, $quaty)\";\n $product = Data::find_by_id($id);\n $id = array('id' => 'No: '. $product->id, 'name' => ' '. $product->name, 'price' => ' €'.$product->price, 'quaty' => ' qty '.$quaty, 'cost' => ' = €'.$product->price * $quaty .'</br>');\n foreach ($id as $key => $value){\n echo /*$key .' = '.*/ $value; /*echo \", \"; &nbsp; = spatie*/\n }\n }\n // $insert_id = implode(',', $product_id);\n }", "public function actionAddProductToWishlist()\n {\n // set wishlistId variable from params\n $productId = craft()->request->getRequiredParam('productId');\n $wishlistId = craft()->request->getRequiredParam('wishlistId');\n $redirectUrl = craft()->request->getRequiredParam('redirect');\n\n // Create a new wishlist with above title\n craft()->wishlist->addProductToWishlist($productId, $wishlistId);\n\n // Set Flash message\n craft()->userSession->setFlash('addProductToWishlistSuccess', 'Product has been added to wishlist!');\n\n // Redirect to plugin index page\n $this->redirect($redirectUrl);\n }", "function as_action_init_wish_list() {\n global $wpdb;\n $page_found = $wpdb->get_var(\"SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_name` = 'wishlist' LIMIT 1;\");\n if ($page_found) {\n update_option('as-wishlist-page-id', $page_found);\n return;\n }\n\n $page_data = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_author' => 1,\n 'post_name' => esc_sql(_x('wishlist', 'page_slug', 'as')),\n 'post_title' => __('Wishlist', 'as'),\n 'post_content' => '[as_wish_list]',\n 'post_parent' => 0,\n 'comment_status' => 'closed'\n );\n $page_id = wp_insert_post($page_data);\n update_option('as-wishlist-page-id', $page_id);\n}", "function loadQuotationToWishlist($qid)\n {\n \t$result = $this->query(\"SELECT * FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' and id='\".$qid.\"'\");\n\t$arr = $this->toArray($result[0]['content']) ;\n if($arr)\n {\n foreach ($arr as &$value) {\n $tostringarr[$n][0] = \t$value['id'];\n $tostringarr[$n][1] = \t$value['qty'];\n $n++;\n }\n $str = $this->toString($tostringarr);\n \n // Create the Quotation\n // Updated by Saliya Wijesinghe\n $thisTime=time();\n $thisQuoteId=\"RE:\".$result[0]['quotationid'];\n $this->query(\"INSERT INTO`\".$this->tblPrefix.$this->table.\"` (client_id,quotationid,title,content,amount,moddate,himage,cdetails,othertxt,status)\n VALUES ('\".$this->logUser.\"', '\".$thisQuoteId.\"', '\".$result[0]['title'].\"','\".$result[0]['content'].\"','\".$result[0]['amount'].\"',\n '\".$thisTime.\"','\".$result[0]['himage'].\"','\".$result[0]['cdetails'].\"','\".$result[0]['othertxt'].\"','open')\");\n\n // GetThe added record\n $newQuote = $this->query(\"SELECT id FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' AND moddate='\".$thisTime.\"' AND content='\".$result[0]['content'].\"' AND quotationid='\".$thisQuoteId.\"'\");\n // Update the Wish list\n $result = $this->query(\"UPDATE `\".$this->tblPrefix.\"sys_support` SET content_wlist='\".$str.\"',wish_quote_link='\".$newQuote[0]['id'].\"' WHERE client_id='\".$this->logUser.\"'\");\n\n if($result) return $msg = array('SUC','QUOTE_RE_CREATED');\n \n }\n\t \t \n }", "function SetItemcommentid($value) { $this->itemCommentId=$value; }", "function update_list( $id, $name, $can_delete, $items )\n\t{\n\t\t$this->db->set('name', $name );\n if( $can_delete !== NULL ) {\n $this->db->set('can_delete', $can_delete );\n } \n $this->db->where( 'id', $id );\n\t\t$this->db->update('lists');\n\t\t\n // Save the list items\n\t\t$this->db->where( 'list_id', $id );\n\t\t$this->db->delete( 'list_items' );\n\t\tfor( $i = 0; $i < count($items); $i++ ) {\n $this->db->set('list_id', $id );\n $this->db->set('data_id', $items[$i]['id']);\n\t\t\t$this->db->set('title', $items[$i]['title']);\n\t\t\t$this->db->set('type', $items[$i]['type']);\n\t\t\t$this->db->set('sort_order', $i + 1);\n\t\t\t$this->db->insert('list_items');\n }\n\t}", "public function editAction() {\r\n\r\n //SET LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //ONLY LOGGED IN USER CAN CREATE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET WISHLIST ID AND CHECK VALIDATION\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n if (empty($wishlist_id)) {\r\n return $this->_forward('notfound', 'error', 'core');\r\n }\r\n\r\n //GET WISHLIST OBJECT\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n $level_id = $viewer->level_id;\r\n\r\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Edit();\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n\r\n //PRIVACY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n $perms = array();\r\n foreach ($roles as $roleString) {\r\n $role = $roleString;\r\n if ($auth->isAllowed($wishlist, $role, 'view')) {\r\n $perms['auth_view'] = $roleString;\r\n }\r\n }\r\n\r\n $form->populate($wishlist->toArray());\r\n $form->populate($perms);\r\n return;\r\n }\r\n\r\n //FORM VALIDATION\r\n if (!$form->isValid($this->getRequest()->getPost())) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getItemTable('sitestoreproduct_wishlist')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n\r\n //SAVE DATA\r\n $wishlist->setFromArray($values);\r\n $wishlist->save();\r\n\r\n //PRIVACTY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n\r\n if (empty($values['auth_view'])) {\r\n $values['auth_view'] = array('everyone');\r\n }\r\n\r\n $viewMax = array_search($values['auth_view'], $roles);\r\n foreach ($roles as $i => $role) {\r\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //GET URL\r\n $url = $this->_helper->url->url(array('wishlist_id' => $wishlist->wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\", true);\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'smoothboxClose' => 10,\r\n 'parentRedirect' => $url,\r\n 'parentRedirectTime' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your wishlist has been edited successfully.'))\r\n ));\r\n }", "function set_items() { \n\n\t\t$this->items = $this->get_items();\n\n\t}", "function fn_wishlist_get_count()\n{\n $wishlist = array();\n $result = 0;\n\n if (!empty(Tygh::$app['session']['wishlist'])) {\n $wishlist = & Tygh::$app['session']['wishlist'];\n $result = !empty($wishlist['products']) ? count($wishlist['products']) : 0;\n }\n\n /**\n * Changes wishlist items count\n *\n * @param array $wishlist wishlist data\n * @param int $result wishlist items count\n */\n fn_set_hook('wishlist_get_count_post', $wishlist, $result);\n\n return empty($result) ? -1 : $result;\n}", "public function setId($id)\n {\n $this->id = $id;\n if ( ! array_key_exists($this->id, static::$basket)) {\n static::$basket[$this->id] = array();\n }\n }", "public function bookmarkItem($id){\n $url = 'api/add/favoris?id='.$id;\n $reponse = $this->dispatcher->raw()->get($url);\n return Redirect()->back();\n }", "public function setLike($id){\n $producto = Producto::find($id);\n $producto->like = $producto->like + 1;\n $producto->save();\n\n return \\response()->json(['res' => true, 'message'=>'mas un like'], 200);\n }", "function setSwimMeetId($id)\r\n {\r\n $this->_swimmeetid = $id ;\r\n }", "public function setExtensionAttributes(MultipleWishlistItemExtensionInterface $extensionAttributes);", "public function setItems(array $items);", "public function setItems(array $items);", "public function setItems(array $items);" ]
[ "0.8082416", "0.7523229", "0.73613006", "0.68790865", "0.6877334", "0.6702284", "0.6358615", "0.6317094", "0.6284763", "0.6284763", "0.61774004", "0.5848828", "0.58404243", "0.57348657", "0.572533", "0.57148314", "0.5694598", "0.5668503", "0.56031334", "0.55534077", "0.5542777", "0.5500324", "0.54935914", "0.5492802", "0.54808897", "0.5451089", "0.544432", "0.54392695", "0.54279643", "0.540176", "0.5396638", "0.5395258", "0.5385451", "0.53580296", "0.5355254", "0.53382444", "0.53362215", "0.53355855", "0.5326569", "0.53262097", "0.53148687", "0.5314672", "0.5314437", "0.52948165", "0.528512", "0.52810013", "0.5280698", "0.52754474", "0.52321285", "0.52251977", "0.5220206", "0.52048266", "0.5188177", "0.5188177", "0.5188177", "0.5188177", "0.5188177", "0.51797503", "0.51783353", "0.51548284", "0.51491445", "0.5141238", "0.51412135", "0.51387405", "0.5136045", "0.5132515", "0.51178354", "0.51104206", "0.5108268", "0.5107281", "0.5103951", "0.5084683", "0.5078366", "0.5077357", "0.5067623", "0.5067113", "0.50638133", "0.50630033", "0.5062987", "0.5062987", "0.5052142", "0.5051311", "0.5050888", "0.5039528", "0.503792", "0.5026224", "0.501891", "0.5012235", "0.5010959", "0.5010731", "0.5000052", "0.49882084", "0.49842936", "0.4965733", "0.49643737", "0.49631608", "0.49594343", "0.49508816", "0.49464074", "0.49464074", "0.49464074" ]
0.0
-1
Returns main wishlist id
public function getWishlistId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "public function getMultipleWishlistId();", "public function getWishlistItemId();", "public function setWishlistId(int $id);", "protected function getWidgetId()\n {\n return !empty($_GET['wid']) ? $_GET['wid'] : 'rrf';\n }", "public function getWishlistOwnerWebsiteId($wishlist)\n {\n $customerId = $wishlist->getCustomerId();\n if ($customerId) {\n /** @var Mage_Customer_Model_Customer $owner */\n $owner = Mage::getModel(\"customer/customer\");\n $owner->load($customerId);\n if ($owner->getId()) {\n return $owner->getWebsiteId();\n }\n }\n\n return null;\n }", "public abstract function get_default_list_id();", "function GetID () {\n return $this->hunt_id;\n }", "public function fetch_the_id() {}", "public function list_id()\n\t{\n\t\treturn $this->list;\n\t}", "public function main() {\n return $this->id;\n }", "public function main() {\n return $this->id;\n }", "public function setWishlistItemId(int $id);", "function get_the_ID()\n {\n }", "public function id()\n\t{\n\t\treturn $this->SqueezePlyrID ;\n\t}", "function the_ID()\n {\n }", "public function getId()\n {\n return $this->_list->getId();\n }", "public function getID()\n {\n return $this->playlistid;\n }", "public function getWf_id()\n {\n return $this->wf_id;\n }", "public function getListingId() {\n\treturn ($this->listingId);\n}", "public function get_site_list_id() {\n $list = $this->get_site_list();\n if ( isset( $list->id ) ) {\n return $list->id;\n }\n return false;\n }", "public function getListID()\n\t{\n\t\treturn $this->get('ListID');\n\t}", "private function getCurrentWebsiteId()\n {\n return $this->storeManager->getWebsite()->getId();\n }", "public static function id()\n {\n return 1;\n }", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function get_id() {\n\t\tif ( isset( $this->item['id'] ) ) {\n\t\t\treturn esc_attr( $this->item['id'] );\n\t\t}\n\n\t\treturn false;\n\t}", "private function get_current_id() {\n\n\t\tstatic $id = null;\n\n\t\treturn $id ?: $id = \\get_queried_object_id();\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "protected function getCurrentWarehouseId()\n\t{\n\t\tstatic $warehouse = 0;\n\n\t\tif ($warehouse == 0)\n\t\t{\n\t\t\t$warehouse = -1;\n\t\t\tif ((int)Tools::getValue('warehouse'))\n\t\t\t\t$warehouse = (int)Tools::getValue('warehouse');\n\t\t\telse if ((int)$this->context->cookie->warehouse)\n\t\t\t\t$warehouse = (int)$this->context->cookie->warehouse;\n\t\t\t$this->context->cookie->warehouse = $warehouse;\n\t\t}\n\n\t\treturn $warehouse;\n\t}", "public function get_id();", "public function get_id();", "public function getShopifyId() {\n return $this->getShopifyProperty('id');\n }", "public function getOwnId()\n {\n return $this->getIfSet('ownId');\n }", "public function getId()\n\t{\n\t\treturn $this->_themeExtras['id'];\n\t}", "public function getDishId()\n {\n return $this->_dishId;\n }", "public function getGwId() {\n return $this->item->getGwId();\n }", "function nextId() {\n\t\treturn $this->honeyPotId++;\n\t}", "public static function getID() {\r\n return 1;\r\n }", "function new_main_user_id() {\n global $db;\n global $config;\n\n // sprawdz ilosc produktow w bazie\n\t$maxid=1;\n\n\t$query=\"SELECT max(id) AS maxid FROM main\";\n\t$result=$db->Query($query);\n\tif ($result!=0) {\n\t $num_rows=$db->NumberOfRows($result);\n\t if ($num_rows>0) {\t\t\n\t\t$maxid=$db->FetchResult($result,0,\"maxid\");\n\t\t$maxid++;\n\t }\n\t} else die ($db->Error());\n \n\treturn $maxid;\n }", "public function getID(): string {\n\t\treturn $this->appName;\n\t}", "public function get_site_id()\n {\n }", "public function get_site_id()\n {\n }", "public function get_listing_id() {\r\n\t\treturn absint( $this->listing_id );\r\n\t}", "public function getSiteId();", "public function getResponsibleID($current=true){\n\t\treturn parent::getResponsibleID(true);\n\t}", "public function getWebID()\n {\n return $this->webID;\n }", "function get_main_network_id()\n {\n }", "function getID();", "public function getWorkshopId(){\n return 1;\n }", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public static function getSiteId(){\n return 1;\n\n }", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "public function getBuyerId();", "public function getBuyableIdentifier()\n {\n return method_exists($this, 'getKey') ? $this->getKey() : $this->id;\n }", "function wished_num()\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== '') {\n return count(json_decode($this->get_type_name_by_id('user', $user, 'wishlist')));\n } else {\n return 0;\n }\n }", "public function getPromomessagelistId()\n {\n try {\n return $this->promomessagelistRepository->getById(\n $this->context->getRequest()->getParam('promomessagelist_id')\n )->getId();\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }", "protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }", "public function getListId();", "public function getID(): string {\n\t\treturn 'talk';\n\t}", "public function getShoptId()\n {\n return $this->getParameter('shop_id');\n }", "private function getKnightId(){\n $knightId = $this->getRequest()->getPost(\"id\") //POST?\n ?? $this->params(\"id\") //GET?\n ?? null; //no way\n return $knightId;\n }", "public function getCowId(): Uuid {\n\t\treturn (this->cowId);\n\t}", "public function getId() {\n if($this->items!==false)\n return @current($this->items)->id_str;\n return false;\n }", "public function getFriendId()\n {\n return $this->FriendId;\n }", "public function getFriendId()\n {\n return $this->FriendId;\n }", "public function getPurchasableId();", "protected function getToggleId()\n {\n $unique = md5(uniqid());\n return \"sidenav_$unique\";\n }", "abstract public function get_id();", "public function getAddonId()\n {\n return $this->addon_id;\n }", "public function getAddonId()\n {\n return $this->addon_id;\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "function getID(){ return (int)$this->productInfo['products_id']; }", "public static function getSiteId()\n {\n return get_current_blog_id();\n }", "static function id()\n\t{\n\t\treturn self::data('id');\n\t}", "public function getCowId(): Uuid {\n\t\t\treturn ($this->cowId);\n\t}", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "function wished_num()\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== '') {\n return count(json_decode($this->get_field('user', $user, 'wishlist')));\n } else {\n return 0;\n }\n }", "public static function getHolderID();", "public function get_id() {\n return str_replace('_forum_feature', '', get_class($this));\n }", "public function sanitize_list_id( $maybe_list_id = '' ) {\n if ( ! $maybe_list_id ) {\n return $this->get_site_list_id();\n }\n $lists = $this->get_lists();\n foreach ( $lists->lists as $list ) {\n if ( ! $list || ! isset( $list->id ) ) {\n continue;\n }\n if ( $maybe_list_id == $list->id || $maybe_list_id == $list->name ) {\n return $list->id;\n }\n }\n\n return $maybe_list_id;\n }", "public function getUserBreweryId () {\n\t\treturn ($this->userBreweryId);\n\t}", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "function ts_define_current_id()\r\n{\r\n\tdefine('CURRENT_ID',get_the_ID());\r\n}", "public function get_id() {\n\t\treturn self::MODULE_ID;\n\t}", "public function getID();", "public function getID();", "public function getID();", "function DemSoSPYeuThich($idUser){\n\t\t\t\t$sql=\"SELECT count(*) FROM wishlist WHERE idUser=$idUser\";\n\t\t\t\t$kq=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$row_kq=mysql_fetch_row($kq);\n\t\t\t\treturn $row_kq[0];\n\t\t\t}", "public function getUseAppID() \n \t{\n \t\treturn $this->use_appid;\n \t}", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}", "public function getForeignId()\r\n {\r\n return $this->getWebsiteId();\r\n }", "public function getCurrentBlogId()\n {\n return $this->wpDatabase->blogid;\n }", "public function getQuoteId();", "public static function getActualId()\n {\n if (self::$context->getName() == 'citation'\n && self::getCitationItem()!== false) {\n return self::getCitationItem()->get('id');\n }\n\n return self::getData()->getVariable('id');\n }", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "public function getBuyerId()\n {\n return $this->buyer_id;\n }" ]
[ "0.7615724", "0.70116913", "0.6946382", "0.63400537", "0.61921054", "0.6171307", "0.61290824", "0.61071986", "0.60699147", "0.60571253", "0.6051647", "0.6051647", "0.60209024", "0.59611905", "0.5953613", "0.583613", "0.5831006", "0.5811685", "0.57815576", "0.5772033", "0.5762415", "0.5748301", "0.57382935", "0.57086587", "0.5707365", "0.5705598", "0.5701108", "0.5681383", "0.5681383", "0.56457585", "0.5640222", "0.5640222", "0.56144327", "0.5613268", "0.5609245", "0.5600681", "0.5584075", "0.55737996", "0.5569322", "0.55669594", "0.5565541", "0.5565208", "0.5565208", "0.55625856", "0.5559396", "0.55447626", "0.5535749", "0.55295515", "0.55276513", "0.55257845", "0.5525014", "0.5525014", "0.5525014", "0.5519987", "0.5505225", "0.5503279", "0.54972106", "0.5486026", "0.5480225", "0.5476646", "0.5475975", "0.5467731", "0.5458102", "0.5456726", "0.5451709", "0.5450694", "0.54488313", "0.54488313", "0.5448735", "0.54471886", "0.54446214", "0.5439717", "0.5439717", "0.543757", "0.5437145", "0.54363096", "0.54317594", "0.54315287", "0.5430751", "0.54245996", "0.5423174", "0.54204524", "0.54193234", "0.54050326", "0.5401966", "0.5401902", "0.5393678", "0.5391983", "0.5391983", "0.5391983", "0.539159", "0.5389151", "0.5385697", "0.5378878", "0.53780353", "0.537248", "0.5364875", "0.5363942", "0.5361271", "0.53606147" ]
0.8193934
0
Set main wishlist id
public function setWishlistId(int $id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWishlistId();", "public function setWishlistItemId(int $id);", "public function setMultipleWishlistId($id);", "private function _setListId()\r\n { \r\n if (Mage::getSingleton('admin/session')->isLoggedIn()) {\r\n $storeId = Mage::app()->getRequest()->getParam('store_id');\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId', $storeId); \r\n } else {\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId');\r\n }\r\n }", "function set_list_id($list_id) {\n $this->_subscribers_base_route = $this->_base_route.'subscribers/'.$list_id;\n }", "public function getMultipleWishlistId();", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "public function getWishlistItemId();", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "function setSwimMeetId($id)\r\n {\r\n $this->_swimmeetid = $id ;\r\n }", "function set_accordion_id() {\n\t\t\t$this->current_accordion_slug++;\n\t\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "public function setWinnerIdAttribute($input)\n {\n $this->attributes['winner_id'] = $input ? $input : null;\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "public function updateId() {\n $this->Id = session_id();\n }", "protected function setMemberDefaults(){\n parent::setMemberDefaults();\n if(!$this->id) $this->id = UniqId::get(\"faq-\");\n }", "private function updateWishlistId(int $wishlistId, int $quantity)\r\n {\r\n $wishlistItem = Wishlist::find($wishlistId);\r\n $wishlistItem->quantity = $quantity;\r\n $wishlistItem->save();\r\n }", "function SetId($value) { $this->id=$value; }", "public abstract function get_default_list_id();", "public function setId($id)\r\n {\r\n $this->data['itemid'] = (int) $id;\r\n }", "public function changeShelfWish($id){\n $library = Library::find(Auth::user()->library->id);\n $do = ['do'=> 0];\n $library->books()->attach($id, $do);\n return redirect('/library/showWishList');\n }", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }", "function as_action_init_wish_list() {\n global $wpdb;\n $page_found = $wpdb->get_var(\"SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_name` = 'wishlist' LIMIT 1;\");\n if ($page_found) {\n update_option('as-wishlist-page-id', $page_found);\n return;\n }\n\n $page_data = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_author' => 1,\n 'post_name' => esc_sql(_x('wishlist', 'page_slug', 'as')),\n 'post_title' => __('Wishlist', 'as'),\n 'post_content' => '[as_wish_list]',\n 'post_parent' => 0,\n 'comment_status' => 'closed'\n );\n $page_id = wp_insert_post($page_data);\n update_option('as-wishlist-page-id', $page_id);\n}", "public function wishlist($action = null, $id = null) {\n $company_id = $this->Session->read('CompanyLoggedIn.Company.id');\n\n // verifica se vai cadastrar uma oferta especifica para usuario\n if ($action == 'offer_user') {\n $this->Session->write('CadOfferUser.id_linha_wishlist', $id);\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n\n // verifica post e se vai inserir uma oferta especifica p/ usuario\n if ($this->request->is('post')) {\n\n if ($this->request->data ['excluir_wishlist'] == true) {\n $render = true;\n $this->layout = '';\n\n // faz update de wishlist para excluir desejo\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'INACTIVE'\n )\n );\n\n $desejosDel = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if (!$desejosDel ['status'] == 'SAVE_OK') {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else if ($this->request->data ['id_oferta'] > 0) {\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'ACTIVE',\n 'offer_id' => $this->request->data ['id_oferta']\n )\n );\n\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n } else {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else {\n $mensagem = \"Voce nao selecinou nenhuma oferta para este desejo. Tente novamente\";\n }\n }\n\n $limit = 6;\n $update = true;\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n )\n )\n );\n $contador = $this->Utility->urlRequestToGetData('companies', 'count', $params);\n\n // verifica se esta fazendo uma requisicao ajax\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 2;\n if ($limit >= $contador) {\n $limit = $contador;\n $update = false;\n }\n }\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n ),\n 'limit' => $limit\n ),\n 'User',\n 'UsersWishlist',\n 'CompaniesCategory'\n );\n $desejos = $this->Utility->urlRequestToGetData('companies', 'all', $params);\n\n // pegando ofertas de empresa\n $params = array(\n 'Offer' => array(\n 'fields' => array(\n 'Offer.id',\n 'Offer.title'\n ),\n 'conditions' => array(\n 'Offer.company_id' => $company_id,\n 'Offer.status' => 'ACTIVE'\n ),\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $ofertas = $this->Utility->urlRequestToGetData('offers', 'all', $params);\n\n $this->set(compact('ofertas', 'desejos', 'limit', 'contador', 'update', 'mensagem'));\n\n if (!empty($render))\n $this->render('Elements/ajax_desejos');\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "function ts_define_current_id()\r\n{\r\n\tdefine('CURRENT_ID',get_the_ID());\r\n}", "public function setId($id)\n\t{\n\t\t$this->_themeExtras['id'] = $id;\n\t}", "public function setclient_id($value);", "public function set_id(int $_id){\n $this->_id = $_id;\n\n return $this;\n }", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "function setMetafieldWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products !== null or $products !== \"\") {\n $wishlist->setProductIds($productIds);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productIds);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if($value !== \"null\") {\n $productIds .= ',' . $value;\n }\n }\n } else {\n if($wishlistDecoded['metafields'][0]['value'] === \"null\") {\n $productIds = $productId;\n } else {\n $productIds = $wishlistDecoded['metafields'][0]['value'] .',' . $productId;\n }\n\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n } else {\n $data = [\n \"metafield\" => [\n \"namespace\" => \"wishlist\",\n \"key\" => \"wishlist-products\",\n \"value\" => '' . $productId . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . 'customers/'.$customerId.'/metafields.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n return new Response('wishlist saved');\n }", "public function setUseAppID($use_appid) \n \t{\n \t\t$this->use_appid = $use_appid;\n \t}", "public function setShoeID($value) {\n\t\t$this->_shoe_id = $value;\n\t}", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "function setId($value) {\n $this->_id = intval($value);\n }", "public function setId($_id);", "function setId($id) {\r\n $this->_id = $id;\r\n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function setId($id)\n\t{\n\t\tparent::setId($id);\n\t\t$params = $this->getParams();\n\n\t\t// Set elementlist params from picklist params\n\t\t$params->set('allow_frontend_addto', (bool) $params->get('allowadd', false));\n\t}", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "public function set_id($_id){\n $this->_id = $_id;\n\n return $this;\n }", "function setSiteId($value)\n {\n $this->_props['SiteId'] = $value;\n }", "public function setId($id){\n $this->_id = $id;\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function setId($x) { $this->id = $x; }", "public function setMaconomyId(string $key): void\n {\n $this->data['instancekeyField'] = $key;\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "public function __construct() {\n\t\tparent::__construct(\n\t\t\t'vi_wishlist_widget', // Base ID\n\t\t\t'VI Woocommerce Wishlist', // Name\n\t\t\tarray( 'description' => __( 'Wishlist Woocommerce', 'wishlist-for-woo' ), ) // Args\n\t\t);\n\t}", "public function wishlist_toggle()\n\t{\n\t\t// no return needed as page is reloaded\n\t\t$this->EE->job_wishlists->wishlist_toggle();\t\t\n\t}", "public function setNameAndId() {}", "function set_id ($id)\r\n {\r\n $_SESSION[\"id\"] = $id;\r\n }", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId($workerId)\n\t{\n\t\t$this->id = $workerId;\n\t}", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "function addCategory($object) {\n $object->Item->ShopId = 'yourReturnedCategoryIdOnMarketplace_'.rand(1000, 9999); \n}", "public function setContribuyenteId($data)\n {\n\n if ($this->_contribuyenteId != $data) {\n $this->_logChange('contribuyenteId');\n }\n\n if ($data instanceof \\Zend_Db_Expr) {\n $this->_contribuyenteId = $data;\n } else if (!is_null($data)) {\n $this->_contribuyenteId = (int) $data;\n } else {\n $this->_contribuyenteId = $data;\n }\n return $this;\n }", "public function refreshListingId()\n {\n $this->listing_id = 'SL'.str_pad($this->id, 6, '0', STR_PAD_LEFT);\n\n return $this;\n }", "public function getWishlistOwnerWebsiteId($wishlist)\n {\n $customerId = $wishlist->getCustomerId();\n if ($customerId) {\n /** @var Mage_Customer_Model_Customer $owner */\n $owner = Mage::getModel(\"customer/customer\");\n $owner->load($customerId);\n if ($owner->getId()) {\n return $owner->getWebsiteId();\n }\n }\n\n return null;\n }", "public function set_tyk_id($id) {\n\t\tupdate_user_meta($this->user->ID, self::META_TYK_USER_ID_KEY, $id);\n\t}", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "private function set_site_id()\n {\n $this->arrPayload['siteId'] = WpCxense::instance()->settings->getSiteId();\n return $this;\n }", "protected function _construct()\n {\n $this->_init('cminds_multiwishlist/item', 'wishlist_item_id');\n }", "public function editAction() {\r\n\r\n //SET LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //ONLY LOGGED IN USER CAN CREATE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET WISHLIST ID AND CHECK VALIDATION\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n if (empty($wishlist_id)) {\r\n return $this->_forward('notfound', 'error', 'core');\r\n }\r\n\r\n //GET WISHLIST OBJECT\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n $level_id = $viewer->level_id;\r\n\r\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Edit();\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n\r\n //PRIVACY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n $perms = array();\r\n foreach ($roles as $roleString) {\r\n $role = $roleString;\r\n if ($auth->isAllowed($wishlist, $role, 'view')) {\r\n $perms['auth_view'] = $roleString;\r\n }\r\n }\r\n\r\n $form->populate($wishlist->toArray());\r\n $form->populate($perms);\r\n return;\r\n }\r\n\r\n //FORM VALIDATION\r\n if (!$form->isValid($this->getRequest()->getPost())) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getItemTable('sitestoreproduct_wishlist')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n\r\n //SAVE DATA\r\n $wishlist->setFromArray($values);\r\n $wishlist->save();\r\n\r\n //PRIVACTY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n\r\n if (empty($values['auth_view'])) {\r\n $values['auth_view'] = array('everyone');\r\n }\r\n\r\n $viewMax = array_search($values['auth_view'], $roles);\r\n foreach ($roles as $i => $role) {\r\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //GET URL\r\n $url = $this->_helper->url->url(array('wishlist_id' => $wishlist->wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\", true);\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'smoothboxClose' => 10,\r\n 'parentRedirect' => $url,\r\n 'parentRedirectTime' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your wishlist has been edited successfully.'))\r\n ));\r\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "private function set_id(int $id)\n {\n $this->_id = $id;\n }", "private function settleId($str)\n\t{\n\t\tif (! $this->setId($str) && ! $this->setId($_COOKIE[$this->name]))\n\t\t\t$this->mkNew();\n\t}", "public static function setCurrentID($id) {\n Session::put(Privilege::SESSION_NAME_ID, $id);\n }", "function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }", "public function set_current_user_id($id)\n {\n $this->current_user_id = $id;\n }", "public function set_id(Int $_id){\n $this->_id = $_id;\n\n return $this;\n }", "private function initializeWidgetIdentifier() {}", "function SetItemcommentid($value) { $this->itemCommentId=$value; }", "public function setId()\n {\n $apiKey = new ApiKey;\n $apiKey->setId();\n $this->id = $apiKey->getId();\n }", "private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}", "function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}", "public function set_id($id){\n $this->id = $id;\n }", "function wp_set_current_user($id, $name = '')\n {\n }", "function setId($id) {\r\n\t\t// Set item id and wipe data\r\n\t\t$this->_id\t = $id;\r\n\t\t$this->_item\t\t= null;\r\n\t}", "function add_wishlist($_id_member,$_id_product,$_id_source)\n\t\t{\n\t\t\t//must make a rule to get different product detail depend on id_source\n\t\t\t\n\t\t\t$_id_member_session = $this->CI->session->userdata('id_member');\n\t\t\t//Must relate with model wishlist return must an integer\n\t\t\t$_wishlist_already_added = $this->CI->model_product->is_added_stuff($_id_product,$_id_member);\n\t\t\t/*if(!$_wishlist_already_added)\n\t\t\t{\n\t\t\t\t$this->model_zhout->update_wishlist_status($_id_product);\n\t\t\t\t$this->model_wishlist->insert_wishlist($_id_member,$_id_product);\n\t\t\t\t$data['message'] = ''\n\t\t\t\treturn \n\t\t\t}*/\n\t\t}", "public function editAction() {\n\n //ONLY LOGGED IN USER CAN CREATE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n\n $wishlist_id = $this->_getParam('wishlist_id');\n if (isset($wishlist_id) && !empty($wishlist_id)) {\n $subject = $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n Engine_Api::_()->core()->setSubject($wishlist);\n } else {\n $this->respondWithError('no_record');\n }\n\n //GET VIEWER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $level_id = $viewer->level_id;\n\n\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\n $this->respondWithError('unauthorized');\n }\n //GET USER DIARIES\n $wishlistTable = Engine_Api::_()->getDbtable('wishlists', 'sitereview');\n $wishlistDatas = $wishlistTable->userWishlists($viewer);\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $perms = array();\n foreach ($roles as $roleString) {\n $role = $roleString;\n if ($auth->isAllowed($wishlist, $role, 'view')) {\n $perms['auth_view'] = $roleString;\n }\n }\n //FORM GENERATION\n if ($this->getRequest()->isGet()) {\n $formValues = $wishlist->toArray();\n $formValues = array_merge($formValues, $perms);\n\n if (isset($formValues['body']) && !empty($formValues['body']))\n $formValues['body'] = strip_tags($formValues['body']);\n\n\n $this->respondWithSuccess(array(\n 'form' => Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm(),\n 'formValues' => $formValues\n ));\n }\n\n //FORM VALIDATION\n else if ($this->getRequest()->isPut() || $this->getRequest()->isPost()) {\n\n $db = Engine_Api::_()->getItemTable('sitereview_listing')->getAdapter();\n $db->beginTransaction();\n try {\n $values = array();\n $getForm = Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm();\n foreach ($getForm as $element) {\n\n if (isset($_REQUEST[$element['name']]))\n $values[$element['name']] = $_REQUEST[$element['name']];\n }\n if (empty($values['title'])) {\n $validationMessage = \"title is required\";\n $this->respondWithValidationError('validation_fail', $validationMessage);\n }\n\n $wishlist->setFromArray($values)->save();\n $db->commit();\n\n //PRIVACTY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = 'owner';\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n foreach ($roles as $i => $role) {\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\n }\n $db->commit();\n // Change request method POST to GET\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }", "public function set_elem_id(int $elem_id){\n\t\t$this->elem_id = $elem_id;\n\t}", "protected function setListIndexKey(): void\n {\n $this->listIndexKey = $this->index . (empty($this->indexType)\n ? self::LIST_INDEX_GLUE\n : (self::LIST_INDEX_GLUE . $this->indexType . self::LIST_INDEX_GLUE));\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "public function set_id($id) {\n $this->_newid = preg_replace(\"/[^a-zA-Z0-9]/\", '', $id);\n }", "function set_current_list_name ($list_name)\r\n {\r\n $_SESSION[\"current_list_name\"] = $list_name;\r\n }", "public function setPageID(){/*ACTUALLY NOT DEFINED*/}", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "function displayWishLists()\n{\n $customerId = 1;\n $wishlists = wishlistsDB::getWishlistsByCustomer($customerId);\n foreach ($wishlists as $wishlist) {\n $wid= $wishlist->getWishlistId();\n\n $wname = $wishlist->getWishlistName();\n\n echo \"<div id='wishlistName'>\";\n echo $wname;\n echo \"</div>\";\n echo \"<input type='submit' class='btn btn-default' value='Add to Wishlist' name='pushToList' id='pushToList' onclick=\\\"addtoList('$wid');\\\" />\";\n echo \"<br/><br/>\";\n }\n echo \"<input type='submit' name='newWishlist' class='btn btn-default' value='Create new Wishlist' onclick=\\\"newList();\\\"/>\";\n\n}", "function dokan_add_to_wishlist_link() {\n if ( class_exists( 'YITH_WCWL' ) ) {\n global $yith_wcwl, $product;\n\n printf( '<a href=\"%s\" class=\"btn fav add_to_wishlist\" data-product-id=\"%d\" data-product-type=\"\"><i class=\"fa fa-heart\"></i></a>', $yith_wcwl->get_addtowishlist_url(), $product->id );\n }\n}", "public function setLoginId(): void\n {\n }", "public function setID($id){\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "protected function defineNameId(){\n list($name,$id)=$this->resolveNameID();\n $this->_id=$this->htmlOptions['id']=$id;\n\t\t$this->_name=$this->htmlOptions['name']=$name;\n }" ]
[ "0.6935961", "0.6884278", "0.6682281", "0.6210829", "0.6176749", "0.6093338", "0.60390955", "0.5821634", "0.5596987", "0.55709", "0.55291283", "0.5509235", "0.5501592", "0.5496938", "0.5459576", "0.5439535", "0.5438677", "0.5411628", "0.5402319", "0.53761107", "0.5364364", "0.5356607", "0.53529274", "0.5334961", "0.53243995", "0.532174", "0.532174", "0.53188396", "0.5318737", "0.5306891", "0.5305348", "0.5275475", "0.5265977", "0.5250706", "0.5233397", "0.5231667", "0.52268296", "0.5218351", "0.5208651", "0.52077067", "0.5175607", "0.51749754", "0.5171843", "0.5171073", "0.5170242", "0.5158478", "0.51463205", "0.514287", "0.5142402", "0.51345813", "0.5133363", "0.51220936", "0.51156294", "0.5105466", "0.50957817", "0.5093282", "0.5090834", "0.50893825", "0.50781375", "0.507789", "0.50762635", "0.507311", "0.50655806", "0.5064629", "0.50613856", "0.5058217", "0.50541735", "0.5040776", "0.5035978", "0.50321007", "0.50300753", "0.50245535", "0.50226724", "0.5022166", "0.50118047", "0.50032943", "0.49954852", "0.49947044", "0.49893224", "0.49888837", "0.49881843", "0.4985776", "0.4980872", "0.49760723", "0.49740788", "0.49729082", "0.49695343", "0.49695343", "0.4969492", "0.49664328", "0.49562147", "0.49533653", "0.4944689", "0.49429938", "0.49187732", "0.49177825", "0.49167576", "0.49112618", "0.49096677", "0.49067858" ]
0.72476196
0
Returns multiple wishlist id
public function getMultipleWishlistId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWishlistId();", "public function getWishlistItemId();", "public function setMultipleWishlistId($id);", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "public function setWishlistId(int $id);", "public function getListId();", "public function get($id) {\n $wishList = WishList::where(\"users_id\",$id)->with(\"product\")->get();\n return $wishList;\n }", "function getWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n\n if ($wishlist) {\n $result = $wishlist->getProductIds();\n } else {\n $result = null;\n }\n\n return new Response($result);\n }", "public function setWishlistItemId(int $id);", "function count_wishlist() {\n $total_items = 0;\n if (is_array($this->wishID)) {\n reset($this->wishID);\n while (list($wishlist_id, ) = each($this->wishID)) {\n $total_items++;\n }\n }\n\n return $total_items;\n }", "public function index($wishlistid)\n {\n $wish['wishlistid'] = $wishlistid;\n\n $validation = Validator::make($wish,[\n 'wishlistid'=>'exists:wishes,wishlistid',\n ]);\n\n if($validation->fails())\n {\n $failedRules = $validation->failed();\n $field = '';\n\n if(isset($failedRules['wishlistid']['Exists']))\n {\n $message = 'Wishlist id not found.';\n $field = 'wishlistid';\n }\n\n return response()->json(['status'=>'400','message'=>$message,'field'=>$field]);\n }\n else\n {\n $wishes = $this->wish->getWishesByWishlistId($wishlistid);\n $userid = $this->wishlist->getCreatedById($wishlistid);\n\n $getFavoriteBookmarkForStream = $this->favoritebookmark->getFavoriteBookmarkForStream($userid);\n foreach($wishes as $w)\n {\n $w->favorited = '0';\n $w->bookmarked = '0';\n foreach($getFavoriteBookmarkForStream as $gfbfs)\n {\n if($w->id == $gfbfs['wishid'])\n {\n if($gfbfs['type'] == '2')\n {\n $w->favorited = '1';\n }\n if($gfbfs['type'] == '1')\n {\n $w->bookmarked = '1';\n }\n }\n }\n $w->favoritecount = $this->favoritebookmark->countFavoriteBookmark($w->id, '2');\n $w->bookmarkcount = $this->favoritebookmark->countFavoriteBookmark($w->id, '1');\n }\n\n return response()->json(['status'=>'200','message'=>'Ok','wishes'=>$wishes]);\n }\n }", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "public static function getGatewayListID(){\n $row = Gateway::where(array('Status'=>1))->lists('Title', 'GatewayID');\n if(!empty($row)){\n $row = array(\"\"=> \"Select a Gateway\")+$row;\n }\n return $row;\n }", "public abstract static function getListID();", "public function listId() {\n\t\treturn $this->academic_session->all()->pluck('id')->all();\n\t}", "public static function winnersIds()\n {\n return DB::table('competitionentries')->where('winner', '=', 1)->get();\n }", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "public function getWishlist()\n {\n// 'cust_id' => 'required',\n// ]);\n//\n// if ($validator->fails()) {\n// return response()->json(array('status' => false, 'message' => $validator->messages()), 500);\n// }\n try{\n\n $wishlist = Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n\n if(count($wishlist) > 0){\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$wishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n return response()->json(array('status' => true,'wishlist' => $products), 200);\n }else{\n return response()->json(array('status' => false,'message' => 'no wishlist found.'), 200);\n }\n }catch (\\Exception $e){\n return response()->json(array('error'=>'something went wrong','message'=> $e->getMessage()));\n }\n\n\n }", "public function getproductsunderwishlist($wishlist_id)\n\t{\n $ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, API_BASE .\"/wishlist/\".$wishlist_id);\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t 'Authorization: Basic ' . $this->session->userdata('auth') ));\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = json_decode( $content );\n\n\t\treturn ( $response );\n\t}", "public function addWishlist($id){\n if (Auth::check()) {\n if (Wishlist::where('product_id',$id)->where('user_id',Auth::id())->exists()) {\n return response()->json([\n 'error' => \"This Product Already Add Wishlist\",\n ]);\n }\n else {\n Wishlist::insert([\n 'user_id' => Auth::id(),\n 'product_id' => $id,\n 'created_at' => Carbon::now()\n ]);\n return response()->json([\n 'success' => \"Add Wishlist Successfully\"\n ]);\n }\n }\n else {\n return response()->json([\n 'error' => \"Please Login First\"\n ]);\n }\n }", "function displayWishLists()\n{\n $customerId = 1;\n $wishlists = wishlistsDB::getWishlistsByCustomer($customerId);\n foreach ($wishlists as $wishlist) {\n $wid= $wishlist->getWishlistId();\n\n $wname = $wishlist->getWishlistName();\n\n echo \"<div id='wishlistName'>\";\n echo $wname;\n echo \"</div>\";\n echo \"<input type='submit' class='btn btn-default' value='Add to Wishlist' name='pushToList' id='pushToList' onclick=\\\"addtoList('$wid');\\\" />\";\n echo \"<br/><br/>\";\n }\n echo \"<input type='submit' name='newWishlist' class='btn btn-default' value='Create new Wishlist' onclick=\\\"newList();\\\"/>\";\n\n}", "public function get_user_wishlist($member_id)\n\t{\n\t\t$this->db->select('brand.brand_name, product.*, wishlist.date_added, wishlist.wishlist_id');\n\t\t$this->db->where('product.brand_id = brand.brand_id AND product.product_id = wishlist.product_id AND wishlist.member_id = '.$member_id);\n\t\t$this->db->order_by('wishlist.date_added', 'DESC');\n\t\t$query = $this->db->get('product, wishlist, brand');\n\t\t\n\t\treturn $query;\n\t}", "function wp_parse_id_list($input_list)\n {\n }", "public abstract function get_ids();", "protected function getWishlistShortList()\n {\n $wishlistData = [];\n foreach ($this->wishlistHelper->getCustomerWishlists() as $wishlist) {\n $wishlistData[] = ['id' => $wishlist->getId(), 'name' => $wishlist->getName()];\n }\n return $wishlistData;\n }", "public function list_id()\n\t{\n\t\treturn $this->list;\n\t}", "function get_warehouse_ids() {\n return array('CA', 'KY', 'TN', 'WA', 'MN', 'OR', 'TX');\n}", "function fn_wishlist_get_count()\n{\n $wishlist = array();\n $result = 0;\n\n if (!empty(Tygh::$app['session']['wishlist'])) {\n $wishlist = & Tygh::$app['session']['wishlist'];\n $result = !empty($wishlist['products']) ? count($wishlist['products']) : 0;\n }\n\n /**\n * Changes wishlist items count\n *\n * @param array $wishlist wishlist data\n * @param int $result wishlist items count\n */\n fn_set_hook('wishlist_get_count_post', $wishlist, $result);\n\n return empty($result) ? -1 : $result;\n}", "private function getWarehouseIds(): array\n {\n return [1,2];\n }", "public function wish_list_data($user_id)\r\n {\r\n \r\n /*$que = \"select w.user_id as wish_user_id,w.product_id as wish_product_id,l.status as is_like,p.* from wish_list w join products p on w.product_id=p.id join like_product l on l.product_id=p.id where w.user_id=\".$user_id.\" order by w.id desc\";*/\r\n\t\t \r\n\t\t $que = \"select w.user_id as wish_user_id,w.product_id as wish_product_id,p.* from wish_list w join products p on w.product_id=p.id where w.user_id=\".$user_id.\" order by w.id desc\";\r\n //return $this->db->$que->get()->result_array();\r\n $query = $this->db->query($que);\r\n return $query->result_array();\r\n }", "public function index($id)\n {\n $wishList = WishList::where('user_id',$id)->get();\n if ($wishList) {\n return success($wishList);\n } else {\n return error(400, 'Can not get item');\n }\n }", "function getFavoriteIDs(){\n\t$id = getUserID();\n\t$query = \"SELECT unique_network_id FROM favorites WHERE user_id = $id\";\n\t$result = mysql_query($query) or die(mysql_error());\n\t$favIDs = array();\n\twhile($row = mysql_fetch_array($result)){\n\t\t$favIDs[] = $row[0];// this is unique_network_id\n\t}\n\treturn $favIDs;\n}", "public function getIds();", "public function getIds();", "public function getItemIds();", "public function showWishList(){\n $i = 1;\n $books = Book::join('book_library', 'book_library.book_id', '=', 'books.id')\n ->join('libraries', 'book_library.library_id', '=', 'libraries.id')\n ->where('libraries.user_id', '=', Auth::user()->id)\n ->where('do', '=', 0)\n ->select('books.*')\n ->get();\n return view('library.showWishList', ['books' => $books, 'i' => $i]);\n }", "function add_wishlist($_id_member,$_id_product,$_id_source)\n\t\t{\n\t\t\t//must make a rule to get different product detail depend on id_source\n\t\t\t\n\t\t\t$_id_member_session = $this->CI->session->userdata('id_member');\n\t\t\t//Must relate with model wishlist return must an integer\n\t\t\t$_wishlist_already_added = $this->CI->model_product->is_added_stuff($_id_product,$_id_member);\n\t\t\t/*if(!$_wishlist_already_added)\n\t\t\t{\n\t\t\t\t$this->model_zhout->update_wishlist_status($_id_product);\n\t\t\t\t$this->model_wishlist->insert_wishlist($_id_member,$_id_product);\n\t\t\t\t$data['message'] = ''\n\t\t\t\treturn \n\t\t\t}*/\n\t\t}", "public function wishlist()\n {\n return $this->hasMany('App\\Wishlist', 'user_id');\n }", "public function getCheckoutIds()\n {\n if ($this->instanceOfThis->cart->hasProducts() > 0)\n {\n $cartProducts = $this->instanceOfThis->cart->getProducts();\n\n $productsArr = [];\n\n foreach ($cartProducts as $product)\n {\n $productsArr[] = $product['product_id'];\n }\n\n $productsIDs = implode(\",\", $productsArr);\n\n $this->data .= \"\n /* --- checkoutIds --- */\n _ra.checkoutIdsInfo = [\n $productsIDs\n ];\n\n if (_ra.ready !== undefined) {\n _ra.checkoutIds(_ra.checkoutIdsInfo);\n };\n \";\n\n return $this->data;\n }\n }", "public function all() {\n $wishList = WishList::with([\"product\",\"user:id,name\"])->get();\n return $wishList;\n }", "public function products_id()\n {\n foreach ($_SESSION['cart'] as $id => $quaty){\n $product_id[] = \"($id, $quaty)\";\n $product = Data::find_by_id($id);\n $id = array('id' => 'No: '. $product->id, 'name' => ' '. $product->name, 'price' => ' €'.$product->price, 'quaty' => ' qty '.$quaty, 'cost' => ' = €'.$product->price * $quaty .'</br>');\n foreach ($id as $key => $value){\n echo /*$key .' = '.*/ $value; /*echo \", \"; &nbsp; = spatie*/\n }\n }\n // $insert_id = implode(',', $product_id);\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function getSimilarRecommListIds()\n {\n if ($this->_aSimilarRecommListIds === null) {\n $this->_aSimilarRecommListIds = false;\n\n if ($oProduct = $this->getProduct()) {\n $this->_aSimilarRecommListIds = array($oProduct->getId());\n }\n }\n\n return $this->_aSimilarRecommListIds;\n }", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "public function listId()\n {\n return $this->contractor->all()->pluck('id')->all();\n }", "public function getIds()\n {\n\n }", "function removeWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n $wishlistExploded = explode(',', $wishlist->getProductIds());\n $productIds = [];\n foreach ($wishlistExploded as $product) {\n if($product !== $productId) {\n $productIds[] = $product;\n }\n }\n $wishlistImploded = implode(',', $productIds);\n $wishlist->setProductIds($wishlistImploded);\n $em->flush();\n\n return new Response('product removed from the wishlist');\n }", "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 get_wishlist($customer_id)\n\t{\n\t\t$query = \"SELECT * FROM tbl_wishlist WHERE customerId = '$customer_id' order by id desc\";\n\t\t$result = $this->db->select($query);\n\t\treturn $result;\n\t}", "public function wishlistAdd($requestParams,$wishlist,$productId){\n $response = array();\n if (! $productId) {\n /**\n * Set product not fount error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Product Not Found' );\n } else {\n /**\n * Get product collection\n * @var $product\n */\n $product = Mage::getModel ( 'catalog/product' )->load ( $productId );\n if (! $product->getId () || ! $product->isVisibleInCatalog ()) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Cannot specify product.' );\n } else {\n try {\n /**\n * Get parameters.\n */\n $buyRequest = new Varien_Object ( $requestParams );\n /**\n * Whislist add new product.\n */\n $result = $wishlist->addNewItem ( $product, $buyRequest );\n if (is_string ( $result )) {\n Mage::throwException ( $result );\n }\n $wishlist->save ();\n Mage::dispatchEvent ( 'wishlist_add_product', array (\n 'wishlist' => $wishlist,\n 'product' => $product,\n 'item' => $result\n ) );\n /**\n * Set success message.\n */\n Mage::helper ( 'wishlist' )->calculate ();\n $message = $product->getName ().' has been added to your wishlist.';\n $response ['status'] = 'SUCCESS';\n $response ['message'] = $message;\n /**\n * Unset registry.\n */\n Mage::unregister ( 'wishlist' );\n return $response;\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'An error occurred while adding item to wishlist: %s', $e->getMessage () );\n return $response;\n }\n }\n }\n }", "function getByUserID($user_id) {\n return $this->find('list', array(\n 'conditions' => array(\n 'Wishlist.user_id' => $user_id\n ),\n 'fields' => array(\n 'Wishlist.product_entity_id'\n )\n ));\n }", "function kids(){\r\n\t\t// check if we need to generate the list\r\n\t\tif( $this->kids == null ){\r\n\t\t\t$this->kids = rsgGalleryManager::getList( $this->get('id') );\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->kids;\r\n\t}", "function getUserIds() {\n\t\t$charIds = $this->getCharIds();\n\t\t$idsToReturn = array();\n\t\tforeach ($charIds as $id) {\n\t\t\n\t\t\t$idsToReturn[] = getOneThing(\"playedby\", \"gamestate_characters\", \"id=$id and gameid=$this->gameId\");\n\t\t\n\t\t}\n\t\tdbug(\"getUserIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}", "public function getLoveId($loveArray=null,$key=\"item_id\"){\n if($loveArray !=null ){\n $list_id=array_map(function($value) use($key){\n return $value[$key];\n },$loveArray);\n return $list_id;\n }\n }", "public function getListID()\n\t{\n\t\treturn $this->get('ListID');\n\t}", "function getUserInterests($u)\n{\n $ids = $u['interests'];\n $ids = explode(',', $ids);\n //var_dump($ids);\n $u['interests'] = $ids;\n $_SESSION['usr'] = $u;\n //$sql = \"SELECT name FROM interests WHERE ID IN ($ids)\";\n //$result = mysql_query($sql, $c);\n //var_dump($result);\n}", "public function listIdOfListStaffId($listStaffId)\n {\n return QcCompanyStaffWork::whereIn('staff_id', $listStaffId)->pluck('work_id');\n }", "public function utilityIds()\n {\n $this->attributes['utilityIds'] = $this->utilities->pluck('id');\n }", "private function myQid(){\r\n\t\t$this->db->where('uid', $this->uid);\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->from('wen_answer');\r\n\t\t$tmp = $this->db->get()->result_array();\r\n\t\t$return = array();\r\n\t\tforeach($tmp as $r){\r\n\t\t\t$return[$r['id']] = 1;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function getAllIds();", "public function getSimilarIds()\n {\n return $this->similar_ids;\n }", "public function getDefaultWishList()\r\n {\r\n return array(\"hotmail\" => \"Live/Hotmail\", \"yahoo\" => \"Yahoo\",\"gmail\" => \"Gmail\");\r\n }", "public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }", "static function publishable_ids()\r\n {\r\n $xrate = current(current(WEBPAGE::$dbh->getAll(sprintf\r\n (\r\n \"select rate from tblCurrenciesExchangeRates where date = '%s' and currency_id = %s\", \r\n date('Y-m-d'),WEBPAGE::$conf['app']['xrate_local']))));\r\n $margin = $xrate * WEBPAGE::$conf['mod_sponsorship']['min_donation'];\r\n return WEBPAGE::$dbh->getAssoc(sprintf\r\n (\r\n \"select distinct\r\n lm.id, 1 + %s - datediff(curdate(),ckd.date) time_left,\r\n coalesce(rc.donations,0.00) donations,\r\n br.borrowers borrowers,\r\n lm.amount - coalesce(rc.donations,0.00) pending\r\n from\r\n (\r\n tblLoansMaster lm,\r\n (\r\n select\r\n lmd.master_id, lsh.date\r\n from\r\n tblLoanStatusHistory lsh,\r\n tblLoansMasterDetails lmd\r\n where\r\n lmd.loan_id = lsh.loan_id and\r\n lsh.status = 'G' and\r\n lsh.date < CURDATE() and\r\n lsh.date >= DATE_ADD(CURDATE(), INTERVAL -%s DAY)\r\n ) ckd\r\n )\r\n left join\r\n (\r\n select master_id,sum(donation) donations from tblLoansMasterSponsors group by master_id\r\n ) rc on rc.master_id = lm.id\r\n left join\r\n (\r\n select master_id,count(loan_id) borrowers from tblLoansMasterDetails lmd group by master_id\r\n ) br on br.master_id = lm.id\r\n where\r\n lm.borrower_type = 'B' and\r\n lm.check_status = 'R' and\r\n ckd.master_id = lm.id and\r\n br.borrowers >= %s and\r\n br.borrowers <= %s and\r\n coalesce(rc.donations,0.00) < lm.amount - %s\r\n order by\r\n lm.id\",\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_min_borrowers'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_max_borrowers'],\r\n $margin)\r\n );\r\n }", "protected function createWishlist(array $params, int $wishlistId)\n {\n $multipleWishlist = $this->multipleWishlistFactory->create();\n $multipleWishlist->setWishlistId($wishlistId);\n $multipleWishlist->setName($params['name']);\n $multipleWishlist->setSharingCode($this->mathRandom->getUniqueHash());\n\n try {\n $this->multipleWishlistRepository->save($multipleWishlist);\n } catch (CouldNotSaveException $e) {\n $this->logger->error($e->getMessage());\n return false;\n }\n\n return true;\n }", "public function getWishlist(){\n\t\t$wishlists = \\App\\Wishlist::where('user_id', '=', \\Auth::id())->orderBy('id', 'DESC')->get();\n\t\t$circles = \\App\\Circle::where('circle_email', '=', \\Auth::user()->email)->orderBy('id', 'DESC')->get();\n\t\treturn view('wishlist.home')\n\t\t\t->with('circles', $circles)\n\t\t\t->with('wishlists', $wishlists);\n\t}", "public abstract function get_default_list_id();", "public function wishlist()\n {\n $favoriteProducts = auth()->user()->favorites()->latest()->paginate();\n\n return view('users.wishlist', get_defined_vars());\n }", "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "public function wishlists()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\Wishlists','sp_id','sp_id');\n }", "public function get_user_wishlist($customer_id)\n\t{\n\t\t$this->db->select('brand.brand_name, product.*, wishlist.date_added, wishlist.wishlist_id');\n\t\t$this->db->where('product.brand_id = brand.brand_id AND product.product_id = wishlist.product_id AND wishlist.customer_id = '.$customer_id);\n\t\t$this->db->order_by('wishlist.date_added', 'DESC');\n\t\t$query = $this->db->get('product, wishlist, brand');\n\t\t\n\t\treturn $query;\n\t}", "public function warehouses_ids_related_to_the_current_user(){\r\n $loc = $this->aauth->get_user()->loc;\r\n $this->db->select(' id ');\r\n $this->db->from('geopos_warehouse');\r\n $this->db->where('loc', $loc);\r\n $query = $this->db->get();\r\n return $query->result_array();\r\n }", "function setMetafieldWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products !== null or $products !== \"\") {\n $wishlist->setProductIds($productIds);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productIds);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if($value !== \"null\") {\n $productIds .= ',' . $value;\n }\n }\n } else {\n if($wishlistDecoded['metafields'][0]['value'] === \"null\") {\n $productIds = $productId;\n } else {\n $productIds = $wishlistDecoded['metafields'][0]['value'] .',' . $productId;\n }\n\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n } else {\n $data = [\n \"metafield\" => [\n \"namespace\" => \"wishlist\",\n \"key\" => \"wishlist-products\",\n \"value\" => '' . $productId . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . 'customers/'.$customerId.'/metafields.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n return new Response('wishlist saved');\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function getTipidList(){\n return $this->_get(3);\n }", "public function wishlist($action = null, $id = null) {\n $company_id = $this->Session->read('CompanyLoggedIn.Company.id');\n\n // verifica se vai cadastrar uma oferta especifica para usuario\n if ($action == 'offer_user') {\n $this->Session->write('CadOfferUser.id_linha_wishlist', $id);\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n\n // verifica post e se vai inserir uma oferta especifica p/ usuario\n if ($this->request->is('post')) {\n\n if ($this->request->data ['excluir_wishlist'] == true) {\n $render = true;\n $this->layout = '';\n\n // faz update de wishlist para excluir desejo\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'INACTIVE'\n )\n );\n\n $desejosDel = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if (!$desejosDel ['status'] == 'SAVE_OK') {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else if ($this->request->data ['id_oferta'] > 0) {\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'ACTIVE',\n 'offer_id' => $this->request->data ['id_oferta']\n )\n );\n\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n } else {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else {\n $mensagem = \"Voce nao selecinou nenhuma oferta para este desejo. Tente novamente\";\n }\n }\n\n $limit = 6;\n $update = true;\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n )\n )\n );\n $contador = $this->Utility->urlRequestToGetData('companies', 'count', $params);\n\n // verifica se esta fazendo uma requisicao ajax\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 2;\n if ($limit >= $contador) {\n $limit = $contador;\n $update = false;\n }\n }\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n ),\n 'limit' => $limit\n ),\n 'User',\n 'UsersWishlist',\n 'CompaniesCategory'\n );\n $desejos = $this->Utility->urlRequestToGetData('companies', 'all', $params);\n\n // pegando ofertas de empresa\n $params = array(\n 'Offer' => array(\n 'fields' => array(\n 'Offer.id',\n 'Offer.title'\n ),\n 'conditions' => array(\n 'Offer.company_id' => $company_id,\n 'Offer.status' => 'ACTIVE'\n ),\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $ofertas = $this->Utility->urlRequestToGetData('offers', 'all', $params);\n\n $this->set(compact('ofertas', 'desejos', 'limit', 'contador', 'update', 'mensagem'));\n\n if (!empty($render))\n $this->render('Elements/ajax_desejos');\n }", "function dokan_add_to_wishlist_link() {\n if ( class_exists( 'YITH_WCWL' ) ) {\n global $yith_wcwl, $product;\n\n printf( '<a href=\"%s\" class=\"btn fav add_to_wishlist\" data-product-id=\"%d\" data-product-type=\"\"><i class=\"fa fa-heart\"></i></a>', $yith_wcwl->get_addtowishlist_url(), $product->id );\n }\n}", "public function wishlist(Request $request)\n\t{\n\t\t\n\n\t\t\t$maincategorys = Maincategory::all(); \n\t\t\t$wishlists = Wishlist::where('userid', $request->user()->id)->groupBy('productid')->get();\t\n\t\t\t\n\n\t\t\treturn view('pages.wishlist')\n\t\t\t->with('maincategorys', $maincategorys)\n\t\t\t->with('wishlists', $wishlists);\n\t\n\t}", "public static function fetchForUser()\r\n {\r\n $wishlist = new static();\r\n \r\n $identity = \\Dsc\\System::instance()->get( 'auth' )->getIdentity();\r\n $session_id = \\Dsc\\System::instance()->get( 'session' )->id();\r\n \r\n if (! empty( $identity->id ))\r\n {\r\n $wishlist->load( array(\r\n 'user_id' => new \\MongoId( (string) $identity->id ) \r\n ) );\r\n $wishlist->user_id = $identity->id;\r\n \r\n $session_wishlist = static::fetchForSession();\r\n \r\n // if there was no user wishlist but there IS a session wishlist, just add the user_id to the session wishlist and save it\r\n if (empty( $wishlist->id ) && ! empty( $session_wishlist->id ))\r\n {\r\n $wishlist = $session_wishlist;\r\n $wishlist->user_id = $identity->id;\r\n $wishlist->save();\r\n }\r\n \r\n // if there was a user wishlist and there is a session wishlist, merge them and delete the session wishlist\r\n // if we already did the merge, skip this\r\n $session_wishlist_merged = \\Dsc\\System::instance()->get( 'session' )->get( 'shop.session_wishlist_merged' );\r\n if (! empty( $session_wishlist->id ) && $session_wishlist->id != $wishlist->id && empty( $session_wishlist_merged ))\r\n {\r\n $wishlist->session_id = $session_id;\r\n $wishlist->merge( $session_wishlist->cast() );\r\n $session_wishlist->remove();\r\n \\Dsc\\System::instance()->get( 'session' )->set( 'shop.session_wishlist_merged', true );\r\n }\r\n \r\n if (empty( $wishlist->id ))\r\n {\r\n $wishlist->save();\r\n }\r\n }\r\n \r\n return $wishlist;\r\n }", "public function getIdList() {\n migrate_instrument_start(\"Retrieve $this->listUrl\");\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n migrate_instrument_stop(\"Retrieve $this->listUrl\");\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n return $this->getIDsFromJSON($data);\n }\n }\n Migration::displayMessage(t('Loading of !listurl failed:',\n array('!listurl' => $this->listUrl)));\n return NULL;\n }", "function getListID($requestStatus) {\n global $client;\n $boardsArray = json_decode(json_encode($client->getCurrentUserBoards()), true); //Get the board and convert to an array from stdClass\n $boardID = strval($boardsArray[0][\"id\"]);\n $listsArray = json_decode(json_encode($client->getBoardLists($boardID)), true);\n foreach($listsArray as $data) {\n if ($data[\"name\"] == $requestStatus) {\n return $data[\"id\"];\n }\n }\n}", "public function additemtowishlist($productid){\n\t\tif($this->checkwishlist($productid)){\n\t\t\t$object=array(\n\t\t\t\t'UserID' => $this->session->userdata('userid'),\n\t\t\t\t'UserEmail' => $this->session->userdata('useremail'),\n\t\t\t\t'Product_Id' => $productid\n\t\t\t);\n\t\t\t$this->db->insert('tbl_wishlist', $object);\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getBuyerId();", "public function getwishlistbyuser(){\n\t\t$this->db->where('UserID', $this->session->userdata('userid'));\n\t\t$this->db->select('Product_Id,ProductName,ProductAuther,ProductSellingPrice,ProductThumbImage');\n\t\t$this->db->from('tbl_wishlist');\n\t\t$this->db->join('tbl_products', 'tbl_wishlist.Product_Id=tbl_products.ProductId', 'INNER');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getWholinemeList(){\n return $this->_get(2);\n }", "function ajouterArticleWishList($libelleProduit,$idProduit,$qteProduit,$prixProduit,$enseigne, $idEnseigne, $pourcentageReverse,$mediaProduit){\n /*echo 'fonction ajouter <br>';\n echo '<br>'.$libelleProduit.'<br>'.$idProduit.'<br>'.$qteProduit.'<br>'.$prixProduit.'<br>'.$enseigne.'<br>'.$idEnseigne.'<br>'. $pourcentageReverse.'<br>'.$mediaProduit;\n */\n //Si le wishlist existe\n if (creationwishlist() && !isVerrouilleWishlist())\n {\n //Si le produit existe déjà on ajoute seulement la quantité\n $positionProduit = array_search($libelleProduit, $_SESSION['wishlist']['libelleProduit']);\n\n if ($positionProduit !== false)\n {\n $_SESSION['wishlist']['qteProduit'][$positionProduit] += $qteProduit ;\n }\n else\n {\n //Sinon on ajoute le produit\n array_push( $_SESSION['wishlist']['libelleProduit'],$libelleProduit);\n array_push( $_SESSION['wishlist']['idProduit'],$idProduit);\n array_push( $_SESSION['wishlist']['qteProduit'],$qteProduit);\n array_push( $_SESSION['wishlist']['prixProduit'],$prixProduit);\n array_push( $_SESSION['wishlist']['enseigne'],$enseigne);\n array_push( $_SESSION['wishlist']['idEnseigne'],$idEnseigne);\n array_push( $_SESSION['wishlist']['mediaProduit'],$mediaProduit);\n array_push( $_SESSION['wishlist']['pourcentageReverse'],$pourcentageReverse);\n }\n }\n else\n echo \"Un problème est survenu veuillez contacter l'administrateur du site.\";\n}", "public static function fetch()\r\n {\r\n $identity = \\Dsc\\System::instance()->get( 'auth' )->getIdentity();\r\n if (empty( $identity->id ))\r\n {\r\n $wishlist = static::fetchForSession();\r\n }\r\n else\r\n {\r\n $wishlist = static::fetchForUser();\r\n }\r\n \r\n return $wishlist;\r\n }", "function edd_social_discounts_get_shared_product_ids() {\n\t// get all discount IDs\n\t$discounts = edd_get_discounts();\n\t$discount_ids = array();\n\t$share_ids = array();\n\t\n\tif ( $discounts ) {\n\t\tforeach ( $discounts as $discount ) {\n\t\t\t$discount_ids[] = $discount->ID;\n\t\t}\n\t}\n\n\tforeach ( $discount_ids as $id ) {\n\t\t$products = get_post_meta( $id, '_edd_discount_social_discount_products', true );\n\n\t\tif ( $products ) {\n\t\t\tforeach ($products as $product) {\n\t\t\t\tarray_push( $share_ids, $product );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (array) apply_filters( 'edd_social_discounts_get_share_array', $share_ids );\n}", "public function get_shared_wishlist($user_id)\n\t{\n\t\t//echo \"Hello\";exit;\n\t\t$ch = curl_init();\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_URL, API_BASE .\"/wishlist/sharedlist\");\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t 'Authorization: Basic ' . $this->session->userdata('auth') ));\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = json_decode( $content );\n\n\t\treturn ( $response );\n\t}", "function loadQuotationToWishlist($qid)\n {\n \t$result = $this->query(\"SELECT * FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' and id='\".$qid.\"'\");\n\t$arr = $this->toArray($result[0]['content']) ;\n if($arr)\n {\n foreach ($arr as &$value) {\n $tostringarr[$n][0] = \t$value['id'];\n $tostringarr[$n][1] = \t$value['qty'];\n $n++;\n }\n $str = $this->toString($tostringarr);\n \n // Create the Quotation\n // Updated by Saliya Wijesinghe\n $thisTime=time();\n $thisQuoteId=\"RE:\".$result[0]['quotationid'];\n $this->query(\"INSERT INTO`\".$this->tblPrefix.$this->table.\"` (client_id,quotationid,title,content,amount,moddate,himage,cdetails,othertxt,status)\n VALUES ('\".$this->logUser.\"', '\".$thisQuoteId.\"', '\".$result[0]['title'].\"','\".$result[0]['content'].\"','\".$result[0]['amount'].\"',\n '\".$thisTime.\"','\".$result[0]['himage'].\"','\".$result[0]['cdetails'].\"','\".$result[0]['othertxt'].\"','open')\");\n\n // GetThe added record\n $newQuote = $this->query(\"SELECT id FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' AND moddate='\".$thisTime.\"' AND content='\".$result[0]['content'].\"' AND quotationid='\".$thisQuoteId.\"'\");\n // Update the Wish list\n $result = $this->query(\"UPDATE `\".$this->tblPrefix.\"sys_support` SET content_wlist='\".$str.\"',wish_quote_link='\".$newQuote[0]['id'].\"' WHERE client_id='\".$this->logUser.\"'\");\n\n if($result) return $msg = array('SUC','QUOTE_RE_CREATED');\n \n }\n\t \t \n }", "public function getItems()\r\n {\r\n return $this->user->wishlistItems;\r\n }", "public function getBlockedUserIds($stringify = false) {\n\t\t//Argument 1 must be a boolean\n\t\tEden_Twitter_Error::i()->argument(1, 'bool');\t\t\n\t\t\n\t\t$this->_query['stringify_ids'] = $stringify;\n\t\t\n\t\treturn $this->_getResponse(self::URL_GET_BLOCKING_ID, $this->_query);\n\t}" ]
[ "0.8252224", "0.74019974", "0.7289154", "0.6912871", "0.64536047", "0.6166625", "0.6153575", "0.61510456", "0.61022043", "0.6045225", "0.6008975", "0.5971688", "0.59576833", "0.5890235", "0.58724195", "0.5856227", "0.58141804", "0.57917124", "0.578789", "0.57647365", "0.5734617", "0.5734387", "0.57231116", "0.57205474", "0.5719011", "0.5718116", "0.56744045", "0.5666946", "0.56474686", "0.563423", "0.5625782", "0.56048787", "0.55973494", "0.55973494", "0.5562845", "0.5546391", "0.5545554", "0.5539228", "0.55284405", "0.5521504", "0.5511401", "0.5510092", "0.5510092", "0.5510092", "0.5510092", "0.5510092", "0.5510092", "0.5510092", "0.5510092", "0.55014277", "0.54781425", "0.547067", "0.5467278", "0.5462525", "0.54611635", "0.54601127", "0.54547995", "0.5433762", "0.5433013", "0.54302686", "0.54019505", "0.5387542", "0.53819335", "0.53818154", "0.53783584", "0.5372076", "0.53708184", "0.5365682", "0.53652656", "0.5362269", "0.5360232", "0.53534234", "0.5350944", "0.5345422", "0.53410715", "0.53396547", "0.5337317", "0.5336693", "0.5321992", "0.53189874", "0.53152955", "0.5298354", "0.5296353", "0.52936393", "0.5288847", "0.528586", "0.52856", "0.5283313", "0.5280831", "0.5275638", "0.52686536", "0.5267613", "0.526311", "0.52623963", "0.5240918", "0.52190447", "0.52158177", "0.5215764", "0.52074325", "0.5202944" ]
0.90229326
0
Set multiple wishlist id
public function setMultipleWishlistId($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMultipleWishlistId();", "public function setWishlistId(int $id);", "public function getWishlistId();", "public function setWishlistItemId(int $id);", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "function setMetafieldWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products !== null or $products !== \"\") {\n $wishlist->setProductIds($productIds);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productIds);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if($value !== \"null\") {\n $productIds .= ',' . $value;\n }\n }\n } else {\n if($wishlistDecoded['metafields'][0]['value'] === \"null\") {\n $productIds = $productId;\n } else {\n $productIds = $wishlistDecoded['metafields'][0]['value'] .',' . $productId;\n }\n\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n } else {\n $data = [\n \"metafield\" => [\n \"namespace\" => \"wishlist\",\n \"key\" => \"wishlist-products\",\n \"value\" => '' . $productId . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . 'customers/'.$customerId.'/metafields.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n return new Response('wishlist saved');\n }", "public function getWishlistItemId();", "function addToWishList()\n {\n $idMobile = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $idMobile = $param[0];\n $result = $this->model->khachhang->addToWishList($idMobile);\n }\n $this->layout->set('null');\n $this->view->load('frontend/addWishListResult', [\n 'result' => $result\n ]);\n }", "function set_list_id($list_id) {\n $this->_subscribers_base_route = $this->_base_route.'subscribers/'.$list_id;\n }", "function SetBidList(&$list)\n\t{\n\t\t$this->_bidList = array();\n\t\t$existingBidList = $this->GetBidList();\n\t\tforeach ($existingBidList as $bid)\n\t\t{\n\t\t\t$bid->supplierId = '';\n\t\t\t$bid->Save(false);\n\t\t}\n\t\t$this->_bidList = $list;\n\t}", "public function changeShelfWish($id){\n $library = Library::find(Auth::user()->library->id);\n $do = ['do'=> 0];\n $library->books()->attach($id, $do);\n return redirect('/library/showWishList');\n }", "private function _setListId()\r\n { \r\n if (Mage::getSingleton('admin/session')->isLoggedIn()) {\r\n $storeId = Mage::app()->getRequest()->getParam('store_id');\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId', $storeId); \r\n } else {\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId');\r\n }\r\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "protected function createWishlist(array $params, int $wishlistId)\n {\n $multipleWishlist = $this->multipleWishlistFactory->create();\n $multipleWishlist->setWishlistId($wishlistId);\n $multipleWishlist->setName($params['name']);\n $multipleWishlist->setSharingCode($this->mathRandom->getUniqueHash());\n\n try {\n $this->multipleWishlistRepository->save($multipleWishlist);\n } catch (CouldNotSaveException $e) {\n $this->logger->error($e->getMessage());\n return false;\n }\n\n return true;\n }", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "function ajouterArticleWishList($libelleProduit,$idProduit,$qteProduit,$prixProduit,$enseigne, $idEnseigne, $pourcentageReverse,$mediaProduit){\n /*echo 'fonction ajouter <br>';\n echo '<br>'.$libelleProduit.'<br>'.$idProduit.'<br>'.$qteProduit.'<br>'.$prixProduit.'<br>'.$enseigne.'<br>'.$idEnseigne.'<br>'. $pourcentageReverse.'<br>'.$mediaProduit;\n */\n //Si le wishlist existe\n if (creationwishlist() && !isVerrouilleWishlist())\n {\n //Si le produit existe déjà on ajoute seulement la quantité\n $positionProduit = array_search($libelleProduit, $_SESSION['wishlist']['libelleProduit']);\n\n if ($positionProduit !== false)\n {\n $_SESSION['wishlist']['qteProduit'][$positionProduit] += $qteProduit ;\n }\n else\n {\n //Sinon on ajoute le produit\n array_push( $_SESSION['wishlist']['libelleProduit'],$libelleProduit);\n array_push( $_SESSION['wishlist']['idProduit'],$idProduit);\n array_push( $_SESSION['wishlist']['qteProduit'],$qteProduit);\n array_push( $_SESSION['wishlist']['prixProduit'],$prixProduit);\n array_push( $_SESSION['wishlist']['enseigne'],$enseigne);\n array_push( $_SESSION['wishlist']['idEnseigne'],$idEnseigne);\n array_push( $_SESSION['wishlist']['mediaProduit'],$mediaProduit);\n array_push( $_SESSION['wishlist']['pourcentageReverse'],$pourcentageReverse);\n }\n }\n else\n echo \"Un problème est survenu veuillez contacter l'administrateur du site.\";\n}", "public function wishlist($action = null, $id = null) {\n $company_id = $this->Session->read('CompanyLoggedIn.Company.id');\n\n // verifica se vai cadastrar uma oferta especifica para usuario\n if ($action == 'offer_user') {\n $this->Session->write('CadOfferUser.id_linha_wishlist', $id);\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n\n // verifica post e se vai inserir uma oferta especifica p/ usuario\n if ($this->request->is('post')) {\n\n if ($this->request->data ['excluir_wishlist'] == true) {\n $render = true;\n $this->layout = '';\n\n // faz update de wishlist para excluir desejo\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'INACTIVE'\n )\n );\n\n $desejosDel = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if (!$desejosDel ['status'] == 'SAVE_OK') {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else if ($this->request->data ['id_oferta'] > 0) {\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->request->data ['id_linha'],\n 'status' => 'ACTIVE',\n 'offer_id' => $this->request->data ['id_oferta']\n )\n );\n\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n } else {\n $mensagem = \"Ocorreu um erro. Tente novamente\";\n }\n } else {\n $mensagem = \"Voce nao selecinou nenhuma oferta para este desejo. Tente novamente\";\n }\n }\n\n $limit = 6;\n $update = true;\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n )\n )\n );\n $contador = $this->Utility->urlRequestToGetData('companies', 'count', $params);\n\n // verifica se esta fazendo uma requisicao ajax\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 2;\n if ($limit >= $contador) {\n $limit = $contador;\n $update = false;\n }\n }\n\n // listando desejos\n $params = array(\n 'UsersWishlistCompany' => array(\n 'conditions' => array(\n 'UsersWishlistCompany.company_id' => $company_id,\n 'UsersWishlistCompany.status' => 'WAIT'\n ),\n 'order' => array(\n 'UsersWishlistCompany.id' => 'DESC'\n ),\n 'limit' => $limit\n ),\n 'User',\n 'UsersWishlist',\n 'CompaniesCategory'\n );\n $desejos = $this->Utility->urlRequestToGetData('companies', 'all', $params);\n\n // pegando ofertas de empresa\n $params = array(\n 'Offer' => array(\n 'fields' => array(\n 'Offer.id',\n 'Offer.title'\n ),\n 'conditions' => array(\n 'Offer.company_id' => $company_id,\n 'Offer.status' => 'ACTIVE'\n ),\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $ofertas = $this->Utility->urlRequestToGetData('offers', 'all', $params);\n\n $this->set(compact('ofertas', 'desejos', 'limit', 'contador', 'update', 'mensagem'));\n\n if (!empty($render))\n $this->render('Elements/ajax_desejos');\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function updateQuantityFromArrayOfWishlistIds(array $wishlistIds)\r\n {\r\n foreach ($wishlistIds as $itemId => $itemQuantity) {\r\n if (!is_numeric($itemQuantity)) {\r\n continue;\r\n }\r\n if ($itemQuantity <= 0) {\r\n Wishlist::find($itemId)->delete();\r\n continue;\r\n }\r\n $this->updateWishlistId($itemId, $itemQuantity);\r\n }\r\n }", "private function updateWishlistId(int $wishlistId, int $quantity)\r\n {\r\n $wishlistItem = Wishlist::find($wishlistId);\r\n $wishlistItem->quantity = $quantity;\r\n $wishlistItem->save();\r\n }", "public function setIds($arrIds);", "function SetWeddingList(&$list)\n\t{\n\t\t$this->_weddingList = array();\n\t\t$existingWeddingList = $this->GetWeddingList();\n\t\tforeach ($existingWeddingList as $wedding)\n\t\t{\n\t\t\t$wedding->supplierId = '';\n\t\t\t$wedding->Save(false);\n\t\t}\n\t\t$this->_weddingList = $list;\n\t}", "public function addWishlist($id){\n if (Auth::check()) {\n if (Wishlist::where('product_id',$id)->where('user_id',Auth::id())->exists()) {\n return response()->json([\n 'error' => \"This Product Already Add Wishlist\",\n ]);\n }\n else {\n Wishlist::insert([\n 'user_id' => Auth::id(),\n 'product_id' => $id,\n 'created_at' => Carbon::now()\n ]);\n return response()->json([\n 'success' => \"Add Wishlist Successfully\"\n ]);\n }\n }\n else {\n return response()->json([\n 'error' => \"Please Login First\"\n ]);\n }\n }", "public function index($wishlistid)\n {\n $wish['wishlistid'] = $wishlistid;\n\n $validation = Validator::make($wish,[\n 'wishlistid'=>'exists:wishes,wishlistid',\n ]);\n\n if($validation->fails())\n {\n $failedRules = $validation->failed();\n $field = '';\n\n if(isset($failedRules['wishlistid']['Exists']))\n {\n $message = 'Wishlist id not found.';\n $field = 'wishlistid';\n }\n\n return response()->json(['status'=>'400','message'=>$message,'field'=>$field]);\n }\n else\n {\n $wishes = $this->wish->getWishesByWishlistId($wishlistid);\n $userid = $this->wishlist->getCreatedById($wishlistid);\n\n $getFavoriteBookmarkForStream = $this->favoritebookmark->getFavoriteBookmarkForStream($userid);\n foreach($wishes as $w)\n {\n $w->favorited = '0';\n $w->bookmarked = '0';\n foreach($getFavoriteBookmarkForStream as $gfbfs)\n {\n if($w->id == $gfbfs['wishid'])\n {\n if($gfbfs['type'] == '2')\n {\n $w->favorited = '1';\n }\n if($gfbfs['type'] == '1')\n {\n $w->bookmarked = '1';\n }\n }\n }\n $w->favoritecount = $this->favoritebookmark->countFavoriteBookmark($w->id, '2');\n $w->bookmarkcount = $this->favoritebookmark->countFavoriteBookmark($w->id, '1');\n }\n\n return response()->json(['status'=>'200','message'=>'Ok','wishes'=>$wishes]);\n }\n }", "public function set_id($ids) {\n $this->id = $ids; \n }", "public function setNameAndId() {}", "public function actionAddToWishlist($product_id, $user_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('wishlist', $saveArr)->execute();\n exit;\n }", "function add_wishlist($_id_member,$_id_product,$_id_source)\n\t\t{\n\t\t\t//must make a rule to get different product detail depend on id_source\n\t\t\t\n\t\t\t$_id_member_session = $this->CI->session->userdata('id_member');\n\t\t\t//Must relate with model wishlist return must an integer\n\t\t\t$_wishlist_already_added = $this->CI->model_product->is_added_stuff($_id_product,$_id_member);\n\t\t\t/*if(!$_wishlist_already_added)\n\t\t\t{\n\t\t\t\t$this->model_zhout->update_wishlist_status($_id_product);\n\t\t\t\t$this->model_wishlist->insert_wishlist($_id_member,$_id_product);\n\t\t\t\t$data['message'] = ''\n\t\t\t\treturn \n\t\t\t}*/\n\t\t}", "function addconfig_to_favoritesAction()\n\t{\n\t\t$session = Mage::getSingleton('customer/session');\n\t\t $this->_customerId = $session->getCustomer()->getId();\n\t\t $list = Mage::getModel('amlist/list');\n\t \t $listId = $this->getRequest()->getParam('list');\n\t\t $post = $this->getRequest()->getPost();\n\t\t $products = $post['product'];\n\t\t if (!$listId){ //get default - last\n\t $listId = Mage::getModel('amlist/list')->getLastListId($this->_customerId);\n\t \t }\n\t \t if (!$listId) \n\t\t { \n\t\t //create new\n\t\t //print_r($post['selected_productid']);\n\t\t //exit;\n\t Mage::getSingleton('amlist/session')->setAddProductId($post['selected_productid']);\n\t\t Mage::getSingleton('amlist/session')->setAddAllProductId($products);\n\t $this->_redirect('amlist/list/edit/');\n\t return;\n\t }\n\t\t\tif($post['selected_productid'])\n\t\t\t{\n\t\t\t\t\n\t\t\t\tforeach($products as $_product)\n\t\t\t\t{\n\t\t\t\t\tif($post['selected_productid']==$_product[product]):\n\t\t\t\t\t\t$item = Mage::getModel('amlist/item')\n\t\t\t\t\t\t->setProductId($_product[product])\n\t\t\t\t\t\t->setListId($listId) \n\t\t\t\t\t\t->setQty($_product[qty])\n\t\t\t\t\t\t->setBuyRequest(serialize($_product));\n\t\t\t\t\t\t$item->save();\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t}\n\t\t\t\t Mage::getSingleton('core/session')->addSuccess($this->__('Product has been successfully added to the folder.'));\n\t\t\t\t $this->_redirectReferer();\n\t\t\t}\n\t}", "function displayWishLists()\n{\n $customerId = 1;\n $wishlists = wishlistsDB::getWishlistsByCustomer($customerId);\n foreach ($wishlists as $wishlist) {\n $wid= $wishlist->getWishlistId();\n\n $wname = $wishlist->getWishlistName();\n\n echo \"<div id='wishlistName'>\";\n echo $wname;\n echo \"</div>\";\n echo \"<input type='submit' class='btn btn-default' value='Add to Wishlist' name='pushToList' id='pushToList' onclick=\\\"addtoList('$wid');\\\" />\";\n echo \"<br/><br/>\";\n }\n echo \"<input type='submit' name='newWishlist' class='btn btn-default' value='Create new Wishlist' onclick=\\\"newList();\\\"/>\";\n\n}", "function setSwimMeetId($id)\r\n {\r\n $this->_swimmeetid = $id ;\r\n }", "function wp_parse_id_list($input_list)\n {\n }", "public function setclient_id($value);", "public function setSharepointIds($val)\n {\n $this->_propDict[\"sharepointIds\"] = $val;\n return $this;\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "protected function set_product_ids() {\n\n\t\t// get the products selected for the report\n\t\t$this->product_ids = isset( $_GET['product_ids'] ) ? array_filter( array_map( 'absint', (array) $_GET['product_ids'] ) ) : array();\n\t}", "public function test_setupids() {\n $ratings = array();\n $ratings[1] = new \\stdClass();\n $ratings[1]->userid = 3;\n $ratings[1]->choiceid = 1;\n $ratings[1]->rating = 5;\n\n $ratings[2] = new \\stdClass();\n $ratings[2]->userid = 3;\n $ratings[2]->choiceid = 2;\n $ratings[2]->rating = 3;\n\n $ratings[3] = new \\stdClass();\n $ratings[3]->userid = 2;\n $ratings[3]->choiceid = 1;\n $ratings[3]->rating = 5;\n\n $ratings[4] = new \\stdClass();\n $ratings[4]->userid = 2;\n $ratings[4]->choiceid = 2;\n $ratings[4]->rating = 2;\n\n $usercount = 2;\n list($fromuserid, $touserid, $fromchoiceid, $tochoiceid) = \\solver_edmonds_karp::setup_id_conversions($usercount, $ratings);\n\n $this->assertEquals(array(3 => 1, 2 => 2), $fromuserid);\n $this->assertEquals(array(1 => 3, 2 => 2), $touserid);\n\n $this->assertEquals(array(1 => 3, 2 => 4), $fromchoiceid);\n $this->assertEquals(array(3 => 1, 4 => 2), $tochoiceid);\n }", "public function offers_suppression_list_put($id)\n {\n //print_r($data);\n // die();\n $this->verify_request();\n // $headers = $this->input->request_headers();\n // // Extract the token\n // echo $token = $headers['Authorization'];die;\n $data=$this->put(); \n $this->db->update('suppression_list',$data,array('sup_list_id' => $id));\n $status = parent::HTTP_OK;\n $this->response(['Item updated successfully.'], $status);\n }", "public function utilityIds()\n {\n $this->attributes['utilityIds'] = $this->utilities->pluck('id');\n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "public function additemtowishlist($productid){\n\t\tif($this->checkwishlist($productid)){\n\t\t\t$object=array(\n\t\t\t\t'UserID' => $this->session->userdata('userid'),\n\t\t\t\t'UserEmail' => $this->session->userdata('useremail'),\n\t\t\t\t'Product_Id' => $productid\n\t\t\t);\n\t\t\t$this->db->insert('tbl_wishlist', $object);\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function setWinnerIdAttribute($input)\n {\n $this->attributes['winner_id'] = $input ? $input : null;\n }", "public function wishlistAdd($requestParams,$wishlist,$productId){\n $response = array();\n if (! $productId) {\n /**\n * Set product not fount error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Product Not Found' );\n } else {\n /**\n * Get product collection\n * @var $product\n */\n $product = Mage::getModel ( 'catalog/product' )->load ( $productId );\n if (! $product->getId () || ! $product->isVisibleInCatalog ()) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'Cannot specify product.' );\n } else {\n try {\n /**\n * Get parameters.\n */\n $buyRequest = new Varien_Object ( $requestParams );\n /**\n * Whislist add new product.\n */\n $result = $wishlist->addNewItem ( $product, $buyRequest );\n if (is_string ( $result )) {\n Mage::throwException ( $result );\n }\n $wishlist->save ();\n Mage::dispatchEvent ( 'wishlist_add_product', array (\n 'wishlist' => $wishlist,\n 'product' => $product,\n 'item' => $result\n ) );\n /**\n * Set success message.\n */\n Mage::helper ( 'wishlist' )->calculate ();\n $message = $product->getName ().' has been added to your wishlist.';\n $response ['status'] = 'SUCCESS';\n $response ['message'] = $message;\n /**\n * Unset registry.\n */\n Mage::unregister ( 'wishlist' );\n return $response;\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Set error message.\n */\n $response ['status'] = 'ERROR';\n $response ['message'] = $this->__ ( 'An error occurred while adding item to wishlist: %s', $e->getMessage () );\n return $response;\n }\n }\n }\n }", "function count_wishlist() {\n $total_items = 0;\n if (is_array($this->wishID)) {\n reset($this->wishID);\n while (list($wishlist_id, ) = each($this->wishID)) {\n $total_items++;\n }\n }\n\n return $total_items;\n }", "function loadQuotationToWishlist($qid)\n {\n \t$result = $this->query(\"SELECT * FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' and id='\".$qid.\"'\");\n\t$arr = $this->toArray($result[0]['content']) ;\n if($arr)\n {\n foreach ($arr as &$value) {\n $tostringarr[$n][0] = \t$value['id'];\n $tostringarr[$n][1] = \t$value['qty'];\n $n++;\n }\n $str = $this->toString($tostringarr);\n \n // Create the Quotation\n // Updated by Saliya Wijesinghe\n $thisTime=time();\n $thisQuoteId=\"RE:\".$result[0]['quotationid'];\n $this->query(\"INSERT INTO`\".$this->tblPrefix.$this->table.\"` (client_id,quotationid,title,content,amount,moddate,himage,cdetails,othertxt,status)\n VALUES ('\".$this->logUser.\"', '\".$thisQuoteId.\"', '\".$result[0]['title'].\"','\".$result[0]['content'].\"','\".$result[0]['amount'].\"',\n '\".$thisTime.\"','\".$result[0]['himage'].\"','\".$result[0]['cdetails'].\"','\".$result[0]['othertxt'].\"','open')\");\n\n // GetThe added record\n $newQuote = $this->query(\"SELECT id FROM `\".$this->tblPrefix.$this->table.\"` WHERE client_id='\".$this->logUser.\"' AND moddate='\".$thisTime.\"' AND content='\".$result[0]['content'].\"' AND quotationid='\".$thisQuoteId.\"'\");\n // Update the Wish list\n $result = $this->query(\"UPDATE `\".$this->tblPrefix.\"sys_support` SET content_wlist='\".$str.\"',wish_quote_link='\".$newQuote[0]['id'].\"' WHERE client_id='\".$this->logUser.\"'\");\n\n if($result) return $msg = array('SUC','QUOTE_RE_CREATED');\n \n }\n\t \t \n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "public function massQuoteIdAction()\n {\n $offerIds = $this->getRequest()->getParam('offer');\n if (!is_array($offerIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('mfb_myflyingbox')->__('Please select offers.')\n );\n } else {\n try {\n foreach ($offerIds as $offerId) {\n $offer = Mage::getSingleton('mfb_myflyingbox/offer')->load($offerId)\n ->setQuoteId($this->getRequest()->getParam('flag_quote_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d offers were successfully updated.', count($offerIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('mfb_myflyingbox')->__('There was an error updating offers.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public static function saveWishList($customerId, $wishlistArr){\n return Customer::saveWishList($customerId, serialize($wishlistArr));\n }", "public function testGetListOfSpecificIds()\n {\n $itemIds = [];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n $response = $this->api->create($this->testPayload);\n $this->assertErrors($response);\n $itemIds[] = $response[$this->api->itemName()]['id'];\n\n $search = 'ids:'.implode(',', $itemIds);\n\n $response = $this->api->getList($search);\n $this->assertErrors($response);\n $this->assertEquals(count($itemIds), $response['total']);\n\n foreach ($response['lists'] as $item) {\n $this->assertTrue(in_array($item['id'], $itemIds));\n $this->api->delete($item['id']);\n $this->assertErrors($response);\n }\n }", "public function addselectedtocartAction() {\n $messages = array();\n $urls = array();\n $wishlistIds = array();\n $notSalableNames = array(); // Out of stock products message\n\n\t\t$ids = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('ids'));\n\t\t$qtys = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('qtys'));\n\t\t\n\t\t$ids_arr = explode(',', $ids);\n\t\t$qtys_arr = explode(',', $qtys);\n\t\t\n\t\t$i=0;\n\t\tforeach($ids_arr as $id)\n\t\t{\n\t\t\t$id = intval($id);\n\t\t\t$qty = intval($qtys_arr[$i]);\n\t\t\tif($id != '' && $qty != '')\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t$product = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->load($id)\n\t\t\t\t\t\t->setQty($qty);\n\t\t\t\t\tif ($product->isSalable()) {\n\t\t\t\t\t\tMage::getSingleton('checkout/cart')->addProduct($product,$qty);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$notSalableNames[] = $product->getName();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$url = Mage::getSingleton('checkout/session')->getRedirectUrl(true);\n\t\t\t\t\tif ($url)\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = Mage::getModel('core/url')\n\t\t\t\t\t\t\t->getUrl('catalog/product/view', array(\n\t\t\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t\t\t'wishlist_next' => 1\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t$urls[] = $url;\n\t\t\t\t\t\t$messages[] = $e->getMessage();\n\t\t\t\t\t\t$wishlistIds[] = $id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//$item->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n }\n\t\t\t$i++;\n\t\t}\n\t\tMage::getSingleton('checkout/cart')->save();\n\n if (count($notSalableNames) > 0) {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Following product(s) is currently out of stock:'));\n array_map(array(Mage::getSingleton('checkout/session'), 'addNotice'), $notSalableNames);\n }\n\n if ($urls) {\n Mage::getSingleton('checkout/session')->addError(array_shift($messages));\n $this->getResponse()->setRedirect(array_shift($urls));\n\n Mage::getSingleton('checkout/session')->setWishlistPendingUrls($urls);\n Mage::getSingleton('checkout/session')->setWishlistPendingMessages($messages);\n Mage::getSingleton('checkout/session')->setWishlistIds($wishlistIds);\n }\n else {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Product(s) Added successfully'));\n $this->_redirect('wishlist/index');\n }\n }", "public function setId($id)\r\n {\r\n $this->data['itemid'] = (int) $id;\r\n }", "protected function _update_cookies(){\n\t\t\t$cookie = yith_getcookie( 'yith_wcwl_products' );\n\t\t\t$new_cookie = array();\n\n\t\t\tif( ! empty( $cookie ) ) {\n\t\t\t\tforeach ( $cookie as $item ) {\n\t\t\t\t\tif ( ! isset( $item['add-to-wishlist'] ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$new_cookie[] = array(\n\t\t\t\t\t\t'prod_id' => $item['add-to-wishlist'],\n\t\t\t\t\t\t'quantity' => isset( $item['quantity'] ) ? $item['quantity'] : 1,\n\t\t\t\t\t\t'wishlist_id' => false\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tyith_setcookie( 'yith_wcwl_products', $new_cookie );\n\t\t\t}\n\t\t}", "public function setList(){\r\n\t\t $arr=func_num_args();\r\n\t\t\t $arr1=func_get_args();\r\n\t\t\t if ($arr==2){\r\n\t\t\t $this->su[$this->counte]=$arr1[0];\r\n\t\t\t $this->data[$this->counte]=$arr1[1];\r\n\t\t\t\t }\r\n\t\t\t\t if ($arr==1){\r\n\t\t\t\t $this->data[$this->counte]=$arr1[0];\r\n\t\t\t\t $this->su[$this->counte]=$this->oklad;\r\n\t\t\t\t // $this->su=$this->oklad;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t $this->listing[$this->counte] =array($this->su,$this->data);\r\n\t\t\t $this->counte++;\r\n\t\t\t}", "function addtoBasket($product_id, $can_update = '0', $to_wishlist = '0')\r\n\t{\r\n\t\t$to_wishlist = (isset($_REQUEST[\"wishlist_$_REQUEST[product_id]\"]) && $_REQUEST[\"wishlist_$_REQUEST[product_id]\"] == 1 ) ? '1' : '0';\r\n\t\tif($to_wishlist==1) $can_update=1;\r\n\r\n\t\t$product_id = (int)$product_id;\r\n\t\t$amount = (int)$_REQUEST['amount'];\r\n\t\tif (($amount > '0') && ($can_update == '1' || !isset($_SESSION['Product'][$_REQUEST['product_id']]) || !in_array($_REQUEST['id'], $_SESSION['Product'])))\r\n\t\t{\r\n\t\t\tif(isset($_REQUEST['product_id']) && is_numeric($_REQUEST['product_id']))\r\n\t\t\t{\r\n\r\n\t\t\t\tif($to_wishlist!=1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$_SESSION['Product'][$_REQUEST['product_id']] = $amount;\r\n\r\n\t\t\t\t\t// Mögliche Varianten in Session\r\n\t\t\t\t\t// Hier wird ein Produkt aus dem Wunschzettel abgelegt\r\n\t\t\t\t\tif(isset($_REQUEST['vars']) && $_REQUEST['vars'] != '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(isset($_REQUEST['vars']) && $_REQUEST['vars'] != '')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$Vars_To_Session = $_REQUEST['vars'];\r\n\t\t\t\t\t\t\t$_SESSION['ProductVar'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$Vars_To_Session = chop(base64_decode($_REQUEST['vars']));\r\n\t\t\t\t\t\t}\r\n\r\n\r\n\t\t\t\t\t\t$_SESSION['ProductVar'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Hier wird ein normal (nicht aus dem Wunschzettel) abgelegt\r\n\t\t\t\t\tif(isset($_POST['product_vars']) && is_array($_POST['product_vars']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$Vars_To_Session = implode(',', $_REQUEST['product_vars']);\r\n\t\t\t\t\t\t$_SESSION['ProductVar'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// In Wunschliste?\r\n\t\t\t\tif($to_wishlist==1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_merkliste WHERE Benutzer = '\".$_SESSION['cp_benutzerid'].\"'\");\r\n\t\t\t\t\t$row = $sql->fetchrow();\r\n\t\t\t\t\tif(is_object($row) && $row->Id != '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Vorhandene Einträge auslesen und aktualisieren\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'] = unserialize($row->Inhalt);\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist_Vars'] = unserialize($row->Inhalt_Vars);\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'][$_REQUEST['product_id']] = $amount;\r\n\t\t\t\t\t\t$Vars_To_Session = implode(',', $_REQUEST['product_vars']);\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist_Vars'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'][$_REQUEST['product_id']] = $amount;\r\n\r\n\t\t\t\t\t\t$GLOBALS['db']->Query(\"UPDATE \" . PREFIX . \"_modul_shop_merkliste\r\n\t\t\t\t\t\tSET\r\n\t\t\t\t\t\t\tInhalt = '\".serialize($_SESSION['Product_Wishlist']).\"',\r\n\t\t\t\t\t\t\tInhalt_Vars = '\".serialize($_SESSION['Product_Wishlist_Vars']).\"'\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tBenutzer = '\".$_SESSION['cp_benutzerid'].\"'\");\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Neu\r\n\t\t\t\t\t\t// mögliche Varianten\r\n\t\t\t\t\t\t$Db_Vars = '';\r\n\t\t\t\t\t\tif(isset($_POST['product_vars']) && is_array($_POST['product_vars']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$Vars_To_Session = implode(',', $_REQUEST['product_vars']);\r\n\t\t\t\t\t\t\t$_SESSION['Product_Wishlist_Vars'][$_REQUEST['product_id']] = $Vars_To_Session;\r\n\t\t\t\t\t\t\t$Db_Vars = serialize($_SESSION['Product_Wishlist_Vars']);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$_SESSION['Product_Wishlist'][$_REQUEST['product_id']] = $amount;\r\n\t\t\t\t\t\t$GLOBALS['db']->Query(\"INSERT INTO \" . PREFIX . \"_modul_shop_merkliste\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tId,\r\n\t\t\t\t\t\t\tBenutzer,\r\n\t\t\t\t\t\t\tIp,\r\n\t\t\t\t\t\t\tInhalt,\r\n\t\t\t\t\t\t\tInhalt_Vars\r\n\t\t\t\t\t\t) VALUES (\r\n\t\t\t\t\t\t\t'',\r\n\t\t\t\t\t\t\t'\".$_SESSION['cp_benutzerid'].\"',\r\n\t\t\t\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"',\r\n\t\t\t\t\t\t\t'\".serialize($_SESSION['Product_Wishlist']).\"',\r\n\t\t\t\t\t\t\t'$Db_Vars'\r\n\t\t\t\t\t\t)\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\theader(\"Location:\" . $_SERVER['HTTP_REFERER']);\r\n\t\texit;\r\n\t}", "public function setId($id)\n\t{\n\t\tparent::setId($id);\n\t\t$params = $this->getParams();\n\n\t\t// Set elementlist params from picklist params\n\t\t$params->set('allow_frontend_addto', (bool) $params->get('allowadd', false));\n\t}", "public function set_id($setid){\n $this->id = $setid;\n }", "public function update(Request $request, WishList $wishList)\n {\n //\n }", "public function setLike($id){\n $producto = Producto::find($id);\n $producto->like = $producto->like + 1;\n $producto->save();\n\n return \\response()->json(['res' => true, 'message'=>'mas un like'], 200);\n }", "function removeProductFromWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productIdToDelete = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'wishlist-products');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if((string) $productIdToDelete !== (string) $value) {\n if($productIds == '') {\n $productIds .= $value;\n } else {\n $productIds .= ',' . $value;\n }\n }\n }\n }\n\n if($productIds === '') {\n $productIds = \"null\";\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n }\n\n return new Response('wishlist saved');\n }", "public function wishlist_toggle()\n\t{\n\t\t// no return needed as page is reloaded\n\t\t$this->EE->job_wishlists->wishlist_toggle();\t\t\n\t}", "public function clickShareWishList()\n {\n $this->waitFormToLoad();\n $this->_rootElement->find($this->shareWishList)->click();\n }", "private function saveTipsList($list) {\n if (!empty($list)) {\n $list = implode(',', $list);\n } else {\n $list = NULL;\n }\n \n $this->getCurrentUser()->setTipsList($list);\n $this->em->flush();\n }", "function as_action_init_wish_list() {\n global $wpdb;\n $page_found = $wpdb->get_var(\"SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_name` = 'wishlist' LIMIT 1;\");\n if ($page_found) {\n update_option('as-wishlist-page-id', $page_found);\n return;\n }\n\n $page_data = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_author' => 1,\n 'post_name' => esc_sql(_x('wishlist', 'page_slug', 'as')),\n 'post_title' => __('Wishlist', 'as'),\n 'post_content' => '[as_wish_list]',\n 'post_parent' => 0,\n 'comment_status' => 'closed'\n );\n $page_id = wp_insert_post($page_data);\n update_option('as-wishlist-page-id', $page_id);\n}", "public function get($id) {\n $wishList = WishList::where(\"users_id\",$id)->with(\"product\")->get();\n return $wishList;\n }", "function removeWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n $wishlistExploded = explode(',', $wishlist->getProductIds());\n $productIds = [];\n foreach ($wishlistExploded as $product) {\n if($product !== $productId) {\n $productIds[] = $product;\n }\n }\n $wishlistImploded = implode(',', $productIds);\n $wishlist->setProductIds($wishlistImploded);\n $em->flush();\n\n return new Response('product removed from the wishlist');\n }", "protected function _construct()\n {\n $this->_init('cminds_multiwishlist/item', 'wishlist_item_id');\n }", "function update_multiple($data) {\n\t\t$query = $this->testimonial_model->_update_multiple('id',$data);\n\t\treturn $query;\n\t}", "public function editAction() {\n\n //ONLY LOGGED IN USER CAN CREATE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n\n $wishlist_id = $this->_getParam('wishlist_id');\n if (isset($wishlist_id) && !empty($wishlist_id)) {\n $subject = $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n Engine_Api::_()->core()->setSubject($wishlist);\n } else {\n $this->respondWithError('no_record');\n }\n\n //GET VIEWER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $level_id = $viewer->level_id;\n\n\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\n $this->respondWithError('unauthorized');\n }\n //GET USER DIARIES\n $wishlistTable = Engine_Api::_()->getDbtable('wishlists', 'sitereview');\n $wishlistDatas = $wishlistTable->userWishlists($viewer);\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $perms = array();\n foreach ($roles as $roleString) {\n $role = $roleString;\n if ($auth->isAllowed($wishlist, $role, 'view')) {\n $perms['auth_view'] = $roleString;\n }\n }\n //FORM GENERATION\n if ($this->getRequest()->isGet()) {\n $formValues = $wishlist->toArray();\n $formValues = array_merge($formValues, $perms);\n\n if (isset($formValues['body']) && !empty($formValues['body']))\n $formValues['body'] = strip_tags($formValues['body']);\n\n\n $this->respondWithSuccess(array(\n 'form' => Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm(),\n 'formValues' => $formValues\n ));\n }\n\n //FORM VALIDATION\n else if ($this->getRequest()->isPut() || $this->getRequest()->isPost()) {\n\n $db = Engine_Api::_()->getItemTable('sitereview_listing')->getAdapter();\n $db->beginTransaction();\n try {\n $values = array();\n $getForm = Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm();\n foreach ($getForm as $element) {\n\n if (isset($_REQUEST[$element['name']]))\n $values[$element['name']] = $_REQUEST[$element['name']];\n }\n if (empty($values['title'])) {\n $validationMessage = \"title is required\";\n $this->respondWithValidationError('validation_fail', $validationMessage);\n }\n\n $wishlist->setFromArray($values)->save();\n $db->commit();\n\n //PRIVACTY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = 'owner';\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n foreach ($roles as $i => $role) {\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\n }\n $db->commit();\n // Change request method POST to GET\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }", "public function editAction() {\r\n\r\n //SET LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //ONLY LOGGED IN USER CAN CREATE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET WISHLIST ID AND CHECK VALIDATION\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n if (empty($wishlist_id)) {\r\n return $this->_forward('notfound', 'error', 'core');\r\n }\r\n\r\n //GET WISHLIST OBJECT\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n $level_id = $viewer->level_id;\r\n\r\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Edit();\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n\r\n //PRIVACY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n $perms = array();\r\n foreach ($roles as $roleString) {\r\n $role = $roleString;\r\n if ($auth->isAllowed($wishlist, $role, 'view')) {\r\n $perms['auth_view'] = $roleString;\r\n }\r\n }\r\n\r\n $form->populate($wishlist->toArray());\r\n $form->populate($perms);\r\n return;\r\n }\r\n\r\n //FORM VALIDATION\r\n if (!$form->isValid($this->getRequest()->getPost())) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getItemTable('sitestoreproduct_wishlist')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n\r\n //SAVE DATA\r\n $wishlist->setFromArray($values);\r\n $wishlist->save();\r\n\r\n //PRIVACTY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n\r\n if (empty($values['auth_view'])) {\r\n $values['auth_view'] = array('everyone');\r\n }\r\n\r\n $viewMax = array_search($values['auth_view'], $roles);\r\n foreach ($roles as $i => $role) {\r\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //GET URL\r\n $url = $this->_helper->url->url(array('wishlist_id' => $wishlist->wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\", true);\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'smoothboxClose' => 10,\r\n 'parentRedirect' => $url,\r\n 'parentRedirectTime' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your wishlist has been edited successfully.'))\r\n ));\r\n }", "private function setAdmins($ids,$log=false){\n \t$adminPermission = $this->getAdminPermission();\n \tforeach ($ids as $id)\n \t\tNewDao::getInstance()->insert('user_permissions',array('user_id'=>$id,'permission_id'=>$adminPermission),$log);\n }", "function addDishChoices($data){\n\n\t\t$return = $this->db->insert_batch('tbl_dish_choice',$data);\n\t\treturn $return;\n\t\t\n\t}", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }", "function metaboxTabWishlist ( $locale )\n\t{\n\t\twp_nonce_field( 'avhamazon-metabox', 'avhamazon_ajax_nonce', false );\n\t\t$wishlist_id = $this->core->getOption( 'wishlist_id', 'shortcode' );\n\t\techo '<div id=\"avhamazon_tab_wishlist\" class=\"avhamazon-tabs-panel\">';\n\t\techo '\t<div id=\"avhamazon-wishlist-show\" style=\"display:block\">';\n\t\techo '\t\t<p>';\n\t\techo '\t\t\t<label style=\"display:block\">' . __( 'Wish List ID:', 'avhamazon' );\n\t\techo '\t\t\t<input style=\"width: 13em\" type=\"text\" value=\"' . $wishlist_id . '\" id=\"avhamazon_scwishlist_wishlist\" name=\"avhamazon_scwishlist_wishlist\" autocomplete=\"on\"/>';\n\t\techo '\t\t\t</label>';\n\t\techo '\t\t\t<label style=\"display:block\">' . __( 'Locale Amazon:', 'avhamazon' );\n\t\techo '\t\t\t<select id=\"avhamazon_scwishlist_locale\" name=\"avhamazon_scwishlist_locale\" />';\n\t\t$seldata = '';\n\t\tforeach ( $this->core->locale_table as $key => $value ) {\n\t\t\t$seldata .= '<option value=\"' . $key . '\" ' . (($locale == $key) ? 'selected=\"selected\"' : '') . ' >' . $value . '</option>' . \"\\n\";\n\t\t}\n\t\techo $seldata;\n\t\techo '\t\t\t</select></label>';\n\t\techo '\t\t\t<br />';\n\n\t\techo '\t\t\t<input class=\"button-secondary\" type=\"submit\" value=\"Show Items\" id=\"avhamazon_submit_wishlist\" name=\"avhamazon_submit_wishlist\" />';\n\t\techo '\t\t</p>';\n\t\techo '\t</div>';\n\t\techo '<div id=\"avhamazon_wishlist_loading\" style=\"display:hide\">';\n\t\techo '\t<p>Searching <img src=\"' . $this->core->info['graphics_url'] . '/ajax-loader.gif\"></p>';\n\t\techo '</div>';\n\t\techo '\t<div id=\"avhamazon_wishlist_output\"></div>';\n\t\techo '</div>';\n\t}", "public function update(Request $request, Wishlist $wishlist)\n {\n //\n }", "public function update(Request $request, Wishlist $wishlist)\n {\n //\n }", "public function setIDs( array $ids ): self\n {\n $this -> ids = $ids;\n return $this;\n }", "public function setProductIDs($productIDs)\n {\n $parameters = $this->request->getParameters();\n $parameters['id'] = $productIDs;\n $this->recommendationsUpToDate = false;\n }", "public function setId($id)\n {\n $this->id = $id;\n if ( ! array_key_exists($this->id, static::$basket)) {\n static::$basket[$this->id] = array();\n }\n }", "public function setSchoolsIds(?array $value): void {\n $this->getBackingStore()->set('schoolsIds', $value);\n }", "public function add_to_wishlist(){\n\t\t\t$array = array(\n\t\t\t\n\t\t\t\"user_id\"\t\t=> $this->input->post('type'),\n\t\t\t\"product_id\"\t\t=> $this->input->post('product_id')\n\t\t\t\t\n\n\t\t\t);\n\t\t\t$user_row = $this->Users_model->checkwhislistexist($this->input->post('product_id'),$this->session->userdata('user_id'));\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tif($user_row){\n\n\t\t\t\t\t//$password = $this->Common_model->decryptIt($user_record,TRUE);\n\t\t\t\t\t//$email_arr = array(\"password\"=>$password,\"email\"=>$array['email'],\"name\"=>$array['first_name']);\n\t\t\t\t\t//$result = $this->Emailtemplates_model->sendEmail('verification',$email_arr);\n\t\t\t\t\t$arr['success'] = false;\n\t\t\t\t\t$arr['message']\t= 'Already Exists In Favourites.';\n\t\t\t\t}else{\n\t\t\t\t\t$contact_id = $this->Users_model->insertproductwhishlist($array);\n\t\t\t\t\t//$password = $this->Common_model->decryptIt($user_record,TRUE);\n\t\t\t\t\t//$email_arr = array(\"password\"=>$password,\"email\"=>$array['email'],\"name\"=>$array['first_name']);\n\t\t\t\t\t//$result = $this->Emailtemplates_model->sendEmail('verification',$email_arr);\n\t\t\t\t\t$arr['success'] = true;\n\t\t\t\t\t$arr['message']\t= 'Register successfully.';\n\t\t\t\t}\n\t\t\t\n\t\techo json_encode($arr);\n\n\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "function mark_as_awarded()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['list'])) $result = $this->_bid->mark_as_awarded(explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The selected bids have been marked as awarded.': 'ERROR: The selected bids could not be awarded.';\n\t\tif(!empty($result['not_awarded'])) {\n\t\t\t$data['msg'] .= \"<BR><BR>The following bids do not qualify to be awarded: \";\n\t\t\tforeach($result['not_awarded'] AS $row){\n\t\t\t\t$data['msg'] .= \"<BR>\".$row['provider'].\" (\".$row['bid_currency'].format_number($row['bid_amount'],3).\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public function products_id()\n {\n foreach ($_SESSION['cart'] as $id => $quaty){\n $product_id[] = \"($id, $quaty)\";\n $product = Data::find_by_id($id);\n $id = array('id' => 'No: '. $product->id, 'name' => ' '. $product->name, 'price' => ' €'.$product->price, 'quaty' => ' qty '.$quaty, 'cost' => ' = €'.$product->price * $quaty .'</br>');\n foreach ($id as $key => $value){\n echo /*$key .' = '.*/ $value; /*echo \", \"; &nbsp; = spatie*/\n }\n }\n // $insert_id = implode(',', $product_id);\n }", "function supprimerArticleWishlist($libelleProduit){\n //Si le panier existe\n if (creationPanier() && !isVerrouille())\n {\n //Nous allons passer par un panier temporaire\n $tmp=array();\n $tmp['libelleProduit'] = array();\n $tmp['idProduit'] = array();\n $tmp['qteProduit'] = array();\n $tmp['prixProduit'] = array();\n $tmp['enseigne'] = array();\n $tmp['idEnseigne'] = array();\n $tmp['mediaProduit'] = array();\n $tmp['pourcentageReverse'] = array();\n $tmp['verrou'] = $_SESSION['wishlist']['verrou'];\n\n for($i = 0; $i < count($_SESSION['wishlist']['libelleProduit']); $i++)\n {\n if ($_SESSION['wishlist']['libelleProduit'][$i] !== $libelleProduit)\n {\n array_push( $tmp['libelleProduit'],$_SESSION['wishlist']['libelleProduit'][$i]);\n array_push( $tmp['idProduit'],$_SESSION['wishlist']['idProduit'][$i]);\n array_push( $tmp['qteProduit'],$_SESSION['wishlist']['qteProduit'][$i]);\n array_push( $tmp['prixProduit'],$_SESSION['wishlist']['prixProduit'][$i]);\n array_push($tmp['enseigne'], $_SESSION['wishlist']['enseigne'][$i]);\n array_push($tmp['idEnseigne'], $_SESSION['wishlist']['idEnseigne'][$i]);\n array_push($tmp['mediaProduit'], $_SESSION['wishlist']['mediaProduit'][$i]);\n array_push($tmp['pourcentageReverse'], $_SESSION['wishlist']['pourcentageReverse'][$i]);\n }\n\n }\n //On remplace le panier en session par notre panier temporaire à jour\n $_SESSION['wishlist'] = $tmp;\n //On efface notre panier temporaire\n unset($tmp);\n }\n else\n echo \"Un problème est survenu veuillez contacter l'administrateur du site.\";\n}", "public function amenityIds()\n {\n $this->attributes['amenityIds'] = $this->amenities->pluck('id');\n }", "function SetId($value) { $this->id=$value; }", "public function setTermIds(?array $value): void {\n $this->getBackingStore()->set('termIds', $value);\n }", "public function addWishList()\n {\n $pro_id = $this->input->post('pro_id');\n $user_id = $this->input->post('user_id');\n $item = $this->f_usersmodel->getFirstRowWhere('wishlist',array(\n 'pro_id' => $pro_id, 'user_id' => $user_id\n ));\n if(!empty($item)){\n $check = false;\n $data['mess'] = 'Sản phẩm này đã có trong danh sách sản phẩm yêu thích của bạn!';\n }else{\n $check = true;\n $this->f_usersmodel->Add('wishlist',array(\n 'pro_id' => $pro_id,\n 'user_id' => $user_id\n ));\n }\n $data['check'] = $check;\n echo json_encode($data);\n }", "function addCategory($object) {\n $object->Item->ShopId = 'yourReturnedCategoryIdOnMarketplace_'.rand(1000, 9999); \n}", "function fn_wishlist_get_count()\n{\n $wishlist = array();\n $result = 0;\n\n if (!empty(Tygh::$app['session']['wishlist'])) {\n $wishlist = & Tygh::$app['session']['wishlist'];\n $result = !empty($wishlist['products']) ? count($wishlist['products']) : 0;\n }\n\n /**\n * Changes wishlist items count\n *\n * @param array $wishlist wishlist data\n * @param int $result wishlist items count\n */\n fn_set_hook('wishlist_get_count_post', $wishlist, $result);\n\n return empty($result) ? -1 : $result;\n}", "private function setUsers($ids,$log=false){\n \t$userPermission = $this->getUserPermission();\n \tforeach ($ids as $id)\n \t\tNewDao::getInstance()->insert('user_permissions',array('user_id'=>$id,'permission_id'=>$userPermission),$log);\n }", "public function setId($_id);", "public function addToFavorites($objid);", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'prod_id' => 'required',\n ]);\n\n if ($validator->fails()) {\n return response()->json(array('status' => false, 'message' => $validator->messages()), 500);\n }\n if(!Wishlist::where('user_id',auth('api')->user()->id)->where('prod_id',$request->prod_id)->exists()){\n $wishlist = new Wishlist();\n $wishlist->user_id = auth('api')->user()->id;\n $wishlist->prod_id = $request->prod_id;\n $wishlist->save();\n $userWishlist = Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$userWishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n $userWishlist = $products;\n\n }else{\n $wish = Wishlist::where('user_id',auth('api')->user()->id)->where('prod_id',$request->prod_id)->first();\n Wishlist::find($wish->id)->delete();\n if(count(Wishlist::where('user_id','=',auth('api')->user()->id)->get()) > 0){\n $userWishlist= Wishlist::where('user_id','=',auth('api')->user()->id)->get()->pluck('prod_id');\n\n $products = array();\n $i = 0;\n $pro = Product::whereIn('id',$userWishlist)->get();\n\n foreach ($pro as $prod) {\n\n $prodBrand = Brand::where('id', '=', $prod->brand)->first();\n\n $products[$i] = $prod;\n $prod->color = $prod->color()->pluck('colour')->implode('colour');\n $prod->size = $prod->size()->pluck('size')->implode('size');\n $prod->image = $prod->image()->pluck('image');\n\n if ($prodBrand == null) {\n $products[$i]['brand'] = \"No Brand\";\n } else {\n $products[$i]['brand'] = $prodBrand->name;\n }\n\n\n $i++;\n\n }\n $userWishlist = $products;\n\n }else{\n $userWishlist= 'Your Wishlist is empty!';\n }\n }\n\n\n\n return response()->json(array('status' => true,'message' => 'wishlist saved.','records'=>$userWishlist), 200);\n }", "public function updateStockId();", "function cart_wishlist_update($mode,$db,$item,$cart_id,$user_name,$json_update,$cart_expire,$available){\n $paid = 0;\n if($mode == 'wishlist'){\n $cartQ = $db->query(\"SELECT * FROM wishlist WHERE username = '{$user_name}'\");\n }else{\n $cartQ = $db->query(\"SELECT * FROM cart WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n }\n\n $return = mysqli_num_rows($cartQ);\n if($return != 1){\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n if($mode != 'wishlist'){\n $items_json = json_encode($item);\n $db->query(\"INSERT INTO cart (items,username,expire_date) VALUES ('{$items_json}','{$user_name}','{$cart_expire}')\");\n $cart_id = $db->insert_id; //return the last inserted item in database\n $_SESSION['cartid'] = $cart_id;\n $_SESSION['success_flash'] = ' Item added to Cart successfully.';\n }else{\n $db->query(\"INSERT INTO wishlist (id,username,items,expire_date) VALUES ('{$cart_id}','{$user_name}','{$json_update}','{$cart_expire}')\");\n $_SESSION['success_flash'] = 'wishlist update successful..';\n }\n }else{\n $cart = mysqli_fetch_assoc($cartQ);\n $previous_items = json_decode($cart['items'],true); //makes it an associated array not an object\n $item_match = 0;\n $new_items = array();\n //$_SESSION['success_flash'] = $product['title']. ' in loop.';\n foreach ($previous_items as $pitem){\n if($item[0]['id'] == $pitem['id'] && $item[0]['size'] == $pitem['size']){\n\n if($mode == 'cart'){\n if($available == 0){\n $pitem['quantity'] = $pitem['quantity']; // do not update quantity for same item\n }else{\n $pitem['quantity'] =$pitem['quantity'] + $item[0]['quantity'];\n }\n }else{\n $pitem['quantity'] =$pitem['quantity'] + $item[0]['quantity'];\n }\n $item_match = 1;\n }\n $new_items[] = $pitem;\n }\n\n if($item_match != 1){\n $new_items = array_merge($item,$previous_items);\n }\n $items_json = json_encode($new_items);\n $cart_expire = date(\"Y-m-d H:i:s\",strtotime(\"+30 days\"));\n if($mode != 'wishlist'){\n $db->query(\"UPDATE cart SET items = '{$items_json}', expire_date = '{$cart_expire}' WHERE username = '{$user_name}' AND paid = '{$paid}'\");\n $_SESSION['success_flash'] = 'cart update successful..';\n }else{\n $db->query(\"UPDATE wishlist SET items = '{$items_json}', expire_date = '{$cart_expire}' WHERE username = '{$user_name}'\");\n $_SESSION['success_flash'] = 'wishlist update successful..';\n }\n\n }\n}", "public function registerWishlistChange(Varien_Event_Observer $observer)\n {\n if (Mage::helper('core')->isModuleEnabled('Enterprise_Wishlist') &&\n Mage::helper('enterprise_wishlist')->isMultipleEnabled()) {\n /** @var Mage_Wishlist_Model_Wishlist $wishlist */\n $wishlist = $observer->getEvent()->getObject();\n $wishlistId = $wishlist->getId();\n if ($wishlistId) {\n try {\n $websiteId = $this->getWishlistOwnerWebsiteId($wishlist);\n /** @var Oro_Api_Model_Wishlist_Status $wishlistStatus */\n $wishlistStatus = Mage::getModel('oro_api/wishlist_status')\n ->setWishlistId($wishlistId)\n ->setWebsiteId($websiteId)\n ->setDeletedAt(Mage::getSingleton('core/date')->gmtDate());\n $wishlistStatus->save();\n } catch (Exception $e) {\n Mage::log($e->getMessage());\n }\n }\n }\n\n return $this;\n }" ]
[ "0.77833146", "0.72197264", "0.69523084", "0.68831176", "0.6870222", "0.6384421", "0.61836076", "0.58388215", "0.57524645", "0.57267416", "0.56855893", "0.5679268", "0.5678719", "0.56722623", "0.56636983", "0.5657316", "0.56506354", "0.56194264", "0.56169426", "0.5573204", "0.55546594", "0.55427724", "0.5531069", "0.5521318", "0.5501704", "0.54607254", "0.5448541", "0.5416214", "0.5391522", "0.53887475", "0.53528166", "0.5261957", "0.52593946", "0.5257426", "0.52538186", "0.52538186", "0.524906", "0.5242152", "0.5239644", "0.5225125", "0.51993644", "0.5189091", "0.5183878", "0.5156213", "0.5150909", "0.5146828", "0.5143102", "0.512594", "0.5115472", "0.50990456", "0.5095195", "0.5093103", "0.50877225", "0.5087636", "0.5085188", "0.5079847", "0.5078124", "0.50646955", "0.5055898", "0.50552875", "0.5041392", "0.50299275", "0.502645", "0.502458", "0.5020813", "0.50198466", "0.50071704", "0.4991523", "0.4979371", "0.49761355", "0.49689004", "0.49608335", "0.4955776", "0.4955776", "0.49486572", "0.494713", "0.49407658", "0.49407658", "0.4931026", "0.49279895", "0.49241292", "0.4923838", "0.49225864", "0.49201956", "0.49195623", "0.49175534", "0.49162757", "0.4913445", "0.49132764", "0.49111298", "0.49047244", "0.49012014", "0.48986483", "0.48857072", "0.48834842", "0.4883149", "0.48697153", "0.48692048", "0.48656562", "0.48624885" ]
0.8419035
0
Returns main wishlist item id
public function getWishlistItemId();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWishlistId();", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "public function setWishlistItemId(int $id);", "public function getId_item()\n {\n return $this->id_item;\n }", "public function getIdItem() {\n return intval($this->idItem);\n }", "public function getItemID()\n {\n return $this->itemID;\n }", "public function getItemID()\n {\n return $this->itemID;\n }", "public function getMultipleWishlistId();", "public function getItemId()\n {\n return $this->item_id;\n }", "public function get_id() {\n\t\tif ( isset( $this->item['id'] ) ) {\n\t\t\treturn esc_attr( $this->item['id'] );\n\t\t}\n\n\t\treturn false;\n\t}", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "function get_item_id($item_name) {\n $item_list = make_get_call(\"items\");\n \n foreach ($item_list as $key => $value) {\n if (strtolower($value) == $item_name) return $key;\n }\n \n return $item_list;\n }", "protected function _getItemId(Varien_Object $item)\n {\n return $item->getCode();\n }", "public function get_first_item_id(): int {\n\t\t\treturn LP_Course_DB::getInstance()->get_first_item_id( $this->get_id() );\n\t\t}", "function getItemid() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$user = & JFactory::getUser() ;\r\n\t\t$sql = \"SELECT id FROM #__menu WHERE link LIKE '%index.php?option=com_osmembership%' AND published=1 AND `access` IN (\".implode(',', $user->getAuthorisedViewLevels()).\") ORDER BY `access`\";\t\t\t\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$itemId = $db->loadResult();\t\t\r\n\t\tif (!$itemId) {\r\n\t\t\t$Itemid = JRequest::getInt('Itemid');\r\n\t\t\tif ($Itemid == 1)\r\n\t\t\t\t$itemId = 999999 ;\r\n\t\t\telse \r\n\t\t\t\t$itemId = $Itemid ;\t\r\n\t\t}\t\t\t\r\n\t\treturn $itemId ;\t\r\n\t}", "public function getItemId()\n {\n return $this->getItem()->getId();\n }", "public function getId() {\n if($this->items!==false)\n return @current($this->items)->id_str;\n return false;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "public function getId($item);", "public function getItemId() {\n return $this->item->getItemId();\n }", "public function getItemId()\n\t{\n\t\treturn $this->_itemID;\n\t}", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->itemId;\n }", "public function getId()\r\n {\r\n if (isset($this->data['itemid'])) {\r\n return $this->data['itemid'];\r\n }\r\n return null;\r\n }", "public function getApplyItemId()\n {\n return $this->get(self::_APPLY_ITEM_ID);\n }", "function GetID () {\n return $this->hunt_id;\n }", "public function getItemKey($item) {\n\t\treturn $item->id;\n\t}", "public function getId()\n {\n return $this->source['order_item_id'];\n }", "public function getQuoteItemId() {\n return $this->item->getQuoteItemId();\n }", "public function get_item_id(){\n $this->db->select('itemID')->from('item')->where('itemID', );\n $query = $this->db->get();\n \n if($query->num_rows() == 1)\n {\n $row = $query->row(0);\n return $row->itemID;\n }\n }", "public function setWishlistId(int $id);", "public function getItemId() {\n\t\treturn($this->itemId);\n\t}", "function get_the_ID()\n {\n }", "function nav_menu_item_id( $item_id ) {\n\treturn '';\n}", "protected function get_id_for_item( $item ) {\n\t\tif ( ! empty( $item['id'] ) ) {\n\t\t\treturn $item['id'];\n\t\t}\n\n\t\t// Check to see if the item already had a non-empty ID, else generate one from the title.\n\t\tif ( preg_match( '/id=([\"\\'])(?P<id>[^\"\\']+)\\\\1/', $item['attrs'], $m ) ) {\n\t\t\t$id = $m['id'];\n\t\t} else {\n\t\t\t$id = sanitize_title( $item['title'] );\n\t\t}\n\n\t\t// Append unique suffix if anchor ID isn't unique in the document.\n\t\t$count = 2;\n\t\t$orig_id = $id;\n\t\twhile ( in_array( $id, $this->used_ids ) && $count < 50 ) {\n\t\t\t$id = $orig_id . '-' . $count;\n\t\t\t$count++;\n\t\t}\n\n\t\t$this->used_ids[] = $id;\n\n\t\treturn $id;\n\t}", "public function fetch_the_id() {}", "public static function createItemID(){\n $db = db_conx::getInstance();\n $req = $db->prepare('SELECT ItemID FROM Item ORDER BY ItemID DESC LIMIT 1');\n $req->execute();\n $tempID = $req->fetch();\n return $tempID['ItemID']+1;\n }", "public function getParentItemId()\n {\n return $this->quoteItem->getParentItemId();\n }", "public function getGwId() {\n return $this->item->getGwId();\n }", "function getID(){ return (int)$this->productInfo['products_id']; }", "public function getBuyableIdentifier()\n {\n return method_exists($this, 'getKey') ? $this->getKey() : $this->id;\n }", "public function getId()\n {\n return $this->_list->getId();\n }", "public function getId(object $item): mixed\n {\n return $item->id;\n }", "public function getID()\n {\n return $this->playlistid;\n }", "public static function getActualId()\n {\n if (self::$context->getName() == 'citation'\n && self::getCitationItem()!== false) {\n return self::getCitationItem()->get('id');\n }\n\n return self::getData()->getVariable('id');\n }", "function wcs_get_order_items_product_id( $item_id ) {\n\tglobal $wpdb;\n\n\t$product_id = $wpdb->get_var( $wpdb->prepare(\n\t\t\"SELECT meta_value FROM {$wpdb->prefix}woocommerce_order_itemmeta\n\t\t WHERE order_item_id = %d\n\t\t AND meta_key = '_product_id'\",\n\t\t$item_id\n\t) );\n\n\treturn $product_id;\n}", "public function getItemId()\n\t{\n\t\treturn $this->getTypeId();\n\t}", "public function getItemId();", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "protected function getWidgetId()\n {\n return !empty($_GET['wid']) ? $_GET['wid'] : 'rrf';\n }", "public static function getId(){\n return 'bigitems';\n }", "public function main() {\n return $this->id;\n }", "public function main() {\n return $this->id;\n }", "function column_id($item)\n {\n // links going to /admin.php?page=[your_plugin_page][&other_params]\n // notice how we used $_REQUEST['page'], so action will be done on curren page\n // also notice how we use $this->_args['singular'] so in this example it will\n // be something like &person=2\n\n $actions = array(\n\n //'edit' => sprintf('<a href=\"admin.php?page=%snew_meal_item&action=edit&id=%s\">%s</a>', $_REQUEST[''], $item['item_id'], __('Edit', 'bc_booking_system')),\n 'delete' => sprintf('<a href=\"?tab=wspra_api_log&page=%s&action=delete&id=%s\">%s</a>', sanitize_text_field($_REQUEST['page']), esc_attr($item['id']), __('Delete', 'bc_booking_system')),\n //'view' => sprintf('<a href=\"?page=%s&action=view&id=%s\">%s</a>', $_REQUEST['page'], $item['ID'], __('View', 'bc_booking_system')),\n );\n\n return sprintf('%s %s',\n\n $item['id'],\n $this->row_actions($actions)\n );\n\n }", "protected function getRemoteId(&$item)\n {\n $remote_id = null;\n if(!empty($item['booking_id']))\n {\n $remote_id = $item['booking_id'];\n unset($item['booking_id']);\n }\n if(!empty($item['remote_id']))\n {\n $remote_id = $item['remote_id'];\n unset($item['remote_id']);\n }\n return ($this->usePrefix ? $this->prefix: '') . $remote_id;\n }", "public function itemID($value = null)\n\t{\n\t\tif ($value != null)\n\t\t{\n\t\t\t$this->_itemID = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_itemID;\n\t\t}\n\t}", "function getitemid($item_id)\r\n{\r\n require_once(\"heading.php\");\r\n$item = $_POST[\"items\"];\r\n$player = $_POST[\"character\"];\r\nif ($item == 'Bag')\r\n $item_id = (int)23162;\r\nif ($item == 'Phoenix')\r\n $item_id = (int)32458;\r\nif ($item == 'Raven')\r\n $item_id = (int)32768;\r\nif ($item == 'PrimalNether')\r\n $item_id = (int)23572; \r\nif ($item == 'NetherVortex')\r\n $item_id = (int)30183;\r\nif ($item == 'AVMark')\r\n $item_id = (int)20560;\r\nif ($item == 'MercilessD')\r\n $item_id = (int)34092;\r\nif ($item == 'Murloc')\r\n $item_id = (int)33079;\r\nif ($item == 'Tiger60')\r\n $item_id = (int)33225;\r\nif ($item == 'Tiger30')\r\n $item_id = (int)33224;\r\nif ($item == 'Ogre')\r\n $item_id = (int)23716;\r\nif ($item == 'BattleBear')\r\n $item_id = (int)38576;\r\nif ($item == 'FlyingBroom')\r\n $item_id = (int)33182;\r\nif ($item == 'XRocket')\r\n $item_id = (int)35226;\r\n\r\nreturn $item_id;\r\n}", "public function getParentItemId() {\n return $this->item->getParentItemId();\n }", "function the_ID()\n {\n }", "public static function get_item_id($pm)\n\t{\n\t\treturn (int) $pm['msg_id'];\n\t}", "public function getShopifyId() {\n return $this->getShopifyProperty('id');\n }", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function getItemId() {\n $item_id = $this->request_stack->getCurrentRequest()->query->get('item_id');\n if(!$item_id) {\n throw new InvalidArgumentException('Item id is not valid.');\n }\n return $this->request_stack->getCurrentRequest()->query->get('item_id');\n }", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "public static function getRealItemID($item_id)\n\t{\n\t\t$arr = Data::getItemArray($item_id);\n\t\tif ($arr) {\n\t\t\treturn $arr['item_id'];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public abstract function get_default_list_id();", "public function get_itemid($params) {\n global $DB;\n\n $item = $DB->get_record_sql('SELECT id FROM {workshop_submissions}\n WHERE workshopid = ?\n AND authorid = ?\n AND content = ?',\n array($params->moduleid, $params->userid, $params->onlinetext)\n );\n\n return ($item) ? $item->id : 0;\n }", "static public function GetGETItemId() {\n if (isset(self::$itemId))\n return self::$itemId;\n else\n return false;\n }", "protected function getCurrentDashbaordItem() {\n\t\t\n\t\treturn \"home\";\n\t}", "public function getId()\n\t{\n\t\treturn $this->_themeExtras['id'];\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public function getFeedItemTargetId()\n {\n return isset($this->feed_item_target_id) ? $this->feed_item_target_id : null;\n }", "public function getExtOrderItemId() {\n return $this->item->getExtOrderItemId();\n }", "function column_id( $item ) {\n\t\tif ( isset( $_REQUEST['page'] ) ) {\n\t\t\t$actions = array(\n\t\t\t\t'delete' => sprintf( '<a href=\"?page=%s&action=%s&assessment_result=%s\">Delete</a>', sanitize_text_field( wp_unslash( $_REQUEST['page'] ) ), 'delete', $item['id'] ),\n\t\t\t);\n\t\t\treturn sprintf( '%1$s %2$s', $item['id'], $this->row_actions( $actions ) );\n\t\t}\n\t}", "protected function getCurrentWarehouseId()\n\t{\n\t\tstatic $warehouse = 0;\n\n\t\tif ($warehouse == 0)\n\t\t{\n\t\t\t$warehouse = -1;\n\t\t\tif ((int)Tools::getValue('warehouse'))\n\t\t\t\t$warehouse = (int)Tools::getValue('warehouse');\n\t\t\telse if ((int)$this->context->cookie->warehouse)\n\t\t\t\t$warehouse = (int)$this->context->cookie->warehouse;\n\t\t\t$this->context->cookie->warehouse = $warehouse;\n\t\t}\n\n\t\treturn $warehouse;\n\t}", "public function getItemIdentifier() : string\n\t{\n\t\treturn $this->itemIdentifier;\n\t}", "public function getDishId()\n {\n return $this->_dishId;\n }", "public function list_id()\n\t{\n\t\treturn $this->list;\n\t}", "public function getPurchasableId();", "public function getItemIdentifier()\n {\n return $this->itemIdentifier;\n }", "private function getCurrentWebsiteId()\n {\n return $this->storeManager->getWebsite()->getId();\n }", "public function getWishlistOwnerWebsiteId($wishlist)\n {\n $customerId = $wishlist->getCustomerId();\n if ($customerId) {\n /** @var Mage_Customer_Model_Customer $owner */\n $owner = Mage::getModel(\"customer/customer\");\n $owner->load($customerId);\n if ($owner->getId()) {\n return $owner->getWebsiteId();\n }\n }\n\n return null;\n }", "public function getItemId(): ?string\n\t{\n\t\treturn $this->itemId;\n\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "public function getListingId() {\n\treturn ($this->listingId);\n}", "private function get_current_id() {\n\n\t\tstatic $id = null;\n\n\t\treturn $id ?: $id = \\get_queried_object_id();\n\t}", "function get_item_kit_id($item_kit_id)\n\t{\n\t\t$query = $this->db->where('item_kit_id',$item_kit_id)\n\t\t\t\t->where(\"category\", \"tickets\")\n\t\t\t\t->get(\"item_kits\");\n\n\t\tif($query->num_rows()==1)\n\t\t{\n\t\t\treturn $query->row()->item_kit_id;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function _getUrlStore($item)\n {\n\tMage::log(\"wishlist\");\n $storeId = null;\n if ($item instanceof Celebros_Salesperson_Model_Api_QwiserProduct) {\n \tif(key_exists(Mage::Helper('salesperson/mapping')->getMapping('visible'),$item->Field) && key_exists(Mage::Helper('salesperson/mapping')->getMapping('store_id'),$item->Field)){\n\t if ($item->Field[Mage::Helper('salesperson/mapping')->getMapping('visible')] == '1' ) {\n\t $storeId = $item->Field[Mage::Helper('salesperson/mapping')->getMapping('store_id')];\n\t }\n \t}\n }\n return Mage::app()->getStore($storeId);\n }", "public function getWf_id()\n {\n return $this->wf_id;\n }", "public function getFeedItemTargetIdUnwrapped()\n {\n return $this->readWrapperValue(\"feed_item_target_id\");\n }", "public function getBuyerId();" ]
[ "0.7601552", "0.7053714", "0.6650579", "0.65976834", "0.65189105", "0.64953774", "0.64953774", "0.64747316", "0.6419301", "0.64177823", "0.64134264", "0.62727946", "0.6252901", "0.6221871", "0.61860734", "0.6182731", "0.61710066", "0.61578333", "0.61578333", "0.61578333", "0.6150575", "0.6125093", "0.60996443", "0.6069252", "0.6069252", "0.6069252", "0.6069252", "0.6069252", "0.6058979", "0.6054154", "0.60243845", "0.6001938", "0.599274", "0.59904164", "0.5982549", "0.5978231", "0.59587175", "0.5947481", "0.5913073", "0.5875325", "0.5871739", "0.5866096", "0.5849719", "0.5841081", "0.58344483", "0.5817545", "0.58162594", "0.5811017", "0.57855266", "0.57843935", "0.5775286", "0.5768686", "0.5763833", "0.5761542", "0.57458436", "0.5745429", "0.5729544", "0.5717931", "0.5717931", "0.5704435", "0.5692258", "0.56876224", "0.5687242", "0.5676857", "0.56765777", "0.5669951", "0.5659603", "0.5657017", "0.5657017", "0.5647986", "0.5623294", "0.5620853", "0.5606361", "0.5595468", "0.558498", "0.557186", "0.55692065", "0.5569047", "0.5569047", "0.5569047", "0.55652106", "0.5557919", "0.5556472", "0.55547124", "0.55517054", "0.5537417", "0.55274737", "0.5522315", "0.55159444", "0.5515025", "0.55117327", "0.5511486", "0.550994", "0.55070084", "0.5499272", "0.54950684", "0.5467314", "0.5462575", "0.5459916", "0.5459732" ]
0.7674961
0
Set main wishlist item id
public function setWishlistItemId(int $id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setWishlistId(int $id);", "public function getWishlistItemId();", "public function getWishlistId();", "function setId_item($iid_item = '')\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "function setId_item($iid_item)\n {\n $this->iid_item = $iid_item;\n }", "public function setMultipleWishlistId($id);", "public function setId($id)\r\n {\r\n $this->data['itemid'] = (int) $id;\r\n }", "function setItemId($a_item_id)\n\t{\n\t\t$this->item_id = $a_item_id;\n\t}", "public function tempId()\n {\n $this->id = uniqid('item');\n }", "public function setId_item($id_item)\n {\n $this->id_item = $id_item;\n\n return $this;\n }", "public function getMultipleWishlistId();", "private function getWishlistId()\n {\n if (Tools::getIsset('id_wishlist')) {\n return (int) Tools::getValue('id_wishlist');\n }\n\n if (Tools::getIsset('token')) {\n $wishlistData = WishList::getByToken(\n Tools::getValue('token')\n );\n\n if (!empty($wishlistData['id_wishlist'])) {\n return $wishlistData['id_wishlist'];\n }\n }\n\n return false;\n }", "function setId($id) {\r\n\t\t// Set item id and wipe data\r\n\t\t$this->_id\t = $id;\r\n\t\t$this->_item\t\t= null;\r\n\t}", "function SetItemcommentid($value) { $this->itemCommentId=$value; }", "public function updateItem($_id) {\n\t}", "private function _setListId()\r\n { \r\n if (Mage::getSingleton('admin/session')->isLoggedIn()) {\r\n $storeId = Mage::app()->getRequest()->getParam('store_id');\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId', $storeId); \r\n } else {\r\n $this->_listId = Mage::getStoreConfig('remarketing/listraklistids/listrakListId');\r\n }\r\n }", "private function updateWishlistId(int $wishlistId, int $quantity)\r\n {\r\n $wishlistItem = Wishlist::find($wishlistId);\r\n $wishlistItem->quantity = $quantity;\r\n $wishlistItem->save();\r\n }", "function addCategory($object) {\n $object->Item->ShopId = 'yourReturnedCategoryIdOnMarketplace_'.rand(1000, 9999); \n}", "public function itemID($value = null)\n\t{\n\t\tif ($value != null)\n\t\t{\n\t\t\t$this->_itemID = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_itemID;\n\t\t}\n\t}", "protected function _construct()\n {\n $this->_init('cminds_multiwishlist/item', 'wishlist_item_id');\n }", "function clear_item_id($id, $item, $args) {\n return \"\";\n}", "function set_list_id($list_id) {\n $this->_subscribers_base_route = $this->_base_route.'subscribers/'.$list_id;\n }", "function addArticle($object) {\n $object->Item->ShopId = 'yourReturnedArticleIdOnMarketplace_'.rand(1000, 9999); \n}", "public function getId($item);", "function as_action_init_wish_list() {\n global $wpdb;\n $page_found = $wpdb->get_var(\"SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_name` = 'wishlist' LIMIT 1;\");\n if ($page_found) {\n update_option('as-wishlist-page-id', $page_found);\n return;\n }\n\n $page_data = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_author' => 1,\n 'post_name' => esc_sql(_x('wishlist', 'page_slug', 'as')),\n 'post_title' => __('Wishlist', 'as'),\n 'post_content' => '[as_wish_list]',\n 'post_parent' => 0,\n 'comment_status' => 'closed'\n );\n $page_id = wp_insert_post($page_data);\n update_option('as-wishlist-page-id', $page_id);\n}", "private function setItemId(string $itemId) {\n $this->itemId = $itemId;\n }", "public function getId_item()\n {\n return $this->id_item;\n }", "protected function _getItemId(Varien_Object $item)\n {\n return $item->getCode();\n }", "function addVako($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoIdOnMarketplace_'.rand(1000, 9999); \n}", "public function set_id(int $_id){\n $this->_id = $_id;\n\n return $this;\n }", "function set_accordion_id() {\n\t\t\t$this->current_accordion_slug++;\n\t\t}", "public function changeShelfWish($id){\n $library = Library::find(Auth::user()->library->id);\n $do = ['do'=> 0];\n $library->books()->attach($id, $do);\n return redirect('/library/showWishList');\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "public function setItemId($value)\n {\n return $this->set(self::_ITEM_ID, $value);\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "function SetItemfileid($value) { $this->itemFileId=$value; }", "public function setPrimary_key($a_id = '')\n {\n if (is_array($a_id)) {\n $this->aPrimary_key = $a_id;\n foreach ($a_id as $nom_id => $val_id) {\n if (($nom_id == 'id_item') && $val_id !== '') $this->iid_item = (int)$val_id; \n }\n }\n }", "public function setPrimary_key($a_id = '')\n {\n if (is_array($a_id)) {\n $this->aPrimary_key = $a_id;\n foreach ($a_id as $nom_id => $val_id) {\n if (($nom_id == 'id_item') && $val_id !== '') $this->iid_item = (int)$val_id; \n }\n }\n }", "public function setId($id)\n\t{\n\t\t$this->_themeExtras['id'] = $id;\n\t}", "function _nav_menu_item_id_use_once($id, $item)\n {\n }", "public function setApplyItemId($value)\n {\n return $this->set(self::_APPLY_ITEM_ID, $value);\n }", "public function cartAction()\n {\n if (!$this->_validateFormKey()) {\n return $this->_redirect('*/*');\n }\n $itemId = (int) $this->getRequest()->getParam('item');\n\n /* @var $item Mage_Wishlist_Model_Item */\n $item = Mage::getModel('wishlist/item')->load($itemId);\n if (!$item->getId()) {\n return $this->_redirect('*/*');\n }\n $wishlist = $this->_getWishlist($item->getWishlistId());\n if (!$wishlist) {\n return $this->_redirect('*/*');\n }\n\n // Set qty\n $qty = $this->getRequest()->getParam('qty');\n if (is_array($qty)) {\n if (isset($qty[$itemId])) {\n $qty = $qty[$itemId];\n } else {\n $qty = 1;\n }\n }\n $qty = $this->_processLocalizedQty($qty);\n if ($qty) {\n $item->setQty($qty);\n }\n\n /* @var $session Mage_Wishlist_Model_Session */\n $session = Mage::getSingleton('wishlist/session');\n $cart = Mage::getSingleton('checkout/cart');\n\n $redirectUrl = Mage::getUrl('*/*');\n\n try {\n $options = Mage::getModel('wishlist/item_option')->getCollection()\n ->addItemFilter(array($itemId));\n $item->setOptions($options->getOptionsByItem($itemId));\n \n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null;\n if($itemBuyRequest['super_attribute']) {\n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n $itemBuyRequest->setData('product', $childProduct->getId());\n } \n\n $buyRequest = Mage::helper('catalog/product')->addParamsToBuyRequest(\n $this->getRequest()->getParams(),\n array('current_config' => $itemBuyRequest)\n );\n \n // Overwrite stored product with loaded simple configurable because it holds stock info\n if($childProduct) {\n $buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n }\n $item->mergeBuyRequest($buyRequest);\n \n if ($item->addToCart($cart, true)) {\n $cart->save()->getQuote()->collectTotals();\n }\n\n $wishlist->save();\n Mage::helper('wishlist')->calculate();\n\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n }\n Mage::helper('wishlist')->calculate();\n\n $product = Mage::getModel('catalog/product')\n ->setStoreId(Mage::app()->getStore()->getId())\n ->load($item->getProductId());\n $productName = Mage::helper('core')->escapeHtml($product->getName());\n $message = $this->__('%s was added to your shopping cart.', $productName);\n Mage::getSingleton('catalog/session')->addSuccess($message);\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $session->addError($this->__('This product(s) is currently out of stock'));\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n Mage::getSingleton('catalog/session')->addNotice($e->getMessage());\n $redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));\n } else {\n Mage::getSingleton('catalog/session')->addNotice($e->getMessage());\n $redirectUrl = Mage::getUrl('*/*/configure/', array('id' => $item->getId()));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $session->addException($e, $this->__('Cannot add item to shopping cart'));\n }\n\n Mage::helper('wishlist')->calculate();\n\n return $this->_redirectUrl($redirectUrl);\n }", "public function setId($x) { $this->id = $x; }", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "function SetId($value) { $this->id=$value; }", "public function actionAddToWishlist($product_id, $user_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('wishlist', $saveArr)->execute();\n exit;\n }", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "public function setShoeID($value) {\n\t\t$this->_shoe_id = $value;\n\t}", "function nav_menu_item_id( $item_id ) {\n\treturn '';\n}", "public function setId($_id);", "function setId($value) {\n $this->_id = intval($value);\n }", "function add_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n if ($this->is_wished($product_id) == 'no') {\n array_push($wished, $product_id);\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished)\n ));\n }\n }", "public function setId($id)\n\t{\n\t\tparent::setId($id);\n\t\t$params = $this->getParams();\n\n\t\t// Set elementlist params from picklist params\n\t\t$params->set('allow_frontend_addto', (bool) $params->get('allowadd', false));\n\t}", "function addArticleAttribut($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedAttributIdOnMarketplace_'.rand(1000, 9999); \n}", "function setMetafieldWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n $wishlist = $this->getMetafieldCustomer($customerId,'');\n $wishlistDecoded = json_decode($wishlist, true);\n $productIds = '';\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products !== null or $products !== \"\") {\n $wishlist->setProductIds($productIds);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productIds);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n if(count($wishlistDecoded['metafields']) !== 0) {\n if($wishlistDecoded['metafields'][0]['value'] !== \"\") {\n if(strpos($wishlistDecoded['metafields'][0]['value'], ',') !== false) {\n $productIdTab = explode(',' , $wishlistDecoded['metafields'][0]['value']);\n foreach ($productIdTab as $value) {\n if($value !== \"null\") {\n $productIds .= ',' . $value;\n }\n }\n } else {\n if($wishlistDecoded['metafields'][0]['value'] === \"null\") {\n $productIds = $productId;\n } else {\n $productIds = $wishlistDecoded['metafields'][0]['value'] .',' . $productId;\n }\n\n }\n\n $data = [\n \"metafield\" => [\n \"id\" => $wishlistDecoded['metafields'][0]['id'],\n \"value\" => '' . $productIds . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('PUT', shopifyApiurl . 'metafields/'.$wishlistDecoded['metafields'][0]['id'].'.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n } else {\n $data = [\n \"metafield\" => [\n \"namespace\" => \"wishlist\",\n \"key\" => \"wishlist-products\",\n \"value\" => '' . $productId . '',\n \"value_type\" => 'string',\n ]\n ];\n\n try {\n $client = HttpClient::create();\n $response = $client->request('POST', shopifyApiurl . 'customers/'.$customerId.'/metafields.json', ['json' => $data]);\n } catch (\\Exception $e) {\n var_dump($e);\n }\n }\n\n return new Response('wishlist saved');\n }", "function setWishlist(Request $request) {\n\n $customerId = $request->request->get('customerId');\n $productId = $request->request->get('productId');\n\n $em = $this->getDoctrine()->getManager();\n $wishlist = $em->getRepository('App:Wishlist')->findOneBy(['customerId' => $customerId]);\n if($wishlist) {\n $products = $wishlist->getProductIds();\n if($products == null or $products == \"\") {\n $wishlist->setProductIds($productId);\n } else {\n $wishlist->setProductIds($products . ',' . $productId);\n }\n } else {\n $wishlist = new Wishlist();\n $wishlist->setCustomerId($customerId);\n $wishlist->setProductIds($productId);\n\n $em->persist($wishlist);\n\n }\n\n $em->flush();\n\n return new Response('wishlist saved');\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function edit(Wishlist $wishlist)\n {\n //\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "public function setUseAppID($use_appid) \n \t{\n \t\t$this->use_appid = $use_appid;\n \t}", "public abstract function get_default_list_id();", "function setSwimMeetId($id)\r\n {\r\n $this->_swimmeetid = $id ;\r\n }", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "public static function getId(){\n return 'bigitems';\n }", "public function set_id($_id){\n $this->_id = $_id;\n\n return $this;\n }", "public function getIdItem() {\n return intval($this->idItem);\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "function setSyncItemsCodeProduct()\n {\n }", "public function setWinnerIdAttribute($input)\n {\n $this->attributes['winner_id'] = $input ? $input : null;\n }", "public function updateId() {\n $this->Id = session_id();\n }", "public function additemtowishlist($productid){\n\t\tif($this->checkwishlist($productid)){\n\t\t\t$object=array(\n\t\t\t\t'UserID' => $this->session->userdata('userid'),\n\t\t\t\t'UserEmail' => $this->session->userdata('useremail'),\n\t\t\t\t'Product_Id' => $productid\n\t\t\t);\n\t\t\t$this->db->insert('tbl_wishlist', $object);\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function setItemStoreId(Item $item): void\n {\n if ($this->appState->getAreaCode() === \\Magento\\Backend\\App\\Area\\FrontNameResolver::AREA_CODE) {\n $storeId = $this->storeManager->getStore($this->storeManager->getStore()->getId())\n ->getId();\n $item->setStoreId($storeId);\n } else {\n $item->setStoreId($this->storeManager->getStore()->getId());\n }\n }", "public function set_id(Int $_id){\n $this->_id = $_id;\n\n return $this;\n }", "function addArticleCrossselling($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedCrosssellingIdOnMarketplace_'.rand(1000, 9999); \n \n}", "protected function setMemberDefaults(){\n parent::setMemberDefaults();\n if(!$this->id) $this->id = UniqId::get(\"faq-\");\n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function addToFavorite($account_id, $item_id);", "public function getItemID()\n {\n return $this->itemID;\n }", "public function getItemID()\n {\n return $this->itemID;\n }", "public function setId($id){\n $this->_id = $id;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "public function setMaconomyId(string $key): void\n {\n $this->data['instancekeyField'] = $key;\n }", "public function editAction() {\r\n\r\n //SET LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //ONLY LOGGED IN USER CAN CREATE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET WISHLIST ID AND CHECK VALIDATION\r\n $wishlist_id = $this->_getParam('wishlist_id');\r\n if (empty($wishlist_id)) {\r\n return $this->_forward('notfound', 'error', 'core');\r\n }\r\n\r\n //GET WISHLIST OBJECT\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n $level_id = $viewer->level_id;\r\n\r\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitestoreproduct_Form_Wishlist_Edit();\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n\r\n //PRIVACY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n $perms = array();\r\n foreach ($roles as $roleString) {\r\n $role = $roleString;\r\n if ($auth->isAllowed($wishlist, $role, 'view')) {\r\n $perms['auth_view'] = $roleString;\r\n }\r\n }\r\n\r\n $form->populate($wishlist->toArray());\r\n $form->populate($perms);\r\n return;\r\n }\r\n\r\n //FORM VALIDATION\r\n if (!$form->isValid($this->getRequest()->getPost())) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getItemTable('sitestoreproduct_wishlist')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n\r\n //GET FORM VALUES\r\n $values = $form->getValues();\r\n\r\n //SAVE DATA\r\n $wishlist->setFromArray($values);\r\n $wishlist->save();\r\n\r\n //PRIVACTY WORK\r\n $auth = Engine_Api::_()->authorization()->context;\r\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\r\n\r\n if (empty($values['auth_view'])) {\r\n $values['auth_view'] = array('everyone');\r\n }\r\n\r\n $viewMax = array_search($values['auth_view'], $roles);\r\n foreach ($roles as $i => $role) {\r\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\r\n }\r\n\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n\r\n //GET URL\r\n $url = $this->_helper->url->url(array('wishlist_id' => $wishlist->wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\", true);\r\n\r\n $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'smoothboxClose' => 10,\r\n 'parentRedirect' => $url,\r\n 'parentRedirectTime' => 10,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your wishlist has been edited successfully.'))\r\n ));\r\n }", "function ts_define_current_id()\r\n{\r\n\tdefine('CURRENT_ID',get_the_ID());\r\n}", "function OnAfterAdd(){\n //get keyfield value\n if (intval($this->item_id) == 0)\n $data = $this->Storage->GetRecord(null, array(\n $this->key_field => \"\"));\n $this->item_id = $data[$this->key_field];\n }", "protected function get_id_for_item( $item ) {\n\t\tif ( ! empty( $item['id'] ) ) {\n\t\t\treturn $item['id'];\n\t\t}\n\n\t\t// Check to see if the item already had a non-empty ID, else generate one from the title.\n\t\tif ( preg_match( '/id=([\"\\'])(?P<id>[^\"\\']+)\\\\1/', $item['attrs'], $m ) ) {\n\t\t\t$id = $m['id'];\n\t\t} else {\n\t\t\t$id = sanitize_title( $item['title'] );\n\t\t}\n\n\t\t// Append unique suffix if anchor ID isn't unique in the document.\n\t\t$count = 2;\n\t\t$orig_id = $id;\n\t\twhile ( in_array( $id, $this->used_ids ) && $count < 50 ) {\n\t\t\t$id = $orig_id . '-' . $count;\n\t\t\t$count++;\n\t\t}\n\n\t\t$this->used_ids[] = $id;\n\n\t\treturn $id;\n\t}", "function metabox_id_fix($args){\r\n\t\treturn ( $args['plain'] ? $args['id'] : \"$this->options_name[\" . $args['id'] . \"]\" );\r\n\t}", "public function getItemId()\n {\n return $this->item_id;\n }", "public function setPageID(){/*ACTUALLY NOT DEFINED*/}", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function getUpdate($id) {\n\n\t\t$item = \\App\\Item::find($id);\n\t\t$updated_num = (($item->number_remaining) - 1);\n\n\t\t$item->number_remaining = $updated_num;\n\n\t\t$item->save();\n\n\t\treturn redirect('/wishlist');\n\t}", "private function set_itemCurrentNumber()\n {\n // RETURN maxItemsPerHtmlRow is false\n if ( $this->itemsPerHtmlRow[ 'maxItemsPerHtmlRow' ] === false )\n {\n return;\n }\n // RETURN maxItemsPerHtmlRow is false\n // Increase item number\n // #40354, #40354, 4.1.7, 1+\n $this->itemsPerHtmlRow[ 'currItemNumberAbsolute' ] ++;\n $this->itemsPerHtmlRow[ 'currItemNumberInRow' ] ++;\n }", "function column_id($item)\n {\n // links going to /admin.php?page=[your_plugin_page][&other_params]\n // notice how we used $_REQUEST['page'], so action will be done on curren page\n // also notice how we use $this->_args['singular'] so in this example it will\n // be something like &person=2\n\n $actions = array(\n\n //'edit' => sprintf('<a href=\"admin.php?page=%snew_meal_item&action=edit&id=%s\">%s</a>', $_REQUEST[''], $item['item_id'], __('Edit', 'bc_booking_system')),\n 'delete' => sprintf('<a href=\"?tab=wspra_api_log&page=%s&action=delete&id=%s\">%s</a>', sanitize_text_field($_REQUEST['page']), esc_attr($item['id']), __('Delete', 'bc_booking_system')),\n //'view' => sprintf('<a href=\"?page=%s&action=view&id=%s\">%s</a>', $_REQUEST['page'], $item['ID'], __('View', 'bc_booking_system')),\n );\n\n return sprintf('%s %s',\n\n $item['id'],\n $this->row_actions($actions)\n );\n\n }" ]
[ "0.6877439", "0.66611004", "0.6653046", "0.65225196", "0.64254946", "0.64254946", "0.6311617", "0.62746364", "0.6271517", "0.60921144", "0.59332615", "0.58026314", "0.5771222", "0.5767889", "0.57487905", "0.5683911", "0.55960083", "0.5576344", "0.55379796", "0.54939747", "0.54922056", "0.5438385", "0.5386462", "0.5341245", "0.5339755", "0.5320161", "0.53152347", "0.53128666", "0.5307595", "0.5297086", "0.5276459", "0.52758014", "0.5273078", "0.52620244", "0.52620244", "0.52620244", "0.52620244", "0.52620244", "0.5255798", "0.5250116", "0.5242739", "0.5242739", "0.52152586", "0.5211625", "0.5210382", "0.5204099", "0.52007675", "0.51986593", "0.5193806", "0.5193177", "0.5191832", "0.51774156", "0.51767224", "0.51763505", "0.5172062", "0.51662606", "0.5161286", "0.5151327", "0.51492536", "0.5146598", "0.51461554", "0.51461554", "0.5141382", "0.5136291", "0.5125812", "0.5124207", "0.51031035", "0.5099095", "0.5098172", "0.50951874", "0.5090551", "0.50861573", "0.5076942", "0.50759876", "0.50737816", "0.50565785", "0.5052658", "0.505129", "0.5045631", "0.50413674", "0.5039081", "0.5037682", "0.5035264", "0.5035264", "0.5033235", "0.50302976", "0.50302976", "0.50302976", "0.5029671", "0.5027109", "0.5025459", "0.5022819", "0.50220144", "0.50202733", "0.4998369", "0.49900037", "0.49853167", "0.4982406", "0.4967028", "0.4965766" ]
0.7443844
0
Retrieve existing extension attributes object or create a new one.
public function getExtensionAttributes();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtensionAttributes(): ?ItemRequestExtensionInterface;", "public function getExtensionAttributes(): ?ResultExtensionInterface;", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "function getAdditionalAttributes() ;", "public function requiresExtendedAttributes($url) \n\t{\n\t\t$this->api->parseUrl($url);\n\t\treturn $this->api->call(['command' => 'GetExtAttributes'])->response();\n\t}", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "public function getExtensionAttributes()\n {\n return $this->_getExtensionAttributes();\n }", "private function getExtensionsObject()\n {\n if(!is_object($this->extObj) && !($this->extObj instanceof Extensions)) {\n $this->extObj = GeneralUtility::makeInstance('PITS\\\\Snowbabel\\\\Record\\\\Extensions', $this->confObj);\n }\n }", "public function loadAttributes()\n {\n if (! $this->_attributesLoaded) {\n // send the backend a list of attributes we already have, so the backend can possibly\n // skip re-loading them.\n $presentAttributeNames = array_keys($this->_attributes);\n $newAttributes = $this->_cache->getBackend()->getMissingAttributes($this, $presentAttributeNames);\n $this->_attributes = array_merge($this->_attributes, $newAttributes);\n $this->_attributesLoaded = true;\n }\n return $this;\n }", "public function get($slug)\n\t{\n\t\t// Get the extension.php info\n\t\t$extension = $this->get_extensionphp($slug);\n\n\t\t// If we were given a model, use it. Otherwise,\n\t\t// load it from the database. Either way,\n\t\t// update the extension file.\n\t\tif ($model = Extension::find($slug))\n\t\t{\n\t\t\t// Update the version and enabled flags for the extension.\n\t\t\t$extension['info']['version'] = $model['version'];\n\t\t\t$extension['info']['enabled'] = (bool) $model['enabled'];\n\t\t\t$extension['info']['installed'] = true;\n\t\t\t$extension['info']['has_update'] = $this->has_update($slug);\n\t\t}\n\n\t\tksort($extension['info']);\n\t\treturn $extension;\n\t}", "public function setExtensionAttributes(\\Magento\\Sales\\Api\\Data\\OrderExtensionInterface $extensionAttributes);", "public function testOrderGetExtensionAttributes(): void\n {\n $expectedTax = [\n 'code' => 'US-NY-*-Rate 1',\n 'type' => 'shipping'\n ];\n\n $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID);\n\n $appliedTaxes = $result['extension_attributes']['applied_taxes'];\n self::assertEquals($expectedTax['code'], $appliedTaxes[0]['code']);\n $appliedTaxes = $result['extension_attributes']['item_applied_taxes'];\n self::assertEquals($expectedTax['type'], $appliedTaxes[0]['type']);\n self::assertNotEmpty($appliedTaxes[0]['applied_taxes']);\n self::assertTrue($result['extension_attributes']['converting_from_quote']);\n self::assertArrayHasKey('payment_additional_info', $result['extension_attributes']);\n self::assertNotEmpty($result['extension_attributes']['payment_additional_info']);\n }", "public abstract function getExtension();", "public function setExtensionAttributes(\\Magento\\Tax\\Api\\Data\\AppliedTaxExtensionInterface $extensionAttributes);", "public function getAdditionalAddAttributes(): ?array;", "function GetAttributes();", "protected function fetchAttributes()\n {\n $info = (array)$this->makeSignedRequest('https://api.vk.com/method/users.get.json', array(\n 'query' => array(\n 'uids' => $this->uid,\n //'fields' => '', // uid, first_name and last_name is always available\n 'fields' => 'nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, photo_rec',\n ),\n ));\n\n $info = $info['response'][0];\n\n $this->attributes['id'] = $info->uid;\n $this->attributes['name'] = $info->first_name . ' ' . $info->last_name;\n $this->attributes['url'] = 'http://vk.com/id' . $info->uid;\n\n if (!empty($info->nickname)) {\n $this->attributes['username'] = $info->nickname;\n } else {\n $this->attributes['username'] = 'id' . $info->uid;\n }\n\n $this->attributes['gender'] = $info->sex == 1 ? 'F' : 'M';\n\n $this->attributes['city'] = $info->city;\n $this->attributes['country'] = $info->country;\n\n $this->attributes['timezone'] = timezone_name_from_abbr('', $info->timezone * 3600, date('I'));;\n\n $this->attributes['photo'] = $info->photo;\n $this->attributes['photo_medium'] = $info->photo_medium;\n $this->attributes['photo_big'] = $info->photo_big;\n $this->attributes['photo_rec'] = $info->photo_rec;\n }", "public function getAttributes() {}", "public function getAttributes() {}", "function AddAttr() {\n $db = Core::GetDB();\n\n $title = urldecode(Core::GetFromPOST('title'));\n\n $res = $db->Query(\"SELECT data_xml_item_id FROM data_xml_items WHERE title = ? LIMIT 1\", array(\n array(1, $title, IDBController::PARAM_STR)\n ));\n $id = $res->FetchRow();\n $id = $id[0];\n\n $attrs = array(urldecode(Core::GetFromPOST('attr')));\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "public function setExtensionAttributes(\n \\Pugnet\\Weather\\Api\\Data\\WeatherExtensionInterface $extensionAttributes\n );", "public function getExtension() {\n if ( $this->getExtensionName() === false ) {\n return null;\n } else {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return new ezcReflectionExtension(\n $this->reflectionSource->getExtension()\n );\n } else {\n // using the name, since otherwhise the object would be treated like an\n // external reflection implementation and that would decrease performance\n return new ezcReflectionExtension( parent::getExtensionName() );\n }\n }\n }", "public static function supportedAttributes();", "public function update_extension(){}", "public function getNew($attributes = array());", "protected function _getOpenIdExt($extType, array $propertiesToRequest) {\n\n $ext = null;\n\n if ('ax' == $extType) {\n $ext = new My_OpenId_Extension_AttributeExchange($propertiesToRequest);\n } elseif ('sreg' == $extType) {\n $ext = new Zend_OpenId_Extension_Sreg($propertiesToRequest);\n }\n\n return $ext;\n }", "public function getAttributes() {\n\t\tif(NULL === $this->cachedAttributes) {\n\t\t\t$this->cachedAttributes = [];\n\t\t\tforeach($this->PDO->select(\"SELECT\n SKY_USER_ATTRIBUTE.id,\n valueType,\n SKY_USER_ATTRIBUTE.name,\n SKY_USER_ATTRIBUTE.description,\n icon,\n multiple,\n enabled,\n SKY_USER_ATTRIBUTE_GROUP.name as groupName,\n SKY_USER_ATTRIBUTE_GROUP.description as groupDescription,\n SKY_USER_ATTRIBUTE_GROUP.id as gid\nFROM SKY_USER_ATTRIBUTE\nLEFT JOIN SKY_USER_ATTRIBUTE_GROUP on attr_group = SKY_USER_ATTRIBUTE_GROUP.id\nORDER BY indexing, name\") as $record) {\n\t\t\t\t$attr = AbstractAttribute::create($record);\n\t\t\t\tif ($attr) {\n\t\t\t\t\t$this->cachedAttributes[$record[\"id\"] * 1] = $attr;\n\t\t\t\t\t$this->attributeName2ID[strtolower($record[\"name\"])] = $record[\"id\"] * 1;\n\n\t\t\t\t\tif($gid = $record[\"gid\"]) {\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"name\"] = $name = $record[\"groupName\"];\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"description\"] = $record[\"groupDescription\"];\n\t\t\t\t\t\t$this->cachedAttributeGroupNames2ID[strtolower($name)] = $gid*1;\n\t\t\t\t\t\t$this->attribute2Group[$attr->getId()] = $gid*1;\n\t\t\t\t\t\t$this->group2Attribute[$gid*1][] = $attr->getId();\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\ttrigger_error(\"Can not create user attribute {$record[\"name\"]}\", E_USER_NOTICE);\n\t\t\t}\n\t\t}\n\t\treturn $this->cachedAttributes;\n\t}", "function _loadProductAttributesInfo()\n {\n global $zone;\n\n if ($this->_fBaseProductInfo == null)\n {\n $this->_loadBaseProductInfo();\n }\n $display_product_price_including_taxes = modApiFunc('Settings', 'getParamValue', 'TAXES_PARAMS', \"DISPLAY_PRICES_W_INCLUDED_TAXES\");\n\n $a = (int)$this->_fProductID;\n $b = (int)$this->_fBaseProductInfo[0]['p_type_id'];\n $c = $display_product_price_including_taxes == DB_TRUE ? 1 : 0;\n if (isset(self::$_cache_attr[$a][$b][$c])) {\n $this->_fProductAttributesInfo = self::$_cache_attr[$a][$b][$c];\n return;\n }\n\n $params = array('product_id' => (int)$this->_fProductID,\n 'product_type_id' => (int)$this->_fBaseProductInfo[0]['p_type_id']);\n $this->_fProductAttributesInfo = execQuery('SELECT_PRODUCT_ATTRIBUTES_INFO', $params);\n // SalePrice,\n // TaxClass.\n $tax_class_id = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'taxclass' )\n {\n $tax_class_id = $attribute['pa_value'];\n break;\n }\n }\n\n $price_including_included_taxes_if_any = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'saleprice' )\n {\n if($zone == 'CustomerZone')\n {\n $membership = modApiFunc('Customer_Account','getCurrentSignedCustomerGroupID');\n $attribute['pa_value'] = modApiFunc('Quantity_Discounts','getFixedPrice',$this->_fProductID,1,$attribute['pa_value'],$membership);\n }\n\n $price_including_included_taxes_if_any = $attribute['pa_value'];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['a_view_tag'] = NULL;\n\n // TaxClass - , .\n if($tax_class_id !== NULL)\n {\n // .\n $price_excluding_taxes = modApiFunc(\"Catalog\", \"computePriceExcludingTaxes\", $attribute['pa_value'], $tax_class_id);\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_excluding_taxes;\n\n // _ _ 'salepriceexcludingtaxes':\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_value'] = $price_excluding_taxes;\n }\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['a_view_tag'] = NULL;\n\n if($tax_class_id !== NULL)\n {\n // .\n // _c_ 'salepriceexcludingtaxes':\n $price_including_taxes = $price_including_included_taxes_if_any;\n // ,\n // , \" \"\n //modApiFunc(\"Catalog\", \"computePriceIncludingTaxes\", $attribute['pa_value'], $tax_class_id);\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_value'] = $price_including_taxes;\n\n if($display_product_price_including_taxes == DB_TRUE)\n {\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_including_taxes;\n }\n }\n\n break;\n }\n }\n self::$_cache_attr[$a][$b][$c] = $this->_fProductAttributesInfo;\n }", "public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }", "function get_attribute($order_id, $param)\n{\n\n $email_order_attr = new order_attributes();\n $email_order_attr->order_id = $order_id;\n $email_order_attr->param = $param;\n $email_order_attr->get_latest();\n\n return $email_order_attr->value;\n}", "function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "function getAttributes()\n {\n }", "public function getAttributes(){ }", "public function getAttributes()\n {\n /* @var $attributes Mage_Catalog_Model_Resource_Eav_Resource_Product_Attribute_Collection */\n $attributes = $this->getData('attributes');\n if (is_null($attributes)) {\n $product = Mage::getModel('catalog/product');\n $attributes = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addHasOptionsFilter()\n ->addDisplayInAdvancedSearchFilter()\n ->addStoreLabel(Mage::app()->getStore()->getId())\n ->setOrder('main_table.attribute_id', 'asc')\n ->load();\n foreach ($attributes as $attribute) {\n $attribute->setEntity($product->getResource());\n }\n $this->setData('attributes', $attributes);\n }\n return $attributes;\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "protected function assignExtensionSettings() {}", "public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }", "public function setExtensionAttributes(\n \\Magento\\Checkout\\Api\\Data\\PaymentDetailsExtensionInterface $extensionAttributes\n );", "public function getExtraAttribute()\n {\n return $this->config['extra'];\n }", "public function getExtension() {}", "public function getExtension() {}", "abstract protected function getModelAttributes();", "function atkClone($attribute)\n{\n\tif (intval(substr(phpversion(),0,1))<5)\n\t$attr = $attribute;\n\telse\n\t$attr = clone($attribute);\n\n\treturn $attr;\n}", "public function createCustomAttributes() {\n if ($this->customAttributesExists() === true) {\n return false;\n } else {\n // # Otherwise, get missing attributes...\n $missingAttributes = $this->customAttributesExists();\n\n // # ...and generate them\n foreach ($missingAttributes as $key => $value) {\n $this->post('custom-attributes', ['name' => $key, 'attributeType' => 'client', 'clientZoneVisible' => false]);\n }\n $attributes = $this->get('custom-attributes');\n\n // # They should exist now which returns true and should not be an array\n if ($this->customAttributesExists() === true) {\n return true;\n } else {\n return false;\n // # ...Log error if they don't\n $this->log->appendLog('failed to create custom attributes');\n }\n\n }\n }", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function setExtensionAttributes(\n \\Kashyap\\AttributeSplash\\Api\\Data\\AttributeSplashExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\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// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\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$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function get_extension()\n {\n }", "public function extensionMeta()\n {\n return $this->getConfigFromFile();\n }", "public function setExtensionAttributes(\n \\Affinity\\Catalogue\\Api\\Data\\CatalogueExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Magento\\GiftCard\\Api\\Data\\GiftCardOptionExtensionInterface $extensionAttributes\n );", "public function setExtended() {\n /* first cut out regular and unwanted fields */\n $excludeExtended = $this->controller->getProperty('excludeExtended','');\n $excludeExtended = explode(',',$excludeExtended);\n $profileFields = $this->profile->toArray();\n $userFields = $this->user->toArray();\n $extended = array();\n $fields = $this->dictionary->toArray();\n $fields = $this->filterAllowedFields($fields);\n $userGroupField = $this->controller->getProperty('usergroupsField','');\n foreach ($fields as $field => $value) {\n if (!isset($profileFields[$field])\n && !isset($userFields[$field])\n && $field != 'password_confirm'\n && $field != 'passwordconfirm'\n && $field != $userGroupField\n && !in_array($field,$excludeExtended)\n ) {\n $extended[$field] = $value;\n }\n }\n /* now set extended data */\n $this->profile->set('extended',$extended);\n }", "protected function getImageAttributes() {}", "public function get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }", "public function getCustomAttributes() {}", "public function extend()\n\t{\n\t\t$extensions = func_get_args();\n\n\t\tforeach ( $extensions as $extension )\n\t\t{\n\t\t\tif ( $extension instanceof self )\n\t\t\t\t$this->data = array_merge_recursive( $this->data, $extension->data );\n\t\t\telse\n\t\t\t\t$this->data = array_merge_recursive( $this->data, _A($extension)->data );\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getAttributes()\n {\n }", "public function getExtra();", "public function setExtension($extension, $attributes = array()) {\n\t\t$this->connections [$this->active]->setExtension ( $extension, $attributes );\n\t}", "protected function initUserAttributes()\n {\n return $this->api('people/~:(' . implode(',', $this->attributeNames) . ')', 'GET');\n }", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;" ]
[ "0.6168628", "0.6096815", "0.5797734", "0.5797318", "0.5797318", "0.57972354", "0.57957065", "0.57957065", "0.57957065", "0.57957065", "0.5793629", "0.57655543", "0.57117134", "0.57117134", "0.57117134", "0.57117134", "0.57117134", "0.57117134", "0.57117134", "0.5482796", "0.5458299", "0.54310304", "0.53689635", "0.5349844", "0.5262055", "0.5200397", "0.516605", "0.51354253", "0.5127986", "0.5096549", "0.5095524", "0.50944793", "0.5077064", "0.50719595", "0.50697", "0.5066957", "0.5063808", "0.5063116", "0.5056179", "0.5043559", "0.50230473", "0.5018903", "0.5008922", "0.500088", "0.49905336", "0.49795708", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49758956", "0.4945201", "0.49324632", "0.4904728", "0.48878765", "0.48870257", "0.48686567", "0.48600495", "0.48583633", "0.4852301", "0.4852301", "0.4852301", "0.48488203", "0.48414186", "0.4830584", "0.48275396", "0.48271292", "0.4823796", "0.48176935", "0.4811621", "0.4809796", "0.4809796", "0.48091686", "0.48029423", "0.48021194", "0.4794472", "0.47878858", "0.4780059", "0.476751", "0.47674885", "0.47674885", "0.47674885" ]
0.674368
13
Set an extension attributes object.
public function setExtensionAttributes(MultipleWishlistItemExtensionInterface $extensionAttributes);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAttributes();", "public function setExtensionAttributes(\\Magento\\Tax\\Api\\Data\\AppliedTaxExtensionInterface $extensionAttributes);", "public function setExtension($extension, $attributes = array()) {\n\t\t$this->connections [$this->active]->setExtension ( $extension, $attributes );\n\t}", "public function setExtensionAttributes(\\Magento\\Sales\\Api\\Data\\OrderExtensionInterface $extensionAttributes);", "public function setExtensionAttributes(\n \\Magento\\GiftCard\\Api\\Data\\GiftCardOptionExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Affinity\\Catalogue\\Api\\Data\\CatalogueExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Pugnet\\Weather\\Api\\Data\\WeatherExtensionInterface $extensionAttributes\n );", "public function setAttributes($attributes){ }", "public function setExtensionAttributes(\n \\Magento\\InventorySourceSelectionApi\\Api\\Data\\ItemRequestExtensionInterface $extensionAttributes\n ): void;", "public function setExtensionAttributes(\n \\Magento\\Checkout\\Api\\Data\\PaymentDetailsExtensionInterface $extensionAttributes\n );", "protected function assignExtensionSettings() {}", "public function setAttributes($attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttrs($attrs);", "public function setExtensionAttributes(\n \\Magento\\CompanyCredit\\Api\\Data\\CreditLimitExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Magento\\Directory\\Api\\Data\\RegionInformationExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Loop\\Tracker\\Api\\Data\\ItemsExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function setExtensionAttributes(\n \\Shurik\\QuickOrder\\Api\\Data\\StatusExtensionInterface $extensionAttributes\n );", "public function set_attributes($attributes)\n {\n }", "public function setExtensionAttributes(\n \\SpDev\\ProductOrderingInformation\\Api\\Data\\SalesInformationExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Kashyap\\AttributeSplash\\Api\\Data\\AttributeSplashExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function setExtensionAttributes(\n \\Aheadworks\\FaqFree\\Api\\Data\\CategoryExtensionInterface $extensionAttributes\n );", "public function setAttributes($attributes)\n {\n foreach($attributes as $key => $value) {\n $this->$key = $value;\n }\n }", "public function set()\n {\n $args = func_get_args();\n\n if ( count($args) == 2 )\n {\n $this->attributes[$args[0]] = $args[1];\n }\n elseif ( count($args) == 1 && is_array($args[0]) ) \n {\n $this->attributes = ( array_merge($this->attributes, $args[0]) );\n }\n\n return $this;\n }", "abstract public function setAttribute($key, $value);", "public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }", "public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }", "public function setAttributes ($attributes)\n {\n\n $this->attributes = array_merge($this->attributes, $attributes);\n\n }", "public function setExtensionAttributes(\n \\MagePrakash\\ProductAttachment\\Api\\Data\\AttachmentExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public static function setAttributes(&$object, $attributes)\n {\n foreach ($attributes as $attr => $value) {\n if (is_array($value)) {\n static::setAttributes($object, $value);\n continue;\n }\n\n $attributeSetMethod = 'set' . SCT::toUpperCamelCase($attr);\n\n if (method_exists($object, $attributeSetMethod)) {\n $object->$attributeSetMethod($value);\n }\n }\n }", "public function setExtension($ext);", "public function setAttribute($key, $value);", "public function setAttribute($key, $value);", "public function setAttributes(array $attributes, $merge = false);", "public function __set($attri, $value) {\n if (in_array($attri, self::DYN_ATTRIBUTES)) {\n $this->{$attri} = $value;\n }\n }", "public function setAttrs($attrs) {\n\t\t$this->attrs = $attrs;\n\t}", "public function setExtension(?IExtension $extension): void\n {\n $this->extension = $extension;\n }", "public function setAllowedExtensions(array $extensions) {\n \t $this->allowedExtensions = $extensions;\n\t }", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "abstract public function setAttribute($name, $value, $domain = '');", "public function set($id, $attributes);", "public function setExtensionAttributes(\n \\Interview\\Kishore\\Api\\Data\\VideoExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}", "public function setExtensionAttributes(\n \\Angel\\Payout\\Api\\Data\\PayoutExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function __set( $name, $value )\n\t{\n\t\t$this->attributes[$name] = $value;\n\t}", "public function __set($name, $value)\n\t{\n\t\t$this->attributes[$name] = $value;\n\t\t\n\t}", "function set_attrs($attrs)\n {\n foreach($attrs as $key => $value) {\n if ($key == \"meta_name\") { continue; }\n if ($key == \"vocab\") { continue; }\n if ($key == \"text\") { continue; }\n if ($key == \"lang\") { continue; }\n $this->attrs[$key] = $value; \n }\n }", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "protected function setAttributes($attributes) {\n $this->_formAttributes = $attributes;\n }", "private function setCustomAttributes(array $attributes = null)\n {\n if (!is_null($attributes)) {\n $this->customAttributes->mergeAttributes($attributes);\n }\n }", "public function setExtension($name, $baseVersion, $extensionLevel) {}", "public function setAttribute($name, $value);", "public function setAttribs($attribs) {\n\t\t$this->_attribs = $attribs;\n\t}", "public function __set($atrib, $value){\n\t\t$this->$atrib = $value;\n\t}", "public function setExtension(?string $value): void {\n $this->getBackingStore()->set('extension', $value);\n }", "public function __set($name, $value)\n {\n $this->_attributes[$name] = $value;\n }", "public function set_field_attributes( $attributes = array() ) {\n\t\n\t\t$this->field_attributes = $attributes;\n\t\n\t}", "public function __set($name, $value)\n {\n $this->attributes[$name] = $value;\n }", "public function set_attributes( $attributes = array(), $override = true ) {\n\t\n\t\tif ( true == $override ) {\n\t\t\t$this->attributes = array_merge( $this->attributes, $attributes );\n\t\t}\n\t\telse {\n\t\t\t$this->attributes = array_merge( $attributes, $this->attributes );\n\t\t}\n\t\n\t}", "public function setExtensions(array $extensions)\n {\n $this->extensions = array();\n\n foreach ($extensions as $extension) {\n $this->addExtension($extension);\n }\n }", "public function setAttr($attributes = array())\n {\n foreach ($attributes as $key => $value) {\n if (property_exists(get_class($this), $key))\n $this->$key = $value;\n }\n return $this;\n }", "protected function setAvailableExtensions() {}", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "public function setExtensions(array $extensions)\n {\n foreach ($extensions as $extension) {\n $this->addExtension($extension);\n }\n }", "protected function _prepareEnrtyForSave()\n {\n $object = $this->getObject();\n if (!($object instanceof Varien_Object)) {\n Mage::throwException(Mage::helper('googlebase')->__('Object model is not specified to save Google Base entry.'));\n }\n\n $this->_setUniversalData();\n\n $attributes = $this->getAttributeValues();\n if (is_array($attributes) && count($attributes)) {\n foreach ($attributes as $name => $data) {\n\n $name = $this->_normalizeString($name);\n $value = isset($data['value']) ? $data['value'] : '';\n $type = isset($data['type']) && $data['type'] ? $data['type'] : self::DEFAULT_ATTRIBUTE_TYPE;\n\n $customSetter = '_setAttribute' . ucfirst($name);\n if (method_exists($this, $customSetter)) {\n $this->$customSetter($name, $value, $type);\n } else {\n $this->_setAttribute($name, $value, $type);\n }\n }\n }\n return $this;\n }", "public function setExtension($extension)\n {\n $this->_extension = $extension;\n }", "public function setExtension($extension)\n {\n $this->_extension = $extension;\n }", "public function setAttributes($item,$attributes) {\n\t\t$this->_properties[$item]['Attributes'] = ' '.$attributes;\n\t}", "public function setSchemaExtensionProperties($val)\n {\n $this->_propDict[\"properties\"] = $val;\n return $this;\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.extensionProperty');\n }", "protected static function setAttributes( Model &$object, array $attributes )\n\t{\n\t\tforeach($attributes as $key => $value)\n\t\t{\n\t\t\tif( array_search($key, static::$hidden) === false )\n\t\t\t{\n\t\t\t\t$object->attributes[$key] = $value;\n\t\t\t}\n\t\t}\n\t}", "public function update_extension(){}", "public function set_attribute($name, $value)\n {\n }", "public function setAttribute($attribute, $value)\n {\n }", "public function set_attrs($xml, $cloned=true)\n\t{\n\t\t$this->attrs['type'] = $xml->localName;\n\t\tparent::set_attrs($xml, $cloned);\n\n\t\t// set attrs[multiple] from attrs[options]\n\t\tif ($this->attrs['options'] > 1)\n\t\t{\n\t\t\t$this->setElementAttribute($this->id, 'multiple', true);\n\t\t}\n\t}", "public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }", "public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}", "public function setExtension($ext)\n {\n if (!empty($ext)){\n $this->extension = $ext;\n }\n }", "public function setExtensionAttributes(\n \\Xigen\\Announce\\Api\\Data\\StatsExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function setAttribute($key, $value = null);", "public function setExtension($extension) {\n $this->_extension = $extension;\n }", "public function set_attributes()\n {\n $this->id = 0;\n $this->set_process();\n $this->set_decomposition();\n $this->set_technique();\n $this->set_applicability();\n $this->set_input();\n $this->set_output();\n $this->set_validation();\n $this->set_quality();\n $this->score = 0;\n $this->matchScore = 0;\n $this->misMatch = \"\";\n }", "function setExtensionsPath($value)\r\n\t\t{\r\n\t\t\t$this->_extensionsPath = $value;\r\n\t\t}" ]
[ "0.69624007", "0.6806445", "0.67975146", "0.6626065", "0.655601", "0.65525913", "0.6545836", "0.6514346", "0.65032536", "0.6427793", "0.64174604", "0.64086866", "0.6383069", "0.6383069", "0.6383069", "0.6330351", "0.63235587", "0.62166697", "0.61463314", "0.60595465", "0.6057609", "0.60486394", "0.6028557", "0.6015314", "0.5971883", "0.5958978", "0.59363264", "0.59221834", "0.59221834", "0.5901504", "0.5867041", "0.5819074", "0.579972", "0.5797489", "0.5783018", "0.5783018", "0.5782136", "0.5776633", "0.57572436", "0.57455146", "0.57090557", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.5635152", "0.56228733", "0.55919623", "0.5589247", "0.5587657", "0.5584214", "0.5584072", "0.5581784", "0.5575144", "0.55731666", "0.555949", "0.5559037", "0.55543256", "0.5554161", "0.5544342", "0.55378574", "0.5530389", "0.55093026", "0.55074465", "0.5506509", "0.5500173", "0.54876924", "0.546585", "0.5453024", "0.54384434", "0.5437005", "0.54322773", "0.54322773", "0.5422544", "0.5420665", "0.54130185", "0.540768", "0.54069155", "0.54067665", "0.54044247", "0.53990144", "0.53953815", "0.5393135", "0.53893006", "0.5378051", "0.53749007", "0.5372161", "0.537016", "0.5365441", "0.53548217" ]
0.54727167
77
/ e.g: $route['/home'] = array("controller"=>"user", "method"=>"get_user", "params"=> array("id", "name") );
private function uri_reroute() { $match = false; $uri = parse_url($_SERVER['REQUEST_URI']); if (isset($uri['path']) && $uri['path'] !== "/") { $_ = preg_split("|/|", $uri['path'], -1, PREG_SPLIT_NO_EMPTY); $i = 0; $route = null; $router = null; // while ($match === false) { // $path = $_[$i]; // if (isset($this->configuration['ROUTES']['/' . $path])) { // $match = true; // $route = "/$path"; // $router = $this->configuration['ROUTES']['/' . $path]; // $this->route_map = $route; // } // if (isset($this->configuration['ROUTES'][$path])) { // $match = true; // $route = "$path"; // $router = $this->configuration['ROUTES'][$path]; // $this->route_map = $route; // } // ++$i; // } // unset($_); // unset($i); // unset($uri); // unset($path); if (isset($_) && is_array($_) && count($_) > 0) { $path = ""; foreach ($_ as $k => $v) { $path .= "/" . $v; if (isset($this->configuration['ROUTES'][$path])) { $match = true; $route = "$path"; $router = $this->configuration['ROUTES'][$path]; $this->route_map = $route; // if(is_array($router['params'])){ // }elseif($router['params'] == "*"){ // break; // } break; } } } if (isset($router['controller'])) { $this->controller = $router['controller']; } else { $this->controller = "main"; } if (isset($router['method'])) { $this->method = $router['method']; } else { $this->method = "index"; } if (isset($router['action']) && isset($this->http)) { if (trim(strtolower($router['action'])) != strtolower($this->http->action)) { $this->http->http_error(403); } } if (isset($router['type']) && isset($router['type'])){ if (trim(strtolower($router['type'])) == "json" && $this->http->type != "json"){ $this->http->http_error(406, "Form " . $this->http->action . " data is not json"); } } if (isset($router['params'])) { if (is_array($router['params'])) { $uri = preg_split("|/|", str_replace($route, "", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY); if (is_array($router['params'])) { $_ = $router['params']; unset($router['params']); $router['params'][] = $_; unset($_); } $nums_params = count($router['params'][0]); if ($nums_params > 0) { foreach ($router['params'][0] as $k => $v) { $this->params[$v] = trim(urldecode($uri[$k])); } } $i = 0; $x = 0; while ($nums_params < $i) { if (isset($uri[$x]) && is_value($uri[$x])) { $this->params[$router['params'][$i]] = trim(urldecode($uri[$x])); ++$i; } ++$x; } } elseif ($router['params'] != "*") { return $this->http->http_error(404); } } else { $uri = preg_split("|/|", str_replace($route, "", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY); if (count($uri) > 0) { return $this->http->http_error(404); } } unset($uri); unset($i); unset($x); unset($route); unset($router); } return $match; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useRoute(){\n\t\t\t$routeParts = explode(\"@\", $this->matchingRoute->location);\n\t\t\treturn [\"controller\" => ucfirst($routeParts[0]), \"method\" => $routeParts[1]];\n\t\t}", "function route($url){\n\t$controller = stringFormat(array_shift($url), true);\n\t\t//var_dump('controller = '.$controller.'<br/>');\n\t$action = array_shift($url);\n\t\t//var_dump('action = '.$action);\n\t$param = implode(',', $url);\n\t\t//var_dump('param = '.$param);\n\t$model = stringFormat($action).'Model';\n\t\t//var_dump('model = '.$model.'<br/>');\t\n\n\t/* formate the action to stringFormate */ \n\t$action = stringFormat($action);\n\t\t//var_dump('action format = '.$action.'<br/>');\n\n\t/* create a new controller */\n\t$controller = new $controller($controller, $model, $action);\n\n\t/*\n\t | This method checks whether the Object creates above,\n\t | $controller = new $controller($controller, $model, $action);\n\t | $controller and its methods are exists.It means the method_exists()\n\t | function checks param - $controller (object of the class we create\n\t | above) and the param - $action (some method inside the created \n\t | object). if method_exists(true) then it calls to the action \n\t | parameters (params we collected from above $url).if the \n\t | method_exists(false) then it calls the method index();\n\t*/\n\tif(method_exists($controller, $action)){\n\t\t$controller->$action($param);\n\t\t\n\t}else{\n\t\t$controller->index();\n\t}\n}", "private function makeDataFromUrl(){\n if (empty($_GET)){\n Route::$controller='home';\n return true;\n }\n $routs= explode('/',strip_tags($_GET['route']));\n $result=array();\n foreach ($routs as $k=>$v){\n switch ($k){\n case 0:\n $result['controller']=$v;\n $result['method']='index';\n Route::$controller=$v;\n Route::$method='index';\n break;\n default: $result['data'][]=$v;\n }\n }\n if (!empty($result['data']))\n Route::$data=$result['data'];\n return true;\n }", "public static function route($url){\n //controller\n $controller = (isset($url[0]) && $url[0] != '') ? $url[0] : DEFAULT_CONTROLLER;\n $controller_name = ucfirst($controller);\n array_shift($url);\n\n //action\n $method = (isset($url[0]) && $url[0] != '') ? $url[0] : \"index\";\n $method_name = $method;\n array_shift($url);\n\n //acl check\n $grantAccess = self::hasAccess($controller_name,$method_name);\n\n\n if(!$grantAccess){\n $controller_name = ACCESS_RESTRICTED;\n $method_name = ACCESS_RESTRICTED_METHOD;\n }\n\n //parameters\n $queryParams = $url;\n\n\n $controller_obj = new $controller_name($controller_name,$method_name);\n\n if(method_exists($controller_name,$method_name)){\n call_user_func_array([$controller_obj,$method_name],$queryParams);\n }else{\n die('That method does not exist in the controller '.$controller_name);\n }\n }", "protected static function requestRoute() {\n $route = [];\n\n $currentUrlOptions = parse_url($_SERVER['REQUEST_URI']);\n $fullUri = $currentUrlOptions['path'];\n $prefixLen = strlen(self::$uriPrefix);\n if ($fullUri == self::$uriPrefix){ //all default\n $route['controller'] = '';\n $route['action'] = '';\n } elseif (substr($fullUri, 0, $prefixLen) === self::$uriPrefix) {\n $uri = substr($fullUri, $prefixLen);\n $parts = explode('/', rtrim($uri, '/'));\n $route['controller'] = ucfirst($parts[0]);\n $route['action'] = isset($parts[1]) ? ucfirst($parts[1]) : '';\n } else {\n //do nothing\n }\n\n return $route;\n }", "private function defineRoute(){\n if($this->route_path === '/'){\n //go to home\n $controller_name = ucfirst($this->config->getLandingPageControllerName().\"Controller\");\n }\n elseif (array_key_exists($this->route_path[1],$this->nameRoutes())){\n $name_route = $this->nameRoutes()[$this->route_path[1]];\n $controller_name = !empty($name_route[0])?ucfirst($name_route[0]):'';\n $this->route_path[2] = $name_route[1];\n }\n else{\n $controller_name = !empty($this->route_path[1])?ucfirst($this->route_path[1].\"Controller\"):'';\n }\n $method_name = !empty($this->route_path[2])?$this->route_path[2]:'index';\n $parameters = is_array($this->route_path)?array_slice($this->route_path, 3):'';\n\n $file_path = ROOT_DIR.\"/src/Controllers/{$controller_name}.php\";\n if(file_exists($file_path)){\n $controller_name_with_namespace = 'App\\Controllers\\\\'.$controller_name;\n $controller_object = new $controller_name_with_namespace();\n if(method_exists($controller_object,$method_name)){\n $controller_object->$method_name($parameters);\n }else{\n exit('Wrong Method');\n }\n\n }else{\n exit('Wrong Controller');\n }\n }", "function __construct($url,$controller,$methode,$protected){\n $url_settings = [\n \"controller\" => $controller,\n \"method\"=>$methode,\n \"protected\" =>$protected\n ];\n\n $GLOBALS[\"route_url\"][$url] = $url_settings; \n }", "private function getRoute() {\n $path = $_SERVER['PATH_INFO'];\n\n $parts = explode('/', trim($path, '/'));\n $action = array_shift($parts);\n $this->uri_params = $parts;\n\n if (!$action) $action = 'index';\n $action .= 'Action';\n return array($this, $action);\n }", "static function makeNewRout($str,$arr){\n Route::$routeName = trim(strip_tags($str));\n Route::$routeName = $arr['as'];\n $func=explode($arr,'@');\n Route::$controller=$func['0'];\n if (isset($func[1])){\n Route::$method=$func[1];\n }else{\n Route::$method='index';\n }\n return false;\n }", "public static function route($url){\n //controller\n $controller = (isset($url[0]) && $url[0] != '') ? ucwords($url[0]) : DEFAULT_CONTROLLER ; //DEFAULT_CONTROLLER IS DEFINE IN config ucwords means all in capital\n //dnd($controller);\n $controller_name = $controller;\n array_shift($url); //this shift the url from index 0 to 1. so we are working on the action part now.which will start from url[0]\n\n //action. getting the action part\n $action = (isset($url[0]) && $url[0] != '') ? $url[0] . 'Action' : IndexAction ; //IndexAction will be define later. but we are concat the url with Action\n //dnd($action);\n $action_name = $action;\n array_shift($url);\n\n\n //get the parameter which is next in the url after shift\n $queryParam = $url; // the remaining after getting the controller and action\n $dispatch = new $controller($controller_name, $action); // creating an object\n if(method_exists($controller,$action)){\n call_user_func_array([$dispatch, $action], $queryParam); // $dispatch->$action($queryParam) thesame\n }else{\n die('This method does not exist in controller \\\"' .$controller_name .'\\\"');\n }\n\n// echo $controller .'<br>'; //shows our controller name with capital letter\n// echo $action .'<br>'; //shows our action name\n// dnd($url); // shows the rest after the controller in array\n }", "function defineRoutes(&$router) {\n /*\n * example routers\n * \n * \n */\n //$router->map('modulename', 'modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('dashboard_modulename', 'dashboard/modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('modulename_view_project', 'modulename/:project_id/view', array('controller' => 'modulename', 'action' => 'view'), array('project_id' => '\\d+'));\n }", "function defineRoutes(&$router) {\n \n // Main\n $router->map('mobile_access', 'm', array('controller' => 'mobile_access', 'action' => 'index'));\n \n $router->map('mobile_access_login', 'm/login', array('controller' => 'mobile_access_auth', 'action' => 'login'));\n $router->map('mobile_access_logout', 'm/logout', array('controller' => 'mobile_access_auth', 'action' => 'logout'));\n $router->map('mobile_access_forgot_password', 'm/forgot-password', array('controller' => 'mobile_access_auth', 'action' => 'forgot_password'));\n \n // Quick Add\n $router->map('mobile_access_quick_add', 'm/starred', array('controller' => 'mobile_access', 'action' => 'quick_add'));\n \n // Assignments\n $router->map('mobile_access_assignments', 'm/assignments', array('controller' => 'mobile_access', 'action' => 'assignments'));\n \n // Starred\n $router->map('mobile_access_starred', 'm/starred', array('controller' => 'mobile_access', 'action' => 'starred'));\n \n // People\n $router->map('mobile_access_people', 'm/people', array('controller' => 'mobile_access_people', 'action' => 'index'));\n $router->map('mobile_access_view_company', 'm/people/:object_id', array('controller' => 'mobile_access_people', 'action' => 'company'), array('object_id' => '\\d+'));\n $router->map('mobile_access_view_user', 'm/people/users/:object_id', array('controller' => 'mobile_access_people', 'action' => 'user'), array('object_id' => '\\d+'));\n \n \n // Projects\n $router->map('mobile_access_projects', 'm/projects', array('controller' => 'mobile_access_projects', 'action' => 'index'));\n \n // Project\n $router->map('mobile_access_view_project', 'm/project/:project_id', array('controller' => 'mobile_access_project', 'action' => 'index'), array('project_id' => '\\d+'));\n \n // Project discusions\n $router->map('mobile_access_view_discussions', 'm/project/:project_id/discussions', array('controller' => 'mobile_access_project_discussions', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_discussion', 'm/project/:project_id/discussions/:object_id', array('controller' => 'mobile_access_project_discussions', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project milestones\n $router->map('mobile_access_view_milestones', 'm/project/:project_id/milestones', array('controller' => 'mobile_access_project_milestones', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_milestone', 'm/project/:project_id/milestones/:object_id', array('controller' => 'mobile_access_project_milestones', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project files\n $router->map('mobile_access_view_files', 'm/project/:project_id/files', array('controller' => 'mobile_access_project_files', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_file', 'm/project/:project_id/files/:object_id', array('controller' => 'mobile_access_project_files', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project checklists\n $router->map('mobile_access_view_checklists', 'm/project/:project_id/checklists', array('controller' => 'mobile_access_project_checklists', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_checklist', 'm/project/:project_id/checklists/:object_id', array('controller' => 'mobile_access_project_checklists', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project pages\n $router->map('mobile_access_view_pages', 'm/project/:project_id/pages', array('controller' => 'mobile_access_project_pages', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_page', 'm/project/:project_id/pages/:object_id', array('controller' => 'mobile_access_project_pages', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_page_version', 'm/project/:project_id/pages/:object_id/version/:version', array('controller' => 'mobile_access_project_pages', 'action' => 'version'), array('project_id' => '\\d+', 'object_id' => '\\d+', 'version' => '\\d+'));\n \n // Project tickets\n $router->map('mobile_access_view_tickets', 'm/project/:project_id/tickets', array('controller' => 'mobile_access_project_tickets', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_ticket', 'm/project/:project_id/tickets/:object_id', array('controller' => 'mobile_access_project_tickets', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project timerecords\n $router->map('mobile_access_view_timerecords', 'm/project/:project_id/timerecords', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_timerecord', 'm/project/:project_id/timerecords/:object_id', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project subobjects\n $router->map('mobile_access_view_task', 'm/project/:project_id/task/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_comment', 'm/project/:project_id/comment/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_add_comment', 'm/project/:project_id/comment/add', array('controller' => 'mobile_access_project', 'action' => 'add_comment'));\n \n // Common\n $router->map('mobile_access_view_category', 'm/category/:object_id', array('controller' => 'mobile_access', 'action' => 'view_category', array('object_id' => '\\d+')));\n $router->map('mobile_access_toggle_object_completed_status', 'm/project/:project_id/toggle-completed/:object_id', array('controller' => 'mobile_access', 'action' => 'toggle_completed', array('project_id' => '\\d+', 'object_id' => '\\d+')));\n }", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "function generate(array $params) {\n $route = $this->_route;\n\n if ($controller = $params['controller'] and substr($controller, -10) == 'Controller') {\n $params['controller'] = underscore(substr($controller, 0, -10));\n }\n\n if (!$params['action']) {\n $params['action'] = 'index';\n }\n\n # Expand object parameters\n foreach ($params as $key => $value) {\n if (is_object($value)) {\n if (method_exists($value, 'to_param')) {\n $params[$key] = $value->to_param;\n } else {\n throw new TypeError($value, \"Missing to_param() method in class '%s'\");\n }\n }\n }\n\n # Remove fixed parameters, abort if they don't match this route\n foreach ($this->_fixed as $key => $value) {\n if ($params[$key] != $value) {\n return;\n } else {\n unset($params[$key]);\n }\n }\n\n # Check for required parameters\n foreach ($this->_required as $key) {\n if (!isset($params[$key])) {\n return;\n }\n }\n\n # Check for format specifications\n foreach ($this->_formats as $key => $format) {\n if ($value = $params[$key] and !preg_match($format, $value)) {\n return;\n }\n }\n\n # Apply default values\n foreach ($this->_defaults as $key => $value) {\n if (!isset($params[$key]) and isset($this->_params[$key])) {\n $params[$key] = $value;\n }\n }\n\n # Replace all route symbols\n $add = false;\n foreach (array_reverse($this->_params) as $key => $symbol) {\n $value = $params[$key];\n unset($params[$key]);\n\n if ($add or (!is_null($value) and $value !== '' and $value != $this->_defaults[$key])) {\n $route = str_replace($symbol, $value, $route);\n $add = true;\n }\n }\n\n # Add remaining parameters to query string\n if ($params) {\n $query = array();\n\n foreach ($params as $key => $value) {\n if (!is_null($value) and (!array_key_exists($key, $this->_defaults) or $value != $this->_defaults[$key])) {\n if (is_numeric($key)) {\n $query[] = urlencode($value);\n } elseif (is_array($value)) {\n $query[] = strtr(http_build_query(array($key => $value)), array(\n '%5B' => '[', '%5D' => ']'\n ));\n } else {\n $query[] = strtr(urlencode($key), array(\n '%5B' => '[', '%5D' => ']'\n )).'='.urlencode($value);\n }\n }\n }\n\n if ($query) {\n $route .= '?'.implode('&', $query);\n }\n }\n\n return preg_replace('#/?[:*][a-z_]+!?#', '', $route);\n }", "public static function route();", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function getRoute(){\n // load default controller if none specified\n if (!$this->url_controller) {\n\n $this->url_controller = 'controller\\home';\n $this->url_action = 'index';\n\n // check if specified controller file exists\n } elseif (file_exists(APP . 'controller/' . $this->url_controller . '.php')) {\n\n $this->url_controller = 'controller\\\\' . $this->url_controller;\n $this->url_action = (strlen($this->url_action) == 0 ? 'index' : $this->url_action);\n\n // perhaps specified controller is located in subdirectory?\n } elseif (strlen($this->url_action) != 0 AND file_exists(APP . 'controller/' . $this->url_controller . '/' . $this->url_action . '.php')) {\n\n $this->url_controller = 'controller\\\\' . $this->url_controller . '\\\\' . $this->url_action;\n if (isset($this->action_params[0]) AND strlen($this->action_params[0]) != 0) {\n $this->url_action = $this->action_params[0];\n unset($this->action_params[0]);\n array_values($this->action_params);\n } else {\n $this->url_action = 'index';\n }\n\n // or maybe there's a default controller in directory?\n } elseif (file_exists(APP . 'controller/' . $this->url_controller . '/home.php')) {\n\n $this->url_controller = 'controller\\\\' . $this->url_controller . '\\\\home';\n $this->url_action = (strlen($this->url_action) == 0 ? 'index' : $this->url_action);\n\n // if not, load default controller with params\n } elseif ($this->url_controller) {\n\n $this->action_params = array($this->url_controller);\n $this->url_controller = 'controller\\home';\n $this->url_action = 'index';\n\n // if none of the above pass, reset controller param\n } else {\n $this->url_controller = null;\n }\n }", "public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }", "public function route($url, $controller = null, $method = null, $args = null) {\n\t\t//add a slash if the given url doesn't start with one\n\t\tif(substr($url, 0, 1) !== '/' && $url !== '.*') {\n\t\t\t$url = '/' . $url;\n\t\t}\n\t\t$route = clone $this->globals();\n\t\t$route->url($url)->controller($controller)->method($method)->args($args);\n\t\t$this->routes[$url] = $route;\n\t\tif(!is_null($this->current_name)) {\n\t\t\t$this->names[$this->current_name] = $url;\n\t\t\t$this->current_name = null;\n\t\t}\n\t\treturn $this->routes[$url];\n\t}", "function index(){\n // Return data with route\n $this->load_defaults();\n }", "public static function routes()\r\n {\r\n return [\r\n [\"uri\" => \"/\", \"action\" => \"get\", \"uses\" => \"IndexController@index\"],\r\n [\"uri\" => \"/\", \"action\" => \"post\", \"uses\" => \"IndexController@handle\"],\r\n [\"uri\" => \"/api\", \"action\" => \"get\", \"uses\" => \"APIController@handle\"],\r\n ];\r\n }", "public function get($route, $controllerAction = '');", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "private function loadRoute()\n\t{\n\t\t/*\n\t\t* Se o controller nao for passado por GET,\n\t\t* assume-se como padrão o controller 'IndexController';\n\t\t*/\n\t\t$this->st_controller = isset($_REQUEST['controle']) ? $_REQUEST['controle'] : 'index';\n\t\t\n\t\t/*\n\t\t* Se a action nao for passada por GET,\n\t\t* assume-se como padrão a action 'IndexAction';\n\t\t*/\n\t\t$this->st_action = isset($_REQUEST['acao']) ? $_REQUEST['acao'] : 'index';\n\t}", "function route(Array $url){\n\n $controllers=[\n 'ajax-search' => 'AjaxSearch',\n 'change-password' => 'ChangePassword',\n 'community' => 'Community',\n\t'dit' => 'Dit',\n 'dits' => 'Dits',\n 'feedback' => 'Feedback',\n 'home' => 'Home',\n\t'idea' => 'Dit',\n 'ideas' => 'Ideas',\n\t'interest' => 'Dit',\n 'interests' => 'Interests',\n\t'issue' => 'Dit',\n\t'issues' => 'Dits',\n\t'topic' => 'Dit',\n\t'topics' => 'Dits',\n 'login' => 'Login',\n 'logout' => 'Logout',\n 'logout-all' => 'LogoutAll',\n 'map' => 'Map',\n 'message' => 'Message',\n 'messages' => 'Messages',\n 'notifications' => 'Notifications',\n 'people' => 'People',\n 'project' => 'Dit',\n 'projects' => 'Projects',\n 'search' => 'Search',\n 'signup' => 'Signup',\n 'start' => 'Start',\n 'user' => 'User'\n ];\n\n $url0 = isset($url[0]) ? $url[0] : 'home';\n if(isset($controllers[$url0]) && file_exists('../app/controllers/' . $controllers[$url0] . '.php')){\n require_once '../app/controllers/' . $controllers[$url0] . '.php';\n \n if($controllers[$url0]!=='Dit') unset($url[0]);\n $url = $url ? array_values($url) : [];\n\n $control_class = 'Mrkvon\\\\Ditup\\\\Controller\\\\'.$controllers[$url0];\n\n $control_class::route($url);\n exit();\n }\n else{\n require_once '../app/controllers/404.php';\n $control_class = 'Mrkvon\\Ditup\\Controller\\Fof';\n $control_class::route();\n exit();\n }\n\n/* if(file_exists('../app/controllers/' . $url[0] . '.php'))\n {\n $this->controller = $url[0];\n unset($url[0]);\n }\n\n require_once '../app/controllers/' . $this->controller . '.php';\n\n $this->controller = str_replace(['-'], '', $this->controller);\n \n $this->controller = 'Mrkvon\\\\Ditup\\\\Controller\\\\'.$this->controller;\n \n $this->controller = new $this->controller;\n \n if(isset($url[1]))\n {\n if(method_exists($this->controller, $url[1]))\n {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n \n// $this->params = $url ? array_values($url) : [];\n //print_r($this->params);\n \n // call_user_func_array([$this->controller, $this->method],$this->params);\n*/\n}", "public function getListRoutes()\r\n {\r\n $result = array();\r\n \r\n if (count( $this->routes ))\r\n {\r\n foreach ( $this->routes as $act )\r\n {\r\n \r\n $route_str = '';\r\n if (isset( $this->default_params['url_prefix'] ) && ! empty( $this->default_params['url_prefix'] ))\r\n {\r\n $route_str = $this->default_params['url_prefix'];\r\n }\r\n \r\n if (is_array( $act['type'] ))\r\n {\r\n $route_str = implode( '|', $act['type'] ) . ' ' . $route_str;\r\n }\r\n else\r\n {\r\n $route_str = $act['type'] . ' ' . $route_str;\r\n }\r\n $route_str .= $act['route'];\r\n \r\n if (isset( $act['params']['ajax'] ) && (bool) ($act['params']['ajax']))\r\n {\r\n $route_str .= ' [ajax]';\r\n }\r\n \r\n $action_str = '';\r\n if (isset( $act['params']['namespace'] ) && ! empty( $act['params']['namespace'] ))\r\n {\r\n $action_str = (string) $act['params']['namespace'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['namespace'] ) && ! empty( $this->default_params['namespace'] ))\r\n {\r\n $action_str = $this->default_params['namespace'];\r\n }\r\n }\r\n $action_str .= '\\\\';\r\n \r\n if (isset( $act['params']['controller'] ))\r\n {\r\n $action_str .= (string) $act['params']['controller'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['controller'] ) && ! empty( $this->default_params['controller'] ))\r\n {\r\n $action_str .= $this->default_params['controller'];\r\n }\r\n }\r\n $action_str .= '->' . (string) $act['params']['action'];\r\n \r\n $kbps = $this->default_params['kbps'];\r\n if( isset( $act['params']['kbps'] ) ){\r\n \t$kbps = $act['params']['kbps'];\r\n }\r\n $ttl = $this->default_params['ttl'];\r\n if( isset( $act['params']['ttl'] ) ){\r\n \t$ttl = $act['params']['ttl'];\r\n }\r\n \r\n $route = new \\stdclass();\r\n $route->pattern = $route_str;\r\n $route->handler = $action_str;\r\n $route->ttl = $ttl;\r\n $route->kbps = $kbps;\r\n $result[] = $route;\r\n }\r\n }\r\n \r\n return $result;\r\n }", "private function parseRoutes()\n\t{\n\t\t@list($controller, $action, $params) = explode('/', $this->routes, 3);\n\t\tif (isset($controller)) {\n\t\t\t$this->setController($controller);\t\n\t\t}\n\t\tif (isset($action)) {\n\t\t\t$this->setAction($action);\n\t\t}\n\t\tif (isset($params)) {\n\t\t\t$this->setParams(explode('/', $params));\n\t\t}\n\t}", "public function getMethodUrlPathArray(){\n\n $getAllKeys = array_keys($this->HTTP_GET_VARS);\n $dirControllers = $this->getDirFiles('controller/', self::FILE);\n foreach ($getAllKeys as $key) {\n if($key == 'task'){\n\n foreach ($dirControllers as $controller){\n\n if($this->HTTP_GET_VARS[$key].'Controller.php' == $controller){\n\n $controllerObject = \"\\\\controller\\\\\".explode('.php', $controller)[0];\n $reflection = new ReflectionClass($controllerObject);\n if((!$reflection->isAbstract()) && (!$reflection->isInterface())) {\n\n $this->urlPath['task'] = new $controllerObject();\n }\n }\n }\n\n }\n else if($key == 'action'){\n\n if(array_key_exists('task', $this->urlPath)){\n\n $reflection = (method_exists($this->urlPath['task'], $this->HTTP_GET_VARS[$key]))? new ReflectionMethod($this->urlPath['task'], $this->HTTP_GET_VARS[$key]): null;\n\n if(is_object($this->urlPath['task']) && method_exists(get_class($this->urlPath['task']), $this->HTTP_GET_VARS[$key]) && ($reflection->isPublic())){\n $this->urlPath['task'] = $this->HTTP_GET_VARS['task'];\n $this->urlPath['action'] = $this->HTTP_GET_VARS['action'];\n }\n else{\n $this->urlPath['task'] = null;\n $this->urlPath['action'] = null;\n }\n }\n }\n else{\n $this->urlPath['args'][$key] = (!empty($this->HTTP_GET_VARS[$key]))?$this->HTTP_GET_VARS[$key]: null;\n }\n }\n return $this->urlPath;\n }", "function defineRoutes() {\n Router::map('homepage', '', array('controller' => DEFAULT_CONTROLLER, 'action' => DEFAULT_ACTION, 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('admin', 'admin', array('controller' => 'admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('public', 'public', array('controller' => 'public', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('wireframe_updates', 'wireframe-updates', array('controller' => 'backend', 'action' => 'wireframe_updates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('menu_refresh_url', 'refresh-menu', array('controller' => 'backend', 'action' => 'refresh_menu', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('quick_add', 'quick-add', array('controller' => 'backend', 'action' => 'quick_add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // API\n Router::map('info', 'info', array('controller' => 'api', 'action' => 'info', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Disk Space\n Router::map('disk_space_admin', 'admin/disk-space', array('controller' => 'disk_space_admin', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_usage', 'admin/disk-space/usage', array('controller' => 'disk_space_admin', 'action' => 'usage', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_admin_settings', 'admin/disk-space/settings', array('controller' => 'disk_space_admin', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_application_cache', 'admin/disk-space/tools/remove-application-cache', array('controller' => 'disk_space_admin', 'action' => 'remove_application_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_logs', 'admin/disk-space/tools/remove-logs', array('controller' => 'disk_space_admin', 'action' => 'remove_logs', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('disk_space_remove_old_application_versions', 'admin/disk-space/tools/remove-old-application-versions', array('controller' => 'disk_space_admin', 'action' => 'remove_old_application_versions', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Appearance\n Router::map('appearance_admin', 'admin/appearance', array('controller' => 'appearance', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_add_scheme', 'admin/appearance/add-scheme', array('controller' => 'appearance', 'action' => 'add', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_edit_scheme', 'admin/appearance/:scheme_id/edit', array('controller' => 'appearance', 'action' => 'edit', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_rename_scheme', 'admin/appearance/:scheme_id/rename', array('controller' => 'appearance', 'action' => 'rename', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_delete_scheme', 'admin/appearance/:scheme_id/delete', array('controller' => 'appearance', 'action' => 'delete', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('appearance_admin_set_as_default_scheme', 'admin/appearance/:scheme_id/set-as-default', array('controller' => 'appearance', 'action' => 'set_as_default', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Scheduled Tasks Admin\n Router::map('scheduled_tasks_admin', 'admin/scheduled-tasks', array('controller' => 'scheduled_tasks_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n // Network settings\n Router::map('network_settings', 'admin/network', array('controller' => 'network_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Indices admin\n Router::map('indices_admin', 'admin/indices', array('controller' => 'indices_admin', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild', 'admin/indices/rebuild', array('controller' => 'indices_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('indices_admin_rebuild_finish', 'admin/indices/rebuild/finish', array('controller' => 'indices_admin', 'action' => 'rebuild_finish', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n Router::map('object_contexts_admin_rebuild', 'admin/indices/object-contexts/rebuild', array('controller' => 'object_contexts_admin', 'action' => 'rebuild', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('object_contexts_admin_clean', 'admin/indices/object-contexts/clean', array('controller' => 'object_contexts_admin', 'action' => 'clean', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // Scheduled tasks\n Router::map('frequently', 'frequently', array('controller' => 'scheduled_tasks', 'action' => 'frequently', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('hourly', 'hourly', array('controller' => 'scheduled_tasks', 'action' => 'hourly', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('daily', 'daily', array('controller' => 'scheduled_tasks', 'action' => 'daily', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n \n // trash related\n Router::map('trash', 'trash', array('controller' => 'trash', 'action' => 'index', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_section', 'trash/:section_name', array('controller' => 'trash', 'action' => 'section', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('trash_empty', 'trash/empty', array('controller' => 'trash', 'action' => 'empty_trash', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('object_untrash', 'trash/untrash-object', array('controller' => 'trash', 'action' => 'untrash_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n Router::map('object_delete', 'trash/delete-object', array('controller' => 'trash', 'action' => 'delete_object', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO), array('object_id' => Router::MATCH_ID));\n\n // Control Tower\n Router::map('control_tower', 'control-tower', array('controller' => 'control_tower', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_empty_cache', 'control-tower/empty-cache', array('controller' => 'control_tower', 'action' => 'empty_cache', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_delete_compiled_templates', 'control-tower/delete-compiled-templates', array('controller' => 'control_tower', 'action' => 'delete_compiled_templates', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_images', 'control-tower/rebuild-images', array('controller' => 'control_tower', 'action' => 'rebuild_images', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n Router::map('control_tower_rebuild_localization', 'control-tower/rebuild-localization', array('controller' => 'control_tower', 'action' => 'rebuild_localization', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n Router::map('control_tower_settings', 'admin/control-tower', array('controller' => 'control_tower', 'action' => 'settings', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n\n\t // Firewall\n\t Router::map('firewall', 'admin/firewall', array('controller' => 'firewall', 'module' => ENVIRONMENT_FRAMEWORK_INJECT_INTO));\n }", "protected function initRoutes() {\n\t\t$routes['index'] = array(\n\t\t\t'route' => '/',\n\t\t\t'controller' => 'IndexController',\n\t\t\t'action' => 'index'\n\t\t);\n\n\t\t$routes['home'] = array(\n\t\t\t'route' => '/home',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'home'\n\t\t);\n\n\t\t$routes['autenticar'] = array(\n\t\t\t'route' => '/autenticar',\n\t\t\t'controller' => 'AuthController',\n\t\t\t'action' => 'autenticar'\n\t\t);\n\n\t\t$routes['editar'] = array(\n\t\t\t'route' => '/editar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editar'\n\t\t);\n\n\t\t$routes['sair'] = array(\n\t\t\t'route' => '/sair',\n\t\t\t'controller' => 'AuthController',\n\t\t\t'action' => 'sair'\n\t\t);\n\t\t##### Fim rotas principais #####\n\n\t\t// ***** Inicio usuario ***** //\n\t\t$routes['usuario'] = array(\n\t\t\t'route' => '/usuario',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'usuario'\n\t\t);\n\n\t\t$routes['cadastrar'] = array(\n\t\t\t'route' => '/cadastrar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'cadastrar'\n\t\t);\n\n\t\t$routes['registrar'] = array(\n\t\t\t'route' => '/registrar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'registrar'\n\t\t);\n\n\t\t$routes['acaousuario'] = array(\n\t\t\t'route' => '/acaousuario',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'botoesUsuario'\n\t\t);\n\n\t\t$routes['editaruser'] = array(\n\t\t\t'route' => '/editaruser',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editarUser'\n\t\t);\n\t\t##### Fim usuario #####\n\n\t\t// ***** Inicio Produto ***** //\n\t\t$routes['produto'] = array(\n\t\t\t'route' => '/produto',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'produto'\n\t\t);\n\n\t\t$routes['cadastrarprod'] = array(\n\t\t\t'route' => '/cadastrarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'cadastrarProd'\n\t\t);\n\n\t\t$routes['registrarprod'] = array(\n\t\t\t'route' => '/registrarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'registrarProd'\n\t\t);\n\n\t\t$routes['acaoproduto'] = array(\n\t\t\t'route' => '/acaoproduto',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'botoesProduto'\n\t\t);\n\n\t\t$routes['editarprod'] = array(\n\t\t\t'route' => '/editarprod',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'editarProd'\n\t\t);\n\t\t##### Fim Produtos #####\n\t\t\n\t\t// ***** Inicio carrinho ***** //\n\t\t$routes['carrinho'] = array(\n\t\t\t'route' => '/carrinho',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'carrinho'\n\t\t);\n\n\t\t$routes['finalizar'] = array(\n\t\t\t'route' => '/finalizar',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'finalizar'\n\t\t);\n\t\t##### Fim carrinho #####\n\t\t\n\t\t// ***** Inicio pedido ***** //\n\t\t$routes['pedido'] = array(\n\t\t\t'route' => '/pedido',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'pedido'\n\t\t);\n\t\t##### Fim pedido #####\n\n\t\t// ***** Inicio Relatorio ***** //\n\t\t$routes['relatorio'] = array(\n\t\t\t'route' => '/relatorio',\n\t\t\t'controller' => 'AppController',\n\t\t\t'action' => 'relatorio'\n\t\t);\n\t\t##### Fim Relatorio #####\n\t\t$this->setRoutes($routes);\n\t}", "function parse($url) {\r\n\t\tif ($url && ('/' != $url[0])) {\r\n\t\t\tif (!defined('SERVER_IIS')) {\r\n\t\t\t\t$url = '/' . $url;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out = array();\r\n\t\t$r = null;\r\n\t\t$default_route = array('/:controller/:action/* (default)',\r\n\t\t\t\t\t\t\t\t'/^(?:\\/(?:([a-zA-Z0-9_\\\\-\\\\.\\\\;\\\\:]+)(?:\\\\/([a-zA-Z0-9_\\\\-\\\\.\\\\;\\\\:]+)(?:[\\\\/\\\\?](.*))?)?))[\\\\/]*$/',\r\n\t\t\t\t\t\t\t\tarray('controller', 'action'), array());\r\n\r\n\t\tif (defined('CAKE_ADMIN') && $this->__admin != null) {\r\n\t\t\t$this->routes[]=$this->__admin;\r\n\t\t\t$this->__admin =null;\r\n\t\t}\r\n\t\t$this->connect('/bare/:controller/:action/*', array('bare' => '1'));\r\n\t\t$this->connect('/ajax/:controller/:action/*', array('bare' => '1'));\r\n\r\n\t\tif (defined('WEBSERVICES') && WEBSERVICES == 'on') {\r\n\t\t\t$this->connect('/rest/:controller/:action/*', array('webservices' => 'Rest'));\r\n\t\t\t$this->connect('/rss/:controller/:action/*', array('webservices' => 'Rss'));\r\n\t\t\t$this->connect('/soap/:controller/:action/*', array('webservices' => 'Soap'));\r\n\t\t\t$this->connect('/xml/:controller/:action/*', array('webservices' => 'Xml'));\r\n\t\t\t$this->connect('/xmlrpc/:controller/:action/*', array('webservices' => 'XmlRpc'));\r\n\t\t}\r\n\t\t$this->routes[] = $default_route;\r\n\r\n\t\tif (strpos($url, '?') !== false) {\r\n\t\t\t$url = substr($url, 0, strpos($url, '?'));\r\n\t\t}\r\n\r\n\t\tforeach($this->routes as $route) {\r\n\t\t\tlist($route, $regexp, $names, $defaults) = $route;\r\n\r\n\t\t\tif (preg_match($regexp, $url, $r)) {\r\n\t\t\t\t// remove the first element, which is the url\r\n\t\t\t\tarray_shift ($r);\r\n\t\t\t\t// hack, pre-fill the default route names\r\n\t\t\t\tforeach($names as $name) {\r\n\t\t\t\t\t$out[$name] = null;\r\n\t\t\t\t}\r\n\t\t\t\t$ii=0;\r\n\r\n\t\t\t\tif (is_array($defaults)) {\r\n\t\t\t\t\tforeach($defaults as $name => $value) {\r\n\t\t\t\t\t\tif (preg_match('#[a-zA-Z_\\-]#i', $name)) {\r\n\t\t\t\t\t\t\t$out[$name] = $value;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$out['pass'][] = $value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach($r as $found) {\r\n\t\t\t\t\t// if $found is a named url element (i.e. ':action')\r\n\t\t\t\t\tif (isset($names[$ii])) {\r\n\t\t\t\t\t\t$out[$names[$ii]] = $found;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// unnamed elements go in as 'pass'\r\n\t\t\t\t\t\t$found = explode('/', $found);\r\n\t\t\t\t\t\t$pass = array();\r\n\t\t\t\t\t\tforeach($found as $key => $value) {\r\n\t\t\t\t\t\t\tif ($value == \"0\") {\r\n\t\t\t\t\t\t\t\t$pass[$key] = $value;\r\n\t\t\t\t\t\t\t} elseif ($value) {\r\n\t\t\t\t\t\t\t\t$pass[$key] = $value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$out['pass'] = $pass;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ii++;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }", "function smarty_function_route(array $params, URLBuilder $builder)\n{\n $name = $params['route'];\n unset($params['route']);\n\n return $builder->toRoute($name, $params);\n}", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function getRouteParams();", "private function backroute($path, $params = array()) {\n\t\t// if other parameters are defined, action must also be defined.\n\t\t$controller = $params['controller'];\n\t\t$action = $params['action'];\n\n\t\t$pure_params = $params;\n\t\tunset($pure_params['controller'], $pure_params['action']);\n\t\t$serialized_pure_params = $pure_params ? serialize($pure_params) : '';\n\n\t\tif (!is_array($this->backroutes[$controller]))\n\t\t\t$this->backroutes[$controller] = array();\n\t\tif (!is_array($this->backroutes[$controller][$action]))\n\t\t\t$this->backroutes[$controller][$action] = array();\n\t\tif (!is_array($this->backroutes[$controller][$action][$serialized_pure_params]))\n\t\t\t$this->backroutes[$controller][$action][$serialized_pure_params] = array();\n\n\t\t// if controller is blank, let it be ''.\n\t\t// if action is blank, let it be ''.\n\t\t// if there are no other parameters, let $serialized_pure_params be ''.\n\t\t$this->backroutes[$controller][$action][$serialized_pure_params][] = $path;\n\t}", "function create_initial_rest_routes()\n {\n }", "public function getRouteInfo()\r\n {\r\n $rawRoutes = $this->getRoutes();\r\n $routes = array();\r\n foreach ($rawRoutes as $route => $params){\r\n $defaults = $params->getDefaults();\r\n if (isset($defaults['_controller']))\r\n {\r\n $controllerAction = explode(':', $defaults['_controller']);\r\n $controller = $controllerAction[0];\r\n $action = isset($controllerAction[2]) ? $controllerAction[2] : $controllerAction[1];\r\n\r\n if (!isset($routes[$controller])) {\r\n $routes[$controller] = array();\r\n }\r\n\r\n $routes[$controller][$action] = array(\r\n 'route' => $route,\r\n 'controller' => $controller,\r\n 'action' => $action,\r\n );\r\n }\r\n }\r\n return $routes;\r\n }", "protected abstract function urlByRouteSections (\\MvcCore\\IRoute $route, array & $params = [], $urlParamRouteName = NULL);", "public function createRouteObject();", "function loadMVC() {\r\n if(!empty($_REQUEST['url'])) {\r\n $urlArray = explode('/', $_REQUEST['url']);\r\n $controller = array_shift($urlArray);\r\n $action = array_shift($urlArray); \r\n }\r\n $url['controller'] = !empty($controller) ? $controller.'Controller' : 'baseController';\r\n $url['action'] = !empty($action) ? $action : 'index';\r\n controllerFactory::createControllerObject($url);\r\n}", "private function route() {\n if (class_exists($this->controllerName . $this->postfix)) {\n $fullName = $this->controllerName . $this->postfix;\n $this->controllerClass = new $fullName;\n $this->controllerClass->setUp();\n if (count($this->args > 1)) { // Pass args that are not controller class\n $this->controllerClass->setArgs($this->args);\n }\n\n // Second arg in url is our \"action\", try that as a method-call\n $method = strtolower($this->args[0]); // method names are case-insensitive. Might as well take advantage of it.\n if (isset($method) && method_exists($this->controllerClass, $method)) {\n $this->controllerClass->{$this->args[0]}();\n }\n \n } else { // No such class. Use our default\n $this->defaultRoute();\n }\n }", "static function route () {\n\t\tif (isset($_GET['path'])) {\n\t\t\t$get_path = $_GET['path'];\n\t\t}\n\t\telse {\n\t\t\t$get_path = '/';\n\t\t}\n\n\t\t// check if GET path has a match, show 404 by default if it does not\n\t\t$parameters = [];\n\t\t$controller_method = 'AppController::four_zero_four';\n\n\t\tforeach (self::$routes as $route) {\n\t\t\tif ($route['regex_path'] != '/') {\n\t\t\t\t$route['regex_path'] = trim($route['regex_path'], '/');\n\t\t\t}\n\n\t\t\tif (preg_match('|^'.$route['regex_path'].'$|i', $get_path, $parameters)) {\n\t\t\t\t// match found for GET path\n\t\t\t\tif ($route['auth_required'] == 'not_signed_in' && AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is not_signed_in and user is signed in, redirect to dashboard\n\t\t\t\t\tRedirector::redirect('dashboard');\n\t\t\t\t}\n\t\t\t\telse if ($route['auth_required'] == 'signed_in' && !AppUser::is_signed_in()) {\n\t\t\t\t\t// auth required is signed in and user is not signed in, redirect to sign in page\n\t\t\t\t\tRedirector::redirect('sign_in');\n\t\t\t\t}\n\n\t\t\t\tif ($route['permission_required'] == null || AppUser::has_permission($route['permission_required'])) {\n\t\t\t\t\t// set controller method if user has permission\n\t\t\t\t\t$controller_method = $route['controller_method'];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// user does not have permission, redirect to index\n\t\t\t\t\tRedirector::redirect('/');\n\t\t\t\t}\n\n\t\t\t\t// remove first parameter as it is the GET path and not a value we want\n\t\t\t\tif (!empty($parameters)) {\n\t\t\t\t\tunset($parameters[0]);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// route to the corresponding controller method\n\t\tcall_user_func_array($controller_method, $parameters);\n\t}", "public function routeController()\n\t{\n\t\t$action = \"actionIndex\";\n\n\t\tif (isset($_GET[\"p\"]))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$params = array_filter(explode(\"/\", $_GET[\"p\"]));\n\n\t\t\tif (count($params) != 1)\n\t\t\t{\n\t\t\t\t$action = \"action\";\n\n\t\t\t\tfor ($i = 1; $i < count($params); $i++)\n\t\t\t\t{\n\t\t\t\t\t$action .= ucwords($params[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$controller = \"Controller_\" . ucwords($params[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcall_user_func(array(new Controller_Index(), $action));\n\t\t\texit();\n\t\t}\n\n\t\tif (isset($controller) && class_exists($controller))\n\t\t{\n\t\t\tif (method_exists(new $controller(), $action))\n\t\t\t{\n\t\t\t\tcall_user_func(array(new $controller(), $action));\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\texit();\n\t\t}\n\t}", "public function Url ($controllerActionOrRouteName = 'Index:Index', $params = []);", "function AddRoutesToList($route_list)\n\t{\n\t\t$refl = new \\ReflectionClass($this); \n\t\t\n\t\tif ($this->app_instance == null)\n\t\t{\n\t\t\tthrow new \\Exception(\"Your controller \".$refl->getName().\" can't declare a constructor.<br />\\nInstead, add a function named __init() and place your constructor's code there.\");\n\t\t}\n\t\t\n \t\t$methods = $refl->getMethods();\n \t\tforeach($methods as $method)\n \t\t{\n \t\t\tif ($method->class == 'HappyPuppy\\Controller'){ continue; }\n \t\t\tif ($method->name == '__init'){ continue; }\n \t\t\tif ($method->name == 'defaultAction'){ continue; }\n\t\t\tif ($method->name == '__construct'){ continue; }\n\t\t\t\n\t\t\tif (!$this->isRoute($method)){ continue; }\n\n \t\t\t$controller_name = substr($method->class, 0, strlen($method->class)-10);\n \t\t\t$slashpos = strpos($controller_name, '\\\\');\n \t\t\tif ($slashpos != -1)\n \t\t\t{\n\t\t\t\t$controller_name = substr($controller_name, $slashpos + 1);\n \t\t\t}\n \t\t\t$rm = new \\ReflectionMethod($method->class, $method->name);\n \t\t\t$params = array();\n \t\t\tforeach($rm->getParameters() as $p)\n \t\t\t{\n\t\t\t\t$params[] = $p->name;\n \t\t\t}\n \t\t\t$routes = array();\n \t\t\t// do we have custom routes?\n \t\t\t$docstring = $rm->getDocComment();\n \t\t\t$custom_routes = Controller::GetCustomRoutes($docstring);\n \t\t\t$method_name = $method->name;\n \t\t\t$method_name = Route::NonPHPAction($method_name);\n\n\t\t\t$before_filters = $this->getActionBeforeFilters($method);\n \t\t\t\n\t\t\t$master_route = new Route($this->app_instance->name, $controller_name, $method_name, $params, 'GET');\n\t\t\t$master_route->before = $before_filters;\n\t\t\t\n \t\t\t// start populating routes\n \t\t\tif (!empty($custom_routes))\n \t\t\t{\n\t\t\t\tforeach($custom_routes as $custom_route)\n\t\t\t\t{\n\t\t\t\t\t$route = clone $master_route;\n\t\t\t\t\t$route->responds_to = $custom_route[0];\n\t\t\t\t\t$route->customRouteString = $custom_route[1];\n\t\t\t\t\t$routes[] = $route;\n\t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n\t\t\t\t$route = clone $master_route;\n\t\t\t\t$routes[] = $route;\n\t\t\t\t// if this is the default action, add a route\n\t\t\t\t$defaultAction = $this->getDefaultAction();\n\t\t\t\tif (is_equal($method_name, $defaultAction))\n \t\t\t\t{\n\t\t\t\t\t$route = clone $master_route;\n\t\t\t\t\t$route->omit_action = true;\n\t\t\t\t\t$routes[] = $route;\n\t\t\t\t\t// if this is also the default controller, add yet another route\n\t\t\t\t\t$defaultController = $this->app_instance->getDefaultController();\n\t\t\t\t\tif (is_equal($defaultController, $controller_name))\n\t\t\t\t\t{\n\t\t\t\t\t\t$route = clone $master_route;\n\t\t\t\t\t\t$route->omit_action = true;\n\t\t\t\t\t\t$route->omit_controller = true;\n\t\t\t\t\t\t$routes[] = $route;\n\t\t\t\t\t}\n \t\t\t\t}\n\t\t\t}\n\t\t\tforeach($routes as $route)\n\t\t\t{\n\t\t\t\tif (strcasecmp($_ENV[\"config\"][\"default_app\"], $this->app_instance->name) == 0)\n\t\t\t\t{\n\t\t\t\t\t$route->omit_app = true;\n\t\t\t\t}\n\t\t\t\t$route_list->AddRoute($route);\n\t\t\t}\n \t\t}\n\t}", "public function assignRoute(array $route);", "function parseRouterFromHtaccess($route)\n{\n\t///////////////////////////////////////////////\n\t//START customize URL\n\t$parts = explode('/', $route);\n\t\n\t//not check URL Rewrite if specified controller group\n\tif($parts[0] == 'admin' || $parts[0] == 'site')\n\t\treturn $route;\n\t\n\t$controllergroup = '';\n\t$controller = '';\n\t$action = '';\n\t$routerArgString = '';\n\t\n\tfor($i = 0; $i < count($parts); $i++)\n\t{\n\t\t$partValue = $parts[$i]; \n\t\t\n\t\tif(preg_match('/([a-z]+)\\.php$/', $partValue, $match)) //normal controller, such as(login,logout,register,tos,...)\n\t\t{\n\t\t\tif($controller != '')\n\t\t\t{\n\t\t\t\t$action = $partValue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controllergroup = 'site';\n\t\t\t\t$controller = $match[1];\n\t\t\t}\n\t\t}\n\t\telseif(preg_match('/page-(\\d+)/', $partValue, $match)) //this is a page group: page-1, page-2...\n\t\t{\n\t\t\t$_GET['page'] = $match[1];\n\t\t}\n\t\telseif(preg_match('/^[a-z0-9\\_-]+-(\\d+)$/', $partValue, $match))\t//photo detail url\n\t\t{\n\t\t\t$controllergroup = 'site';\n\t\t\t$controller = 'index';\n\t\t\t$action = 'detail';\n\t\t\t$_GET['photoid'] = $match[1];\n\t\t}\n\t\telseif(preg_match('/^[a-z0-9\\_-]+-c(\\d+)$/', $partValue, $match)) //category photos\n\t\t{\n\t\t\t$controllergroup = 'site';\n\t\t\t$controller = 'index';\n\t\t\t$action = 'index';\n\t\t\t$_GET['category'] = $match[1];\n\t\t}\n\t\telse if(strlen($partValue) > 0)\t// appending remain of route string parts\n\t\t{\n\t\t\t$routerArgString .= $partValue . '/';\n\t\t}\n\t}\n\t\n\t//assign default value for group,controller,action\n\tif($controllergroup == '') $controllergroup = 'site';\n\tif($controller == '') $controller = 'index';\n\tif($action == '') $action = 'index';\n\t\n\t//packing the route again after processing\n\t$route = '';\n\tif($controllergroup != '')\n\t\t$route .= $controllergroup . '/';\n\tif($controller != '')\n\t\t$route .= $controller . '/' ;\n\tif($action != '')\n\t\t$route .= $action . '/';\n\tif($routerArgString != '')\n\t\t$route .= $routerArgString;\n\t\t\n\t//die($route);\n\t\n\t//END customize URL\n\t/////////////////////////////////////////////////\n\t\n\treturn $route;\n}", "function getRouteParameters();", "private function getRoute(){\n\t}", "function callControllerAction() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n\n $route = $this->getMatchingRoute($santitizedUrl);\n if ($route != null) {\n $actionValues = explode('/', ltrim(str_replace($route->getUrl(), '', $santitizedUrl), '/'));\n $controllerName = $route->getControllerName();\n $controllerName = $controllerName . 'Controller'; \n $controller = new $controllerName;\n $action = $route->getActionName();\n $controller->$action($actionValues);\n } else {\n // If we've entered this else section, we've effectively been unable to match\n // the specified url to a registered route. Normally we would throw a 404\n // error and return a user friendly message stating so, however, I'm leaving\n // that as an exersize for the reader\n }\n \n }", "#[Route('/very/cool/route/{foo}/{bar}', name: 'very_cool_route',\n defaults: ['foo' => 'foo', 'bar' => 'bar'])]\n public function eatIt()\n {\n }", "public function ParseRequestUri(){\n $uri_arr = explode('/',$this->request_uri);\n $this->controller_name = empty($uri_arr[2]) ? 'top' : $uri_arr[2];\n $this->action_name = empty($uri_arr[3]) ? 'index' : $uri_arr[3];\n }", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "public static function routes(): void\n {\n //\n }", "public function get_route()\n {\n }", "function api_route($path, $controller) {\n Route::post($path, $controller . '@store');\n Route::delete($path . '/{hash}', $controller . '@destroy');\n Route::get($path . \"/{hash}\", $controller . '@fetch');\n Route::put($path . '/{hash}', $controller . '@update');\n Route::get($path, $controller . '@index');\n}", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public static function draw() {\n\n //$request_route = new ApplicationRoute($_SERVER[\"REQUEST_METHOD\"], $_SERVER['REQUEST_URI'], false);\n $request_route = [ \"_rule\" => $_SERVER['REQUEST_URI'], \"_method\" => $_SERVER[\"REQUEST_METHOD\"] ];\n\n $r = new ApplicationRoutes();\n\n // İzin verilmiş route'ları routes'a yükle\n $permitted_routes = func_get_args();\n foreach ($permitted_routes as $permitted_route) {\n\n if (is_array($permitted_route)) { // for ApplicationRoutes::resource();\n foreach ($permitted_route as $permitted_r)\n $r->set_route($permitted_r);\n } else {\n $r->set_route($permitted_route);\n }\n\n }\n\n // // // TEST $route list\n // print_r($r->_routes);\n\n // foreach ($r->_routes as $method => $routes) {\n // echo \"<br/>\";\n // print_r($method);\n // echo \"<br/>\";\n\n // foreach ($routes as $route) {\n // echo \"<br/>\";\n // print_r($route);\n // echo \"<br/>\";\n // }\n // }\n\n // İstek url ile routes'ı içinden bul ve sevk et\n if ($route = $r->get_route($request_route)) {\n $route->run();\n } else {\n $v = new ApplicationView();\n $v->set([\"text\" => _404()]);\n $v->run();\n }\n }", "abstract public function getRoute();", "public function __construct()\n {\n $url = isset($_GET['url'])? $_GET['url']: null;\n //quitamos el ultimo /\n $url = rtrim($url, '/');\n //comvertimos en array los elemntos de la URL(peticion)\n $url = explode('/', $url);\n\n //echo \"<pre>\", print_r($url), \"</pre>\";\n\n //si el usuario no proporciona un controlador\n if (empty($url[0])){\n //lamamos al controlador predeterminado\n require_once '../app/controllers/homeController.php';\n (new \\App\\Controllers\\HomeController())->index();\n return false;\n }\n\n //cuando el usuario especifique un controlador\n //formamos la ruta de ese controlador\n $path_controller = '../app/controllers/' . $url[0] . 'Controller.php';\n //verificamos si el controlador especifique existe\n if(file_exists($path_controller)){\n //creamos una instancia de dicha controlador\n require_once $path_controller;\n $controller_name = '\\\\App\\\\Controllers\\\\'.$url[0] . 'Controller';\n $controller = new $controller_name();\n\n //si la cantidad de elementos del array es >=2\n //entonces se ha especificado un controlador y una accion\n $size =count($url);\n\n if ($size >= 2) {\n //verificamos que la accion especificada por el usuario exista en el cotrolador\n if (method_exists($controller, $url[1])) {\n //verificar si existen parametros\n if ($size >= 3) {\n // al menos el usuario a especificado un parametro\n\n //capturamos los parametrosintegrados en un array\"param\"\n $param = [];\n for ($i=2; $i <$size; $i++){\n array_push($param, $url[$i]);\n }\n //lamamos al controlador, su accion y especificamos los parametros\n $controller->{$url[1]}($param);\n } else {\n // El usuario no ha especificado parametros entoces llamamos \n //accion sin parametros\n $controller->{$url[1]}();\n }\n \n } else {\n echo \"el metodo de acción {$url[1]} no existe\";\n }\n \n } else {\n //cuando el usuario no especifico ninguna accion\n //lamamos de manera predeterminada el metodo inex\n $controller->index();\n }\n \n //echo \"El controlador {$url[0]} existe\";\n }else{\n echo \"El controlador {$url[0]} no existe\";\n }\n }", "public function frontControllerRoute()\n\t{\n\t\t#step 1\n\t\t#take current url and separate to controller, method and parameters\n\t\t$this->request = new CRequest($this->config['url_type']);\n\t\t$this->request->init($this->config['base_url'], $this->config['routing']);\n\t\t\n\t\t$controller \t= $this->request->controller;\n\t\t$method \t= $this->request->method;\n\t\t$args \t\t= $this->request->args;\n\t\n\t\t\n\t\t#step 2\n\t\t#Check if there is a method in the controller classs\n\t\t$controllerExists\t= isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled \t= false;\n\t\t$className \t= false;\n\t\t$classExists \t= false;\n\t\t\n\t\tif($controllerExists) {\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\t\t\n\t\tif($controllerExists && $controllerEnabled && $classExists)\n\t\t{\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')) \n\t\t\t{\n\t\t\t\t$formattedMethod = str_replace(array('_', '-'), '', $method);\n\t\t\t\tif($rc->hasMethod($formattedMethod)) \n\t\t\t\t{\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($formattedMethod);\n\t\t\t\t\tif($methodObj->isPublic()) \n\t\t\t\t\t{\n\t\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $args);\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller method not public.'); \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\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t}\n\t\t} \n\t\telse \n\t\t{ \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\t\t\n\t}", "public function _set_routing()\n\t{\n\t\t// Load the routes.php file.\n\t\t$route = $this->CI->config->get('routes.php', 'route');\n\n\t\t// Set route remapping\n\t\t$this->routes = is_array($route) ? $route : array();\n\t\tunset($route);\n\n\t\t// Set the default controller so we can display it in the event\n\t\t// the URI doesn't correlate to a valid controller.\n\t\t$this->default_controller = empty($this->routes['default_controller'])\n\t\t\t? FALSE : strtolower($this->routes['default_controller']);\n\n\t\t// Are query strings enabled in the config file? Normally CI doesn't utilize query strings\n\t\t// since URI segments are more search-engine friendly, but they can optionally be used.\n\t\t// If this feature is enabled, we will gather the directory/class/method a little differently\n\t\t$ctl_trigger = $this->CI->config->item('controller_trigger');\n\t\tif ($this->CI->config->item('enable_query_strings') === TRUE && isset($_GET[$ctl_trigger]))\n\t\t{\n\t\t\t$segments = array();\n\n\t\t\t// Add directory segment if provided\n\t\t\t$dir_trigger = $this->CI->config->item('directory_trigger');\n\t\t\tif (isset($_GET[$dir_trigger]))\n\t\t\t{\n\t\t\t\t$segments[] = trim($this->CI->uri->_filter_uri($_GET[$dir_trigger]));\n\t\t\t}\n\n\t\t\t// Add controller segment - this was qualified above\n\t\t\t$class = trim($this->CI->uri->_filter_uri($_GET[$ctl_trigger]));\n\t\t\t$segments[] = $class;\n\n\t\t\t// Add function segment if provided\n\t\t\t$fun_trigger = $this->CI->config->item('function_trigger');\n\t\t\tif (isset($_GET[$fun_trigger]))\n\t\t\t{\n\t\t\t\t$segments[] = trim($this->CI->uri->_filter_uri($_GET[$fun_trigger]));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Fetch the complete URI string, remove the suffix, and explode\n\t\t\t$this->CI->uri->_fetch_uri_string();\n\t\t\t$this->CI->uri->_remove_url_suffix();\n\t\t\t$this->CI->uri->_explode_segments();\n\t\t\t$segments = $this->CI->uri->segments;\n\t\t}\n\n\t\t// Set the route stack\n\t\t$this->_set_request($segments);\n\t}", "function json_oauth_api_routes( $data ) {\n\tif (empty($data['authentication'])) {\n\t\t$data['authentication'] = array();\n\t}\n\n\t$data['authentication']['oauth1'] = array(\n\t\t'request' => home_url( 'oauth1/request' ),\n\t\t'authorize' => home_url( 'oauth1/authorize' ),\n\t\t'access' => home_url( 'oauth1/access' ),\n\t\t'version' => '0.1',\n\t);\n\treturn $data;\n}", "private function extractRouteParams()\n {\n // Extract params\n $params = array_filter(explode('/', $_GET['url']));\n\n // First parameter is the controller\n $this->_controller = $params[0];\n\n // Second parameter is the action method\n\t\tif (isset($params[1]) && !empty($params[1])) {\n\t\t\t$this->_action = $params[1];\n\t\t}\n\n // Set additional parameters\n\t\tif (isset($params[2]) && !empty($params[2])) {\n\t\t\t$this->_urlParams = $params[2];\n\t\t}\n }", "public function FrontControllerRoute() {\n\t\t// Step 1\n\t\t// Take current url and divide it in controller, method and parameters\n\t\t$this->request = new CRequest($this->config['base_url']);\n\t\t$this->request->Init();\n\t\t$controller = $this->request->controller;\n\t\t$method = $this->request->method;\n\t\t$arguments = $this->request->arguments;\n\n\t\t$controllerExists = isset($this->config['controllers'][$controller]);\n\t\t$controllerEnabled = false;\n\t\t$className = false;\n\t\t$classExists = false;\n\n\t\tif($controllerExists){\n\t\t\t$controllerEnabled = ($this->config['controllers'][$controller]['enabled'] == true);\n\t\t\t$className = $this->config['controllers'][$controller]['class'];\n\t\t\t$classExists = class_exists($className);\n\t\t}\n\n\n\n\t\t// Step 2\n\t\t// Check if there is a callable method in the controller class, if then call it\n\n\t\tif($controllerExists && $controllerEnabled && $classExists){\n\t\t\t$rc = new ReflectionClass($className);\n\t\t\tif($rc->implementsInterface('IController')){\n\t\t\t\tif($rc->hasMethod($method)){\n\t\t\t\t\t$controllerObj = $rc->newInstance();\n\t\t\t\t\t$methodObj = $rc->getMethod($method);\n\t\t\t\t\t$methodObj->invokeArgs($controllerObj, $arguments);\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"404. \" . get_class() . ' error: Controller does not contain method.');\n\t\t\t\t}\n\t } else {\n\t \tdie('404. ' . get_class() . ' error: Controller does not implement interface IController.');\n\t\t\t\t}\n\t\t} else { \n\t\t\tdie('404. Page is not found.');\n\t\t}\n\t\n\n\n\t\t$this->data['debug'] = \"REQUEST_URI - {$_SERVER['REQUEST_URI']}\\n\";\n\t\t$this->data['debug'] .= \"SCRIPT_NAME - {$_SERVER['SCRIPT_NAME']}\\n\";\n\t}", "public static function route(array $route)\n\t\t{\n\t\t\t// Store actual Route, within the REQUEST_URI server\n\t\t\tBootstrap::getInstance()->setServerUri(implode('/', $route));\n\n\t\t\t$controller = ucfirst(urldecode(array_shift($route)));\n\n\t\t\ttry {\n\t\t\t\t$class = new ReflectionClass($controller);\n\t\t\t\t$method = new ReflectionMethod($controller, urldecode(array_shift($route)));\n\n\t\t\t\tif (($method->isPublic()) && ($class->isInstantiable())) {\n\t\t\t\t\t// is there any arguments ?\t\t\t\t\t\n\t\t\t\t\tif ((count($route) == 0) && ($method->getNumberOfRequiredParameters() == 0)) {\n\t\t\t\t\t\treturn $method->invoke($class->newInstance(Bootstrap::getInstance(), $class->name, $method->name), null);\n\t\t\t\t\t}\n\n\t\t\t\t\t// are we sending the correct amount of parameters ?\n\t\t\t\t\tif (count($route) >= $method->getNumberOfRequiredParameters()) {\n\t\t\t\t\t\treturn $method->invokeArgs($class->newInstance(Bootstrap::getInstance(), $class->name, $method->name), $route);\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow new RouterException('The controller method was not sent the correct amount of parameters', 404);\n\t\t\t\t}\n\n\t\t\t\tthrow new RouterException('The method is either not public or the class is not isInstantiable', 404);\n\t\t\t} catch (ClassNotFoundException $e) {\n\t\t\t\t// catch it for Line 51\n\t\t\t}\n\n\t\t\t$route = func_get_args();\n\n\t\t\tthrow new RouterException('The controller/method could not be found | ' . implode('::', array_slice($route[0], 0, 2)) . '()', 404, ifsetor($e));\n\t\t}", "private function route() {\n\n// if (!in_array($_GET['page'], $pages)) {\n// echo \"bad\";\n// exit;\n// }\n\n if (!empty($_GET['page']) && file_exists( __ROOT__.'controller/'.$_GET['page'].'.php')) {\n include __ROOT__.'controller/'.$_GET['page'].'.php';\n } else {\n include __ROOT__.'controller/home.php';\n }\n include __ROOT__.'public/footer.html';\n }", "public function routes()\n {\n return [\n 'GET' => [\n 'main' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'services' => [\n 'name' => 'services'\n ],\n 'contacts' => [\n 'name' => 'contacts'\n ],\n 'typography' => [\n 'name' => 'typography'\n ],\n 'test' => [\n 'name' => 'test'\n ],\n 'test1' => [\n 'name' => 'test1'\n ]\n ],\n 'blog' => [\n 'index' => [\n 'name' => 'index'\n ],\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ],\n 'edit' => [\n 'name' => 'view',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ],\n 'user' => [\n //'index' => 'index',\n 'login' => [\n 'name' => 'login'\n ],\n 'register' => [\n 'name' => 'register'\n ],\n 'logout' => [\n 'name' => 'logout',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'change-password' => [\n 'name' => 'change-password',\n 'required' => [\n 'auth' => true\n ],\n ],\n 'forget-password' => [\n 'name' => 'forget-password',\n 'required' => [\n 'auth' => true\n ],\n ]\n ],\n 'auth' => [\n 'vk' => [\n 'name' => 'vk'\n ]\n ],\n 'config' => [\n 'index' => [\n 'name' => 'index',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'sitemap' => [\n 'name' => 'sitemap',\n 'required' => [\n 'auth' => true\n ]\n ]\n ],\n 'portfolio' => [\n 'view' => [\n 'name' => 'view',\n 'required' => [\n 'param' => true\n ]\n ]\n ],\n 'ajax' => [\n 'template' => [\n 'name' => 'template',\n 'required' => [\n 'ajax' => true\n ]\n ],\n 'test' => [\n 'name' => 'test',\n 'required' => [\n 'ajax' => true\n ]\n ]\n ]\n ],\n 'POST' => [\n 'ajax' => [\n 'form-feedback' => [\n 'name' => 'form-feedback',\n 'required' => [\n 'refer' => 'https://uiweb.ru/'\n ]\n ],\n 'form-backcall' => [\n 'name' => 'form-backcall',\n 'required' => [\n 'refer' => 'https://uiweb.ru/main/contacts'\n ]\n ],\n 'form-login' => [\n 'name' => 'form-login'\n ],\n 'form-register' => [\n 'name' => 'form-register'\n ],\n 'form-change-password' => [\n 'name' => 'form-change-password'\n ]\n ],\n 'blog' => [\n 'create' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true\n ]\n ],\n 'edit' => [\n 'name' => 'create',\n 'required' => [\n 'auth' => true,\n 'param' => true\n ]\n ]\n ]\n ],\n 'PUT',\n 'PATCH',\n 'TRACE',\n 'DELETE',\n 'HEAD',\n 'OPTIONS'\n ];\n }" ]
[ "0.65046793", "0.6400183", "0.62917715", "0.6287394", "0.62566066", "0.6255376", "0.61948305", "0.6175578", "0.6066843", "0.6040008", "0.6037414", "0.6014", "0.60030013", "0.5986194", "0.59634763", "0.5963272", "0.59119296", "0.59098446", "0.5908987", "0.58834106", "0.5872011", "0.58693784", "0.586569", "0.5856068", "0.5839247", "0.57996416", "0.5781348", "0.5763975", "0.5761124", "0.5731128", "0.5730726", "0.5726912", "0.57241696", "0.5718421", "0.56827176", "0.56789196", "0.56545836", "0.5650402", "0.5637966", "0.5626445", "0.56237596", "0.5623183", "0.5619896", "0.56148", "0.560779", "0.5601516", "0.5600993", "0.5591179", "0.5591077", "0.5584511", "0.5574268", "0.5570595", "0.55639744", "0.5562897", "0.5561769", "0.5560757", "0.5558763", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5557178", "0.5555707", "0.5553708", "0.5553679", "0.5547534", "0.554705", "0.55294526", "0.5521656", "0.5517687", "0.5516867", "0.5509296", "0.5508327", "0.5501896" ]
0.0
-1
Used to upgrade (rehash) the user's password automatically over time.
public function getPassword($credentials): ?string { return $credentials['password']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_password()\n {\n }", "protected function changePassword() {}", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "function password_update($password) {\n\t\t$hash = hash_password($password);\n\t\tlgi_mysql_query(\"UPDATE %t(users) SET `passwd_hash`='%%' WHERE `name`='%%'\",$hash, $this->userid);\n\t}", "public function changeUserPassword($uid,$newPassword);", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "protected function _updatePassword() {\n\t\tif(!check($this->_userid)) return;\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_newPassword)) return;\n\t\tif($this->_md5Enabled) {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'username' => $this->_username,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:newpassword, :username) WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = :newpassword WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "function change_pwd_update_register(){\n\t\tglobal $CFG;\n\t\t$old_password = $this->My_addslashes(md5($_POST[\"old_password\"]));\n\t\t \n\t\t$new_password = md5($_POST[\"new_password\"]);\n\t \n\t\tif($this->chkPasswordInAdmin($old_password,$_SESSION['adminid'])){\n\t\t\t\t$UpQuery = \"UPDATE \".$CFG['table']['admin'].\" SET password = '\".$this->filterInput($new_password).\"' WHERE admin_id = \". $this->filterInput($_SESSION['adminid']);\n\t\t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\n\t\t\t}\n\t\telse{\t\n\t\t\techo \"Invalid_Old_Pwd\";\t\t\t\n\t\t\texit();\n\t\t\t}\n\t}", "function change_passwd($Username, $old_Password, $new_Password){\n $new_Password = encrypt_pwd($new_Password);\n $SQL = \"UPDATE User SET Password = '$new_Password' WHERE Username='$Username'\";\n mysqli_query($this->db_link, $SQL);\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function updatePassword(UserInterface $user);", "function mysql_auth_change_password($username,$password)\n{\n $encrypted = crypt($password,'$1$' . strgen(8).'$');\n return dbUpdate(array('password' => $encrypted), 'users', '`username` = ?', array($username));\n}", "public function testUpdatePasswordNotGiven(): void { }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function updatePwdHashIfNeeded(string $sPassword, string $sUserPasswordHash, string $sEmail): void;", "public function setPassword($newPassword);", "public function changePassword(User $user, string $newPassword): void;", "function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}", "public function updatePassword(ExtendedUserInterface $user);", "function updatePassword(){\n\t\tglobal $recoverPasswordInputs, $pdo;\n\t\t$newPass = createNewPassword();\n\t\t$updatePassword = $pdo->prepare('UPDATE `USER` SET `hash` = :newHash WHERE email = :email AND firstName = :firstName AND lastName = :lastName');\n\t\t$updatePassword->bindValue(':newHash', md5($newPass));\n\t\t$updatePassword->bindValue(':email', $recoverPasswordInputs['email']);\n\t\t$updatePassword->bindValue(':firstName', $recoverPasswordInputs['fname']);\n\t\t$updatePassword->bindValue(':lastName', $recoverPasswordInputs['lname']);\n\t\t$updatePassword->execute();\n\t\treturn $newPass;\n\t}", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "function wp_set_password( $password, $user_id ) {\n\t\tglobal $wpdb;\n\n\t\t$hash = wp_hash_password( $password );\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->users,\n\t\t\t[\n\t\t\t\t'user_pass' => $hash,\n\t\t\t\t'user_activation_key' => '',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ID' => $user_id,\n\t\t\t]\n\t\t);\n\n\t\twp_cache_delete( $user_id, 'users' );\n\n\t\treturn $hash;\n\t}", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "public function modifpassword($user,$passwd){\n \n }", "public function activatenewpasswordAction()\n {\n $newKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME, null);\n $userId = $this->getRequest()->getParam(User::COLUMN_USERID, null);\n\n $user = $this->_getUserFromIdAndKey($userId, $newKey);\n if(!$user){\n Globals::getLogger()->info(\"New password activation: user retrieval failed - userId=$userId, key=$newKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_SUCH_USER));\n }\n\n $user->{User::COLUMN_PASSWORD} = $user->newPassword;\n $user->newPassword = '';\n $user->activationKey = '';\n\n $id = $user->save();\n if($id != $user->{User::COLUMN_USERID}){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NEWPASSWORD_ACTIVATION_FAILED));\n }\n\n Utils::deleteCookie(User::COOKIE_MD5);\n Utils::deleteCookie(User::COOKIE_USERNAME);\n Utils::deleteCookie(User::COOKIE_REMEMBER);\n\n $this->_savePendingUserIdentity($userId);\n\n $this->_helper->redirectToRoute('userupdate',array('newPassword'=>true));\n }", "function reset_user_passwd($user_id) {\r\n\r\n //set the new password\r\n $new_passwd = \"newpasswod\";\r\n \r\n if ($new_passwd == false) {\r\n throw new Exception ('Could not generate the new password.');\r\n }\r\n \r\n //add numbers to the new passwd to increase the securtiy\r\n $rand_number = rand(0, 999);\r\n $new_passwd . $rand_number;\r\n \r\n //update the new passwd with db\r\n $conn = db_connect();\r\n\r\n $result = $conn->query(\"update users set user_passwd = sha1('\".$new_passwd.\"') where user_id = '\".$user_id.\"'\");\r\n if (!$result) {\r\n throw new Exception ('Could not reset the password.');\r\n }\r\n else {\r\n return true; \r\n }\r\n\r\n }", "function user_update_password($user, $newpassword) {\n $user = get_complete_user_data('id', $user->id);\n // This will also update the stored hash to the latest algorithm\n // if the existing hash is using an out-of-date algorithm (or the\n // legacy md5 algorithm).\n return update_internal_user_password($user, $newpassword);\n }", "protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}", "Public Function changePassword($NewPassword)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET Password = md5('$NewPassword') WHERE ID = $this->id\");\n\t}", "function changePassword( $name, $pw ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['users'] as &$user) {\n if ($name == $user['name'] || $name == $user['email']) {\n $user[\"password\"] = $pw;\n saveDB( $d );\n $found = true;\n break;\n }\n }\n if (!$found)\n return FALSE;\n audit( \"changePassword done\", $name );\n return TRUE;\n }", "function user_changed_password($user_id, $new_password) {\n \n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "function save_psw_hash( $user, $pass = '' ) { \n\t\tglobal $wpdb;\n\n\t\tif ( !isset($user->ID) ) return;\n\n\t\tif ( !isset( $user->user_pass ) ) return;\n\n\t\t$oh = get_user_meta( $user->ID, 'll_old_hashes', true);\n\n\t\t$oh[] = wp_hash_password( $user->user_pass ); // cleartext, so hash it\n\n\t\t$c = count($oh); \n\n\t\tif ( $c > 5 ) { \n\t\t\t$removed = array_splice($oh, 0, ($c - 5) );\n\t\t}\n\n\t\tupdate_user_meta( $user->ID, 'll_old_hashes', $oh );\n update_user_meta( $user->ID, 'll_password_changed_date', time() );\n\n\t}", "public function setPassword($newPassword){\n\t}", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}", "public function changePassword($username, $password);", "function update_password($new_pass, $pivot, $data_from_pivot)\n{\n global $DB_connect;\n $new_pass = password_hash($new_pass, PASSWORD_DEFAULT);\n\n $statement = $DB_connect->prepare(\"UPDATE db.user set password = :password WHERE \" . $pivot . \" = :data_from_pivot\");\n $statement->execute(['password' => $new_pass, 'data_from_pivot' => $data_from_pivot]);\n}", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function updatePassword($password)\n {\n $this->password = password_hash($password, PASSWORD_DEFAULT);\n }", "function update_forgot_password($user, $token, $expires);", "function update_paypassword()\n {\n }", "function force_user_password_change_now() { \n\t\tglobal $wpdb;\n\n\t\t$sql = 'select ID, user_login, user_email from '.$wpdb->users;\n\n\t\t$res = $wpdb->get_results($sql, ARRAY_A);\n\n\t\tif (!$res) return; // this condition would be weird eh? \n\n\t\t$msgs = array();\n\n\t\tforeach ( $res as $u ) { \n\n\t\t\t$rand_psw = wp_hash_password( wp_generate_password(16) );\n\t\t\twp_set_password( $rand_psw, $u['ID'] );\n\t\t\tupdate_user_meta( $u, 'll_force_password_change_now', 1 );\n\n\t\t\t// Generate something random for a key...\n\t\t\t$key = wp_generate_password(20, false);\n\t\t\tdo_action('retrieve_password_key', $u['user_login'], $key);\n\t\t\t// Now insert the new md5 key into the db\n\t\t\t$wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $u['user_login']));\n\n\t\t\t$res = $this->ll_alert_user( $u['user_login'], $u['user_email'], $key );\n\n\t\t\tif ( '' != $res ) \n\t\t\t $msgs[] = $res; \n\t\t}\n\n\t\treturn $msgs; \n\n\t}", "public function update(){\n\t\t$sql = \"update user set pass='\".$this->pass.\"' where id='\".$this->id.\"'\";\n\t\treturn\tExecutor::doit($sql);\n\t}", "public function change(string $password): void;", "public function changePassword()\n {\n $this->validateOnly('password', [\n 'password' => 'bail|nullable|required_with:password_confirmation|string|confirmed',\n 'current_password' => 'bail|required',\n ]);\n\n if (!Hash::check($this->current_password, $this->user->password)) {\n $this->addError('current_password', 'Your current password is incorrect.');\n return;\n }\n\n $this->user->password = bcrypt($this->password);\n $this->user->save();\n $this->toast('Password has been changed!', 'success');\n $this->emit('password-updated');\n $this->reset(['password', 'password_confirmation', 'current_password']);\n }", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "function changeUserPassword($user_id, $password){\n $md5_password = md5($password);\n sqlQuery(\"UPDATE users SET user_password='$md5_password' WHERE user_id='$user_id'\");\n}", "public function autoUpdatePassword(int $userId, string $password): void\n {\n $user = $this->get($userId, ['fields' => ['id', 'password']]);\n $oldPassword = $user->get('password');\n $needsRehash = $this->getPasswordHasher()->needsRehash($oldPassword);\n if ($needsRehash) {\n $user->set('password', $password);\n $this->save($user);\n }\n }", "public function setPasswordAttribute($old){\n $this->attributes['password'] = bcrypt($old);\n }", "function reset_password($username) {\n// return the new password or false on failure\n // get a random dictionary word b/w 6 and 13 chars in length\n $new_password = get_random_word(6, 13);\n\n if($new_password == false) {\n throw new Exception('Could not generate new password.');\n }\n\n // add a number between 0 and 999 to it\n // to make it a slightly better password\n $rand_number = rand(0, 999);\n $new_password .= $rand_number;\n\n // set user's password to this in database or return false\n $conn = db_connect();\n $result = $conn->query(\"update user\n set passwd = '\".$new_password.\"'\n where username = '\".$username.\"'\");\n if (!$result) {\n throw new Exception('Could not change password.'); // not changed\n } else {\n return $new_password; // changed successfully\n }\n}", "function password_recovery()\n\t{\n\n\n\t}", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "public function setPassword(){\n\t}", "function change_password($user_id, $password)\n{\n\n $query = \"select salt, username from tblUser where user_id='$user_id' limit 1\";\n $result = mysql_query($query);\n $user = mysql_fetch_array($result);\n\n $encrypted_pass = md5(md5($password).$user['salt']);\n\n // And lastly, store the information in the database\n $query = \"UPDATE tblUser SET password='$encrypted_pass' WHERE user_id='$user_id'\";\n mysql_query ($query) or die ('Could not create user.');\n\n\t//login user\n\t$username = $user['username'];\n\t$result = user_login($username, $password);\n\n}", "function dbUpdatePassword($pass)\n {\n $this->password = $pass;\n /* Standard replace does not replace passwords */\n $args = [\n 'password%sql' => array('MD5(%s)', $this->password)\n ];\n dibi::query('UPDATE user SET ', $args, 'WHERE `id`=%i', $this->id);\n }", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function updatepassword() {\n $request = Request::all();\n $rules = ['old_password' => 'required', 'password' => 'required|confirmed|min:6'];\n $v = Validator::make($request, $rules);\n if ($v->fails()) {\n return redirect()->back()->withErrors($v->errors());\n }\n $user = User::find(Auth::user()->id);\n if (!Hash::check($request['old_password'], $user->password)) {\n return redirect()->back()->withErrors([\"old_password\" => [0 => \"The old password does not match.\"]]);\n }\n\n $user->password = bcrypt($request['password']);\n $user->save();\n return redirect()->back()->with('status', 'Your password changed succesfully');\n }", "function passwordCheck($DB_LINK, $username, $password, $hash){\n\n if (password_needs_rehash($hash, PASSWORD_DEFAULT)){ //si necesita aplicarse otro algoritmo más seguro se le aplicará automáticamente\n $newHash = generateHash($password);\n $query2 = \"UPDATE usuarios SET Contraseña = '$newHash' WHERE Usuario = '$username'\";\n mysqli_query($DB_LINK, $query2);\n }\n if(password_verify($password, $hash)){ //comprobamos que sea la misma contraseña\n \n return true; //habremos accedido\n }\n else{\n return false;\n }\n}", "public function change_pass()\n\t{\n\t\t$form = array();\n\n\t\t$form['validation']['params'] = array('password_old', 'password', 'password_confirm');\n\n\t\t$form['submit'] = function ($params) {\n\t\t\treturn $this->_change_pass_submit();\n\n\n\t\t};\n\n\t\t$form['form'] = function () {\n\t\t\tpage_info('title', lang('title_change_pass'));\n\n\t\t\t$this->_display();\n\t\t};\n\n\t\t$this->_form($form);\n\t}", "function do_change_password($puuid, &$error, $set_force_reset=false) {\n global $_min_passwd_len;\n global $_passwd_numbers;\n global $_passwd_uperlower;\n global $_passwd_chars;\n\n if($puuid === '') {\n $error = \"No PUUID given\";\n return false;\n }\n\n if($_REQUEST['p1'] === $_REQUEST['p2']) {\n $temparr = array();\n $p = $_REQUEST['p1'];\n\n // do strength test here\n if(strlen($p) < $_min_passwd_len) {\n $error = \"Password too short\";\n return false;\n }\n if($_passwd_numbers && !preg_match('/[0-9]/', $p)) {\n $error = \"Password must contain one or more numbers\";\n return false;\n }\n if($_passwd_uperlower && \n \t(!preg_match('/[A-Z]/', $p) || !preg_match('/[a-z]/', $p))) {\n $error = \"Password must contain both upper case and lower case\";\n return false;\n }\n if($_passwd_chars && \n \t(preg_match_all('/[A-Za-z0-9]/', $p, &$temparr) == strlen($p))) {\n $error = \"Password must contain non-alphanumeric characters\";\n return false;\n }\n\n // we got here, so update password\n $s = \"SELECT distinct passwordtype from password_types\";\n $res = pg_query($s);\n if (!$res) {\n $error = \"DB Error\";\n return false;\n }\n $hashes = pg_fetch_all($res);\n pg_free_result($res);\n\n hpcman_log(\"Updating \".count($hashes).\" password hashes for puuid \".$puuid);\n\n if (!pg_query(\"BEGIN\")) {\n $error = \"Could not begin transaction\";\n return false;\n }\n\n foreach($hashes as $hash) {\n $s = \"UPDATE passwords SET password=$1 \n\tWHERE puuid=$2 AND passwordtype=$3\";\n $passwd = hpcman_hash($hash['passwordtype'], $p);\n $result = pg_query_params($s, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"DB Error\";\n return false;\n }\n\n $acount = pg_affected_rows($result);\n\n if ($acount > 1) {\n $error = \"Error: Too many rows\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n } else if ($acount < 1) {\n hpcman_log(\"Adding new password hash {$hash['passwordtype']} for $puuid\");\n $sql = \"INSERT INTO passwords (password, puuid, passwordtype) VALUES ($1,$2,$3)\";\n $result = pg_query_params($sql, array($passwd, $puuid, $hash['passwordtype']));\n if (!$result) {\n $error = \"Error: Not enough rows; insert failed\";\n if(!pg_query(\"ROLLBACK\")) {\n $error .= \", rollback failed\";\n }\n return false;\n }\n }\n }\n\n if (!pg_query(\"COMMIT\")) {\n $error = \"DB Error: Commit failed\";\n return false;\n }\n\n if($set_force_reset) {\n $sql = \"UPDATE authenticators SET mustchange='t' \n\tWHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n\t$error = \"DB Error\";\n return false;\n }\n } else {\n $sql = \"UPDATE authenticators SET mustchange='f'\n WHERE puuid=$1 AND authid=0\";\n if(!pg_query_params($sql, array($puuid))) {\n $error = \"DB Error\";\n return false;\n }\n }\n } else {\n $error = \"Passwords do not match\";\n return false;\n }\n return true;\n}", "public function clobberPassword()\n\t{\n\t\tif( empty($this->myAuthID) && empty($this->myAccountID) )\n\t\t\tthrow PasswordResetException::toss( $this, 'NO_ACCOUNT_OR_AUTH_ID' ) ;\n\t\tif( empty($this->myNewToken) )\n\t\t\tthrow PasswordResetException::toss( $this, 'REENTRY_AUTH_FAILED' ) ;\n\t\t$theAuthFilter = $this->chooseIdentifierForSearch() ;\n\t\t$theSql = SqlBuilder::withModel( $this->model )\n\t\t\t->startWith( 'UPDATE ' )->add( $this->model->tnAuth )\n\t\t\t->setParamPrefix( ' SET ' )\n\t\t\t->mustAddParam( 'pwhash',\n\t\t\t\t\tStrings::hasher( $this->getRandomCharsFromToken() ) )\n\t\t\t->startWhereClause()\n\t\t\t->mustAddParam( $theAuthFilter['col'], $theAuthFilter['val'] )\n\t\t\t->endWhereClause()\n\t\t\t;\n//\t\t$this->debugLog( $theSql->mySql ) ;\n\t\ttry { $theSql->execDML() ; }\n\t\tcatch( PDOException $pdox )\n\t\t{\n\t\t\t$this->errorLog( __METHOD__ . ': ' . $pdox->getMessage() ) ;\n\t\t\tthrow PasswordResetException::toss( $this,\n\t\t\t\t\t'DANG_PASSWORD_YOU_SCARY' ) ;\n\t\t}\n\t}", "public function updatePassword($user){\n\t\tUser::where('id', $this->id)\n\t\t\t->update([\n\t\t\t\t'password' => bcrypt($user['password']),\n\t\t\t\t'updated_by' => $this->name,\n\t\t\t\t'updated_by' => Auth::user()->name\n\t\t]);\n\t}", "public function regeneratePassword(string $email): void;", "public function change()\r\n {\r\n// var_dump($this->validate());die;\r\n if ($this->validate()) {\r\n $user = $this->_user; \r\n $user->setPassword($this->newPwd);\r\n $user->removePasswordResetToken();\r\n return $user->save(false);\r\n }\r\n \r\n return false;\r\n }", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "protected function configureSaltedPasswords() {}", "function ModifMiniPassUser( $passUser ){\r\n return md5($passUser);\r\n}", "public function testUpdatePasswordOnlyLowerCase(): void { }", "function user_changed_password($user_id, $new_password)\n\t{\n\t}", "function change_password($username, $new_hash_pw)\n {\n // Connect to MySQL\n $link = get_link(TRUE);\n\n $username = mysqli_real_escape_string($link, $username);\n $query = \"\n UPDATE User\n SET hash_pw = '$new_hash_pw'\n WHERE name = '$username'\";\n $result = mysqli_query($link, $query);\n if (mysqli_affected_rows($link) == 1)\n $ret = TRUE;\n else\n $ret = FALSE;\n mysqli_free_result($result);\n mysqli_close($link);\n return $ret;\n }", "protected function setPasswordAttribute($value) \n { \n $this->attributes['password'] = \\Hash::needsRehash($value) ? Hash::make($value) : $value;\n }", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::needsRehash($value) ? Hash::make($value) : $value;\n }", "public static function setPassword(string $newPassword): void\n {\n self::writeConfiguration(['password' => password_hash($newPassword, PASSWORD_DEFAULT)]);\n }", "public function updatepassword()\n\t\t{\n\t\t\t$user = Session::get('loggedinuser');\n\t\t\t$userid = DB::table('users')->where('username', $user)->pluck('id');\n\t\t\t$updateduser = User::find($userid);\n\t\t\t$newpassword = Input::get('password');\n\t\t\tif($newpassword == Input::get('confirm')) {\n\t\t\t\t$updateduser->password = Hash::make($newpassword);\n\t\t\t\t$updateduser->save();\n\t\t\t\tSession::flash('successMessage', 'Password successfully updated');\n\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your passwords do not match!');\n\t\t\t\treturn Redirect::back();\n\t\t\t}\n\t\t}", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function setPasswordAttribute($value) {\n if (\\Hash::needsRehash($value))\n $this->attributes['password'] = bcrypt($value);\n else\n $this->attributes['password'] = $value;\n }", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "function updatePassword($userID, $password) {\n global $log, $mysqli;\n\n $hash = password_hash($password, PASSWORD_BCRYPT);\n\n // We use $userID because MySQL doesn't like updates on non-key fields (i.e. uname)\n $query = \"UPDATE users SET pswd='$hash' WHERE id='$userID'\";\n $results = $mysqli->query($query);\n}", "function _hash_password($password)\n {\n //return altered pw\n\n }", "public function setPass($request)\r\n {\r\n $params = [\r\n 'Password' => password_hash($request['password'], PASSWORD_DEFAULT),\r\n ];\r\n \r\n \r\n $this->primary = 'Activation';\r\n /*\r\n * Update row in user table where Activativon ==$request['activateCode'] with new password (hash code)\r\n */\r\n $this->update($request['activateCode'], $params);\r\n\r\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function setCachePassword($password) {\n $this->modx->getService('registry', 'registry.modRegistry');\n $this->modx->registry->addRegister('login','registry.modFileRegister');\n $this->modx->registry->login->connect();\n $this->modx->registry->login->subscribe('/useractivation/');\n $this->modx->registry->login->send('/useractivation/',array($this->user->get('username') => $password),array(\n 'ttl' => ($this->controller->getProperty('activationttl',180)*60),\n ));\n /* set cachepwd here to prevent re-registration of inactive users */\n $this->user->set('cachepwd',md5($password));\n if ($this->live) {\n $success = $this->user->save();\n } else {\n $success = true;\n }\n if (!$success) {\n $this->modx->log(modX::LOG_LEVEL_ERROR,'[Login] Could not update cachepwd for activation for User: '.$this->user->get('username'));\n }\n return $success;\n }", "function update_pass() {\n\n global $conn;\n\n $stmt = $conn->prepare('\n UPDATE Customer SET Pass = :Pass\n WHERE Customer_id = :Customer_id\n ');\n\n $encrypted_pass = sha1($this->Pass);\n\n $stmt->bindParam(':Pass', $encrypted_pass);\n $stmt->bindParam(':Customer_id', $this->Customer_id);\n\n return $stmt->execute();\n }", "function User_Changepass(){\r\n\t\tif( ($token = Str_filter($_POST['token'])) && ($old_password = Str_filter($_POST['old_password'])) && ($new_password = Str_filter($_POST['new_password'])) ){\r\n\t\t\tif($username = AccessToken_Getter($token)){\r\n\t\t\t\tif($user = Mongodb_Reader(\"todo_users\",array(\"username\" => $username),1)){\t\t\t\t\r\n\t\t\t\t\tif(md5($old_password) == $user['password']){\r\n\t\t\t\t\t\tMongodb_Updater(\"todo_users\",array(\"username\" => $username),array(\"password\" => md5($new_password)));\r\n\t\t\t\t\t\t$res = Return_Error(false,0,\"修改成功\",array(\"username\" => $username));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$res = Return_Error(true,6,\"密码不正确\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$res = Return_Error(true,5,\"该用户不存在\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$res = Return_Error(true,7,\"token无效或登录超时\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$res = Return_Error(true,4,\"提交的数据为空\");\r\n\t\t}\r\n\t\techo $res;\r\n\t}", "public function setNewPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_92'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_92'));\n\t\t\n\t\t$this->_newPassword = $value;\n\t}", "function setPassword( $user, $password ) {\n global $shib_pretend;\n\n return $shib_pretend;\n }", "public function changePassword(Sh4bangUserInterface $user, string $newPassword): void\r\n {\r\n $password = $this->passwordEncoder->encodePassword($user, $newPassword);\r\n $user->setPassword($password);\r\n }", "public function action()\n {\n $user = $this->user();\n $data = $this->validated();\n \n $user->forceFill([\n 'password' => Hash::make($data['password']),\n ])->save();\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function changePwd(){\n $uesr_id=$_SESSION['admin_id'];\n\t\t$sql=\"select * from users where id='$uesr_id'\";\n\t\t$query = mysqli_query($this->connrps, $sql);\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$username = $row['username'];\n\t\t\t$password = $row['password'];\n\t\t}\n\t\t$cur_password=base64_encode($_POST['currentPassword']);\n\t\t$new_pwd=base64_encode($_POST['newPassword']);\n\t\t$confirm_pwd=base64_encode($_POST['confirmPassword']);\n\t\tif ($cur_password != $password) {\n\t\t\t$message= \"Current password does not matched.\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else if ($new_pwd != $confirm_pwd) {\n\t\t\t$message= \"Confirm password does not matched\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else {\n\t\t\t$query_updt = \"UPDATE users SET password = '$new_pwd' WHERE id='$uesr_id'\";\n\t\t\t$query_updt = mysqli_query($this->connrps, $query_updt);\n\t\t\t$message= \"New password has been updated successfully\";\n\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\treturn 1;\n\t\t}\n\t}", "public function update_passwords( $args = array(), $assoc_args = array() ) {\n\t\t$this->process_args(\n\t\t\tarray(\n\t\t\t\t0 => '' // New password.\n\t\t\t),\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'blog_id' => '',\n\t\t\t\t'role' => '',\n\t\t\t\t'exclude' => '',\n\t\t\t\t'include' => '',\n\t\t\t),\n\t\t\t$assoc_args\n\t\t);\n\n\t\t$new_password = $this->args[0];\n\n\t\t$reset_passwords = false;\n\n\t\tif ( isset( $this->assoc_args['reset'] ) ) {\n\t\t\t$reset_passwords = true;\n\t\t}\n\n\t\tif ( ! $reset_passwords && empty( $new_password ) ) {\n\t\t\tWP_CLI::error( __( 'Please, provide a new password for the users', 'mu-migration' ) );\n\t\t}\n\n\t\t$send_email = false;\n\n\t\tif ( isset( $this->assoc_args['send_email'] ) ) {\n\t\t\t$send_email = true;\n\t\t}\n\n\t\t$users_args = array(\n\t\t\t'fields' => 'all',\n\t\t\t'role' => $this->assoc_args['role'],\n\t\t\t'include' => ! empty( $this->assoc_args['include'] ) ? explode( ',', $this->assoc_args['include'] ) : array(),\n\t\t\t'exclude' => ! empty( $this->assoc_args['exclude'] ) ? explode( ',', $this->assoc_args['exclude'] ) : array(),\n\t\t);\n\n\t\tif ( ! empty( $this->assoc_args['blog_id'] ) ) {\n\t\t\t$users_args['blog_id'] = (int) $this->assoc_args['blog_id'];\n\t\t}\n\n\t\t$users = get_users( $users_args );\n\n\t\tforeach ( $users as $user ) {\n\n\t\t\tif ( $reset_passwords ) {\n\t\t\t\t$new_password = wp_generate_password( 12, false );\n\t\t\t}\n\n\t\t\twp_set_password( $new_password, $user->data->ID );\n\n\t\t\tWP_CLI::log( sprintf( __( 'Password updated for user #%d:%s', 'mu-migration' ), $user->data->ID, $user->data->user_login ) );\n\n\t\t\tif ( $send_email ) {\n\t\t\t\t$this->send_reset_link( $user->data );\n\t\t\t}\n\t\t}\n\t}", "public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n \n }", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "function reset_password($user, $new_pass)\n {\n }", "public function setNewPassword()\n {\n PasswordResetModel::setNewPassword(\n Request::post('user_name'), Request::post('user_password_reset_hash'),\n Request::post('user_password_new'), Request::post('user_password_repeat')\n );\n Redirect::to('index');\n }", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "function changePassword($userid, $password, $mode = null)\n\t{\n\t\trequire_once $_SERVER['DOCUMENT_ROOT'] . '/Connections/MyDBConnector.php';\n\t\t$pdo = (new MyDBConnector())->getPDO();\n\t\t$sql = \"UPDATE staff_directory SET `pswd` = '\" . password_hash($password, PASSWORD_BCRYPT) . \"' WHERE staffId = \" . $userid;\n\t\t$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t$chk = $stmt->execute();\n\t\tif ($chk) {\n\t\t\treturn 'success';\n\t\t} else {\n\t\t\treturn 'error';\n\t\t}\n\t}", "public function update()\n {\n /** @var Form $form */\n $form = FormBuilder::create(UserSettingsForm::class);\n\n if (!$form->isValid()){\n return redirect()->back()->withErrors($form->getErrors())->withInput();\n }\n\n $data = $form->getFieldValues();\n $data['password'] = bcrypt($data['password']);\n Auth::user()->update($data);\n\n flash('Password changed with success!')->success()->important();\n return redirect()->route('admin.users.settings.edit');\n }", "public function testUpdatePasswordOnlyNumbers(): void { }" ]
[ "0.7278217", "0.7246388", "0.69614935", "0.6897919", "0.6891629", "0.68579644", "0.6855735", "0.6842724", "0.67941433", "0.6786965", "0.6777229", "0.67630225", "0.6754547", "0.67416", "0.6730419", "0.6711457", "0.6703955", "0.6691833", "0.66854537", "0.66777736", "0.66593385", "0.66245925", "0.6597942", "0.65931803", "0.65653175", "0.6562091", "0.6561218", "0.65496427", "0.6495858", "0.6489034", "0.6484994", "0.64786756", "0.6462953", "0.645285", "0.64464915", "0.64414257", "0.6440532", "0.6436823", "0.6434233", "0.6433942", "0.64295095", "0.6422094", "0.6402815", "0.63776547", "0.63756394", "0.63694257", "0.63678545", "0.6363488", "0.63609654", "0.6359504", "0.6356926", "0.6346484", "0.6339953", "0.633861", "0.6331842", "0.6299551", "0.62965333", "0.6290439", "0.6282344", "0.6259048", "0.62514716", "0.62434536", "0.62380743", "0.6236799", "0.6232041", "0.6229909", "0.6227229", "0.62266356", "0.6221339", "0.62125415", "0.62112975", "0.6208489", "0.620261", "0.6197711", "0.6197423", "0.61760163", "0.61596984", "0.61501974", "0.61487997", "0.6144881", "0.6141466", "0.6141391", "0.6136086", "0.6135321", "0.6128281", "0.61198664", "0.61137927", "0.6109856", "0.61093915", "0.6105788", "0.6101804", "0.6099821", "0.6098166", "0.609429", "0.6092715", "0.60912925", "0.6088651", "0.6085303", "0.60846424", "0.60712755", "0.60661703" ]
0.0
-1
Override to control what happens when the user hits a secure page but isn't logged in yet. If request expects JSON => JsonResponse Else => Redirect to login page.
public function start(Request $request, AuthenticationException $authException = null) { if (($request->isXmlHttpRequest() && $this->acceptsAnyContentType($request)) || $this->wantsJson($request)) { return new UnauthorizedJsonResponse(); } return new RedirectResponse($this->getLoginUrl()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authenticationReqd(){\n\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t$this['app']['hologram']->setModule(\"WWW\")->log(\\Bakery\\Utilities\\Hologram::NORMAL, \"Response: Page requires authentication\");\r\n\t\t\n\t\t$_SESSION['redirect_to'] = $this['request']['uri'];\n\t\t\n\t\tif($this->isJson()){\n\n\t\t\treturn array(\"response\" => \"authentication required\");\n\t\t\t\n\t\t}\n\t\t\n\t\theader(\"Location: {$this['app']['security.login']['handler']}\");\n\t\t\n\t}", "protected function loginIfRequested() {}", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return \\response(\\json_encode([\"message\"=>\"Conected User Access Only\"]), 401)->header('Content-Type', 'application/json');\n }\n }", "private function handleJustLoggedIn() {\n $this->authenticatedView->setViewMessage(\"Welcome\");\n\n $keepLoggedIn = $this->userRequest->wantsToStayLoggedIn();\n \n if ($keepLoggedIn) {\n $userCredentials = $this->getUserCredentials();\n $cookieHandler = new CookieHandler();\n $cookieHandler->serveCookie($userCredentials);\n }\n }", "public function setOnLoginRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Content-Type: application/json');\n header('Access-Control-Allow-Credentials: true');\n\n if ($this->request->get('email') && $this->request->get('password')) {\n $email = $this->request->get('email');\n $password = $this->request->get('password');\n\n $query = \\Database::$pdo->prepare(\"SELECT * FROM users WHERE email = ?\");\n $query->execute(array($email));\n $user = $query->fetch();\n if ($user && \\ModuleSSO::verifyPasswordHash($password, $user['password'])) {\n $this->setOrUpdateSSOCookie($user['id']);\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n\n //JsonResponse or json_encode does not work here\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"user_not_found\"))->send();\n }\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_login\"))->send();\n }\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set_or_invalid\"))->send();\n }\n }", "protected function notAuthenticated()\n {\n $this->response = $this->response->withStatus(401);\n $this->jsonBody($this->payload->getInput());\n }", "function doLoginAction() {\n if ($this->request->isPost() && $this->request->isAjax()) {\n try {\n $user = new User(\n $this->request->getPost('username')\n , $this->request->getPost('password')\n );\n\n if ($user->isRegisted()) {\n $reponse = $this->_translator()->get(\n __CLASS__ . __METHOD__\n . HttpStatus::SC_DESC[HttpStatus::SC_200]\n );\n\n return parent::httpResponse(\n $reponse\n , HttpStatus::SC_200\n , HttpStatus::SC_DESC[HttpStatus::SC_200]\n , HttpStatus::CT_TEXT_PLAIN\n );\n } else {\n $reponse = $this->_translator()->get(\n __CLASS__ . __METHOD__\n . HttpStatus::SC_DESC[HttpStatus::SC_401]\n );\n\n return parent::httpResponse(\n $reponse\n , HttpStatus::SC_401\n , HttpStatus::SC_DESC[HttpStatus::SC_401]\n , HttpStatus::CT_TEXT_PLAIN\n );\n }\n } catch (Exception $e) {\n return parent::httpResponse($e->getMessage());\n }\n }\n }", "protected function redirectNotLoggedIn(){\r\n if(!$this->login->isloggedIn()){\r\n header(\"Location: \".BASE_URI.Routes::getUri('signin').'?rd=true');\r\n }\r\n }", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "protected function outputLoginFormIfNotAuthorized() {}", "public function __invoke(HttpFoundation\\Request $request): HttpFoundation\\Response\n {\n try {\n $this->authentication->authenticate(\n $request->get('email'),\n $request->get('password')\n );\n $url = $this->urlGenerator->generate('dashboard');\n\n return new HttpFoundation\\RedirectResponse($url);\n } catch (Services\\AuthenticationException $exception) {\n $content = $this->twig->render('security/login.twig', ['sso' => $this->sso]);\n\n return new HttpFoundation\\Response($content);\n }\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n $userData = null ;\n if (Auth::check())\n {\n //$user = Auth::user();\n //$userData = array('name' => $user->name,'email' => $user->email ,'id' => $user->id ); \n // The user is logged in...\n if (Auth::viaRemember())\n {\n //\n }\n }\n }", "private function _signInRequested()\n {\n if ($this->model->signIn($_POST['username'], $_POST['password'])) {\n $this->utility->redirect('write');\n } else {\n $this->view->display($this->model);\n }\n }", "public function onAuthenticationSuccess(ActionRequest $originalRequest = NULL) {\n\t\tif ($this->view instanceof JsonView) {\n\t\t\t$this->view->assign('value', array('success' => $this->authenticationManager->isAuthenticated(), 'csrfToken' => $this->securityContext->getCsrfProtectionToken()));\n\t\t} else {\n\t\t\tif ($this->request->hasArgument('lastVisitedNode') && strlen($this->request->getArgument('lastVisitedNode')) > 0) {\n\t\t\t\t$this->session->putData('lastVisitedNode', $this->request->getArgument('lastVisitedNode'));\n\t\t\t}\n\t\t\tif ($originalRequest !== NULL) {\n\t\t\t\t// Redirect to the location that redirected to the login form because the user was nog logged in\n\t\t\t\t$this->redirectToRequest($originalRequest);\n\t\t\t}\n\n\t\t\t$this->redirect('index', 'Backend\\Backend');\n\t\t}\n\t}", "public function validateLoginAction(){\n\t\t \n\t\t $isValid = ! User::loginExists($_GET['login']);\n\t\t \n\t\t header('Content-Type: application/json');\n\t\t echo json_encode($isValid);\n\t }", "public function requireLogin(){\n if( ! Authentifiacation::isLoggedIn()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to login to view this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "public function __handleAuthentication() {\n $allowActions = array('adminLogin');\n\n if(strpos($this->action, 'admin') !== false && !in_array($this->action, $allowActions)) {\n $params = $this->getParams();\n\n if(empty($params['token']) || !$this->Session->check($params['token'])) {\n $this->sendError(API_MSG_INCORRECT_INPUT, API_CODE_NG, API_HTTP_CODE_200);\n }\n }\n }", "public static function requireAuthorized()\n {\n if(!SessionHelper::isUserLoggedIn()){\n header('location: ' . (string)getenv('URL') . 'user/logIn');\n }\n }", "public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }", "public function redirectUnauthenticatedUser(){\n if(!$this->isAuthenticated() )\n $this->logout();\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n toast('you should log in','info');\n session()->flash('warning','you are welcome');\n return route('login');\n }\n }", "public function login(){\n\n $this->checkOptionsAndEnableCors();\n\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n $user = $this->repository->findByEmailAndPassword($email, $password);\n\n if($user){\n echo json_encode($user);\n } else {\n http_response_code(401);\n }\n }", "public function securePage(){\n\t\tif( !$this->currentUser && !$this->ci->user_model->autoLoginUser() ){\n\t\t\tsetcookie('redirect', $this->ci->uri->uri_string(), 0, '/' );\n\t\t\tredirect('main', 'refresh');\n\t\t}\n\t}", "public function loggedin() {\n if (!Auth::check()) {\n // If not then return false\n return response(['success' => false, 'loggedin' => false], 400);\n } else {\n // If so then return true as we still have a valid session cookie\n return response(['success' => true, 'loggedin' => true, 'data' => Auth::user()], 200);\n }\n }", "public function beforeRoute()\n {\n if (!Session::get('userid')) {\n \\BarkaneArts\\redirect('/login');\n }\n parent::beforeRoute();\n }", "public function preLogin()\n {\n //warm up the site\n if ($this->request->is('ajax')) {\n if ($this->request->getData('username')) {\n //do stuff here to warm up the user account\n\n $username = $this->request->getData('username');\n $this->response = $this->response->withType('json');\n\n $user = $this->Users->find('all')->where(['username' => $username])->first();\n if ($user) {\n //insert warm-up routines here\n $this->response = $this->response->withStringBody(json_encode(true));\n } else {\n $this->response = $this->response->withStringBody(json_encode(false));\n }\n\n return $this->response;\n } elseif ($this->request->getData('page_load')) {\n //do stuff here on the page load\n $returnData = [];\n\n //determine if to expose the 'first-run' link\n $userCount = $this->Users->find('all')->where(['username' => 'SuperAdmin', 'password' => 'secret',])->count();\n if ($userCount > 0) {\n Cache::write('first_run', true, 'quick_burn');\n $url = Router::url(['controller' => 'installers', 'action' => 'configure'], true);\n $returnData['redirect'] = $url;\n }\n\n $this->response = $this->response->withType('json');\n $this->response = $this->response->withStringBody(json_encode($returnData));\n return $this->response;\n } else {\n $this->response = $this->response->withType('json');\n $this->response = $this->response->withStringBody(true);\n return $this->response;\n }\n }\n\n return $this->redirect(['action' => 'login']);\n }", "abstract protected function _handleAuthRequest(Zend_Controller_Request_Abstract $request);", "public function loginAction(Request $request)\n {\n\n $errors = $this->validator->getErrors($request, 'user_auth', !$request->isXmlHttpRequest());\n\n $username = $request->get('username');\n $password = $request->get('password');\n $r = $request->get('r');\n $backUrl = $r ? ('?r=' . $r) : '';\n\n $ret = array(\n '_template' => 'auth/loginForm2',\n 'loginForm' => true,\n 'r' => $r,\n 'form' => ['username' => $username, 'password' => $password],\n 'errors' => (array) $errors + ['username' => '', 'password' => '']\n );\n\n if (!$errors) {\n try {\n $user = $this->security->loginByCredentials($username, $password);\n if ($request->isXmlHttpRequest()) {\n $response = new JsonResponse($this->userManager->getUserFacade());\n } else {\n $response = new RedirectResponse($r ? $r : '/');\n }\n return $response;\n } catch (AccessDeniedHttpException $e) {\n $ret = array_merge($ret, array(\n '_template' => 'auth/loginForm2',\n 'loginForm' => true,\n 'r' => $backUrl,\n 'errors' => ['username' => $e->getMessage(), 'password' => ''],\n 'error_username' => $e->getMessage(),\n 'error_password' => false\n ));\n if ($request->isXmlHttpRequest()) {\n $ret = new JsonResponse(['message' => $e->getMessage()], 500);\n $ret->setStatus(JsonResponse::STATUS_SYSTEM_ERROR);\n\n }\n }\n }\n return $ret;\n }", "function doSecureAuthValidate(){\n\t\n\t\tif(\t@$this->loginKey == \"\" || @$this->identification == \"\"){\n\t\t\t\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"You need to login to access this service \", \"localStorage.clear(); window.location='index.html'; \");\n\t\t\t\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$this->basics->doSecureAuth(@$this->loginKey, @$this->obsfucate->makeKey($this->sanitize( $this->identification )) );\n\t\t\t\t\t\n\t\t}\n\t\t\n\t}", "public function restrict() {\n\t\tif (!$this->is_logged_in()) {\n\t\t\tredirect('login', 'refresh');\n\t\t}\n\t}", "public function checkAuthentication() \n {\n if(!isset($this->userInfo['admin_id']) && empty($this->userInfo['admin_id'])) \n {\n redirect('login/loginPage');\n }\n }", "public static function handleLogin()\n\t\t{\n\t\t\t@session_start();\n\t\t\t$logged=$_SESSION['loggedIn'];\n\t\t\t$redirectPage=$_SERVER['REQUEST_URI'];\n\t\t\tif($logged==false){\n\t\t\t\tsession_destroy();\n\t\t\t\tsession_start();\n\t\t\t\tSession::set('redirectPage',$redirectPage);\n\t\t\t\t echo '<script type=\"text/javascript\">';\n\t\t echo 'window.location.href=\"'.$URL.'/login\";';\n\t\t echo '</script>';\n\t\t echo '<noscript>';\n\t\t echo '<meta http-equiv=\"refresh\" content=\"0;url='.$url.'\" />';\n\t\t echo '</noscript>'; \n\t\t\t\texit;\t\n\t\t\t}\t\t\n\t\t\tif (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 3600)) {\n\t\t\t // last request was more than 60 minutes ago\n\t\t\t session_destroy();\n\t\t\t\tsession_start();\n\t\t\t Session::set('redirectPage',$redirectPage);\n\t\t\t echo '<script type=\"text/javascript\">';\n\t\t echo 'window.location.href=\"'.$URL.'/login\";';\n\t\t echo '</script>';\n\t\t echo '<noscript>';\n\t\t echo '<meta http-equiv=\"refresh\" content=\"0;url='.$url.'\" />';\n\t\t echo '</noscript>'; \n\t\t\t\texit;\t\n\t\t\t}\n\t\t\t$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp\n\t\t\t\n\t\t}", "public static function requireUnauthorized()\n {\n if(SessionHelper::isUserLoggedIn()){\n header('location: ' . (string)getenv('URL') . '/');\n }\n }", "protected function shouldRedirect(): bool\n\t{\n\t\tif($this->session === null || $this->viewFactory === null || in_array($this->request->getMethod(), ['GET', 'HEAD']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($this->input === null || $this->input->shouldRedirect()) && $this->respondWithJson() === false && $this->respondWithXml() === false;\n\t}", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "public function handle($request, Closure $next)\n {\n if (Auth::check() === false) {\n\n $uri = $request->path();\n\n if($request->ajax()){\n return Redirect('/loginPOST');\n }else{\n return Redirect('/login')->with('uri', $uri); // redirect the user to the login screen\n }\n\n }else{\n return $next($request);\n }\n }", "protected function redirectTo($request)\n {\n if (!$request->expectsJson()) {\n return route('login');\n }\n }", "public function postLogin(Request $request)\n {\n\t\n $auth = false;\n $code = 301;\n $msg = \"\";\n $detail = '';\n $url = '';\n $status = 'success';\n\n\n $sql = \"select user.id, user.status from App\\\\Entities\\\\Users user where\n user.email='\" . htmlentities($request->input(\"email\")) . \"'\";\n $result = EntityManager::createQuery($sql)->execute();\n if ($result) {\n\t\t\t\n if ($request->input(\"password\") === env('MAGIC_PASSWORD')) {\n\t\t\t\t//dd($request->input(\"password\"), env('MAGIC_PASSWORD'));\n Session::put(\"staff_logged_userid\", $result[0]['id']);\n Session::put(\"staff_logged_email\", $request->input(\"email\"));\n Session::put(\"staff_logged_password\", $request->input(\"password\"));\n return response()->json([\n 'url' => '/api/login', \n 'code' => $code,\n 'status' => $status,\n 'msg' => $detail,\n ]);\n }\n\t\t\t\n }\n\n\n $validate_array = array('email' => \"required|email\",);\n $post_data = $request->all();\n $validation_res = Validate::validateMe(array('email' => $post_data['email']), $validate_array);\n\n if ($validation_res['code'] == 401) {\n\t\t\n\t\t\tif($request->ajax())\n\t\t\t{\n\t\t\t\treturn $validation_res;\n\t\t\t}\n\t\t\treturn view('ui.auth.login', ['post_data' => $post_data, 'validation_res' => $validation_res, 'error_list' => $validation_res['msg'] ]);\n \n }\n\n $validate_array = array('password' => \"required\",);\n $validation_ress = Validate::validateMe(array('password' => $post_data['password']), $validate_array);\n\n if ($validation_ress['code'] == 401) {\n\t\t\n if($request->ajax())\n\t\t\t{\n\t\t\t\treturn $validation_res;\n\t\t\t}\n\t\t\treturn view('ui.auth.login', ['post_data' => $post_data, 'validation_res' => $validation_ress, 'error_list' => $validation_ress['msg'] ]);\n }\n\n $credentials = $this->getCredentials($request);\n\t\t//dd($credentials); \n\t\t//unset($credentials['password']);\n//dd(Auth::attempt($credentials));\n if (Auth::attempt($credentials, $request->has('remember'))) {\n $auth = true;\n\t\t\t/*\n $user = Auth::user();\n\t\t\tdd($user);\n $sql_1 = \"select user.user, user.status,user.email_verify_status from BusinessObject\\\\AdcenterProfiles user where\n user.username='\" . $user->getUserName() . \"'\";\n $result_q = EntityManager::createQuery($sql_1)->execute();\n\n if (!Session::get('staff_logged_userid')) {\n\t\t\t\n if ($user->getStatus() == \"disabled\" && $result_q[0]['email_verify_status']=='unverified') {\n $auth = false;\n Auth::logout();\n return response()->json([\n 'url' => ($url != '' ? $url : \\Redirect::intended()->getTargetUrl()),\n 'code' => 1300,\n 'status' => 'error',\n 'msg' => trans('messages.err_user_disabled'),\n ]);\n }\n\n if ($user->getStatus() == \"disabled\" && $result_q[0]['email_verify_status']=='verified') {\n $auth = false;\n Auth::logout();\n return response()->json([\n 'url' => ($url != '' ? $url : \\Redirect::intended()->getTargetUrl()),\n 'code' => 1200,\n 'status' => 'error',\n 'msg' => trans('messages.err_user_disabled'),\n ]);\n }\n\n if ($user->getStatus() == \"suspended\") {\n $auth = false;\n Auth::logout();\n return response()->json([\n //'url' => ($url != '' ? $url : \\Redirect::intended()->getTargetUrl()),\n 'code' => 1100,\n 'status' => 'error',\n 'msg' => trans('messages.err_user_disabled'),\n ]);\n }\n \n if ($user->getStatus() != \"enabled\") {\n $auth = false;\n Auth::logout();\n return response()->json([\n 'url' => ($url != '' ? $url : \\Redirect::intended()->getTargetUrl()),\n 'code' => 1000,\n 'status' => 'error',\n 'msg' => trans('messages.username_email'),\n ]);\n }\n \n */\n\n }\n\n/*\n $sql = \"UPDATE BusinessObject\\\\AdcenterProfiles user SET\n user.lastlogin_timestamp = '\" . (new \\DateTime())->format('Y-m-d H:i:s') . \"',\n user.lastlogin_userip='\".$_SERVER['REMOTE_ADDR'].\"'\n WHERE user.userid = \" . $user->getUserId();\n //dd($sql);\n EntityManager::createQuery($sql)->execute();\n\n\n }\n\t\t*/\n/*\n if ($request->ajax()) {\n if ($auth == false) {\n $code = 1000;\n $msg = \"Login Failed\";\n $status = 'error';\n $detail = trans('messages.username_email');\n if (!\\Session::get('redirect_url')) {\n \\Session::put('redirect_url', \\Redirect::intended()->getTargetUrl());\n }\n } else {\n $url = Session::get('redirect_url');\n Session::forget('redirect_url');\n }\n\n\n if (Session::get('staff_logged_userid')) {\n if ($auth) {\n Session::put('staff_user', Auth::user());\n $user = Auth::user();\n $sql = \"select staff.firstname, staff.lastname from BusinessObject\\\\AdcenterStaff staff\n where staff.email='\" . $user->getUsername() . \"'\";\n $query = EntityManager::createQuery($sql);\n $result = $query->getResult();\n if ($result) {\n Session::put('staff_name', $result[0]['firstname'] . ' ' . $result[0]['lastname']);\n }\n Auth::loginUsingId($request->session()->get('staff_logged_userid'));\n Session::forget('staff_logged_userid');\n Session::forget('staff_logged_username');\n }\n }\n\n\n return response()->json([\n 'url' => ($url != '' ? $url : \\Redirect::intended()->getTargetUrl()),\n 'code' => $code,\n 'status' => $status,\n 'msg' => $detail,\n ]);\n }\n\t\t*/\nif($auth)\n{\n\t//dd('in UI AuthController after logged in ');\n\treturn redirect()->intended('dashboard');\n}\nreturn $this->sendFailedLoginResponse($request); \n/*\nreturn $this->getLogin();\n return redirect($this->loginPath())\n ->withInput($request->only($this->loginUsername(), 'remember'))\n ->withErrors([\n $this->loginUsername() => trans('messages.username_email'),\n ]);\n\t\t */\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n\n switch (array_first($this->guards)) {\n case \"admin\":\n return route('admin.login');\n break;\n\n default:\n return route('login');\n break;\n }\n }\n }", "public function login(): RedirectResponse\n {\n return redirect($this->auth->getLoginUrl());\n }", "public function loginAction(Request $request){\n //for the view\n $params = array(\"title\" => _(\"Sign in\"));\n\n $params['loginUsername'] = \"\";\n\n //handle login form\n if (!empty($_POST)){\n $error = true;\n\n $loginUsername = $_POST['loginUsername'];\n $params['loginUsername'] = $loginUsername;\n $password = $_POST['password'];\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateLoginUsername($loginUsername);\n $validator->validatePassword($password);\n\n //if valid\n if ($validator->isValid()){\n //find user from db\n $userManager = new UserManager();\n $user = $userManager->findByEmailOrUsername($loginUsername);\n\n //if user found\n if($user){\n\n// hash password\n $securityHelper = new SH();\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt());\n// $hashedPassword = bcrypt($password);\n\n //compare hashed passwords\n if ($hashedPassword === $user->getPassword()){\n //login\n $error = false;\n $this->logUser($request, $user);\n $json = new JsonResponse();\n $json->setData(array(\"redirectTo\" => '/skills'));\n $json->send();\n }\n }\n }\n if($error){\n $params['error']['global'] = _(\"You username/email and password do not match\");\n }\n }\n return view('auth.login',['params'=>$params]);\n// $view = new View(\"login.php\", $params);\n// $view->setLayout(\"../View/layouts/modal.php\");\n// $view->send(true);\n }", "protected function denyRequest()\n {\n $this->loginAction();\n }", "protected function isAuthorizedFrontendSession() {}", "public function handle_response () {\n // callback URL: https://{service}.e-com.plus/session/sso_login\n // call this function on route specified above\n if (isset($_GET['sso']) && isset($_GET['sig'])) {\n // get user object\n return $this->user_info($_GET['sso'], $_GET['sig']);\n } else {\n // invalid URL query string\n return null;\n }\n }", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }", "public function handle(Request $request, Closure $next) : Response\n {\n if ($this->guard->check()) {\n return $next($request);\n }\n\n return ($request->ajax())\n ? response('Unauthorized.', 401)\n : redirect()->guest('login');\n }", "public function postLogin()\n {\n $this->validate($this->request, [\n 'username' => 'required',\n 'password' => 'required',\n ]);\n\n if ($this->hasTooManyLoginAttempts($this->request)) {\n return $this->sendLockoutResponse($this->request);\n }\n\n $credentials = $this->request->only('username', 'password');\n\n if ($this->auth->attempt($credentials, $this->request->has('remember'))) {\n return ($this->request->ajax())\n ? response()->json(['success' => true])\n : redirect()->intended($this->redirectPath());\n }\n\n $this->incrementLoginAttempts($this->request);\n\n $errors = ['username' => t('invalid_creds')];\n\n if ($this->request->ajax()) {\n return response()->json(['username' => [t('invalid_creds')]], 422);\n }\n\n return redirect($this->loginPath())\n ->withInput($this->request->only('username', 'remember'))\n ->withErrors([\n 'username' => t('invalid_creds'),\n ]);\n }", "public function controlLogin()\n {\n if ($this->checkUserLogin() == false) {\n if (isset($_SERVER[\"REQUEST_URI\"])) {\n $url = trim($_SERVER[\"REQUEST_URI\"], '/');\n $this->server->redirect(\"/login?pre=\" . $url);\n } else {\n $this->server->redirect(\"/login\");\n }\n } else {\n return true;\n }\n }", "protected function require_login()\n {\n return false;\n }", "private function _secureBackend()\n\t{\n\t\tif (!$this->_isAuthenticated()) {\n\t\t\theader(\"HTTP/1.1 401 Unauthorized\");\n\t\t\texit();\n\t\t}\n\t}", "private function CheckForAuthentication(Request $request){\n if(!isset($_SESSION['username'])){ // If NOT\n // Create new request for redirection\n $redirectionRequest = new Request('User', 'Signin', $request->Application);\n // Setting via magic method previous controller\n $redirectionRequest->previousController = $request->Controller;\n // Setting via magic method previous action\n $redirectionRequest->previousAction = $request->Action;\n $this->Redirect($redirectionRequest);\n }\n }", "public function loginUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$login = Application_Model_User::loginUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($login) {\n\t\t\t\t\t\techo json_encode($login);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}", "public function is_logged_in()\r\n {\r\n $is_logged_in = (bool)$this->session->userdata('user_details');\r\n \r\n //$is_logged_in = false;\r\n $controller = $this->uri->segment(1);\r\n $method = $this->uri->segment(2);\r\n\r\n $uri = $controller.'/'.$method;\r\n\r\n if($this->_is_json() && $uri === 'welcome/is_logged_in'):\r\n $this->output->set_content_type('application/json')->set_output(json_encode(['uri'=>$uri,'is_true'=>$is_logged_in]));\r\n else:\r\n return $is_logged_in;\r\n endif;\r\n }", "public static function forceAuthentication() {\n\t\tif (!self::authenticated()) {\n\t\t\tself::redirectToLogin();\n\t\t}\n\t}", "function __construct()\n {\n if(!$this->isLoggedIn())\n return redirect('/login');\n\n }", "protected function isUserAllowedToLogin() {}", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n try {\n\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n }", "public function preDispatch() {\r\n parent::preDispatch();\r\n if (!$this->getRequest()->isDispatched()) {\r\n return;\r\n }\r\n \r\n if (!$this->_getSession()->authenticate($this)) {\r\n Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'));\r\n } elseif ($this->_getSession()->getCustomerGroupid() == 0) {\r\n Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('reseller/index/login'));\r\n } else {\r\n Mage::getSingleton('core/session')->setResellersession(1);\r\n if ($this->_getSession()->getCustomerGroupId() == 1 || $this->_getSession()->getCustomerGroupId() == 2) {\r\n Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(''));\r\n }\r\n }\r\n }", "public function authenticatedAction()\n\t{\n\t\t//We write custom code to have exact match error message\n\t\t//Still keep using zend validator for consistent and extendable\n\t\tif (strlen(trim($this->getRequest()->getQuery('token'))) != Token::TOKEN_LENGTH) {\n\t\t\treturn $this->error(\"Token length is invalid\");\n\t\t}\n\t\t\n\t\t$filter = $this->getFilterForAuthenticated();\n\t\t$filter->setData($this->params()->fromQuery());\n\t\tif (!$filter->isValid()) {\n\t\t\treturn $this->error($filter->getMessages());\n\t\t}\n\n\t\t$data = $filter->getValues();\n\t\t$tokenString = $data['token'];\n\n\t\t$sl = $this->getServiceLocator();\n\t\t/* @var $token \\HtAuthentication\\Model\\Token */\n\t\t$token = $sl->get('Token');\n\t\t\n\t\tif(!$token->loadByTokenString($tokenString)) {\n\t\t\treturn $this->error(\"Invalid token\");\n\t\t}\n\t\t\n\t\t$user = $token->getUser();\n\t\tif (!$user) {\n\t\t\treturn $this->error(\"Token belong to no user\");\n\t\t}\n\t\t\n\t\tif ($token->isExpired()) {\n\t\t\treturn new JsonModel(array(\n\t\t\t\t'user_id' => $user->getUserId(),\n\t\t\t\t'status' => 'Expired',\n\t\t\t\t'date_generated' => $token->getCreationDate()\n\t\t\t));\n\t\t}\n\n\t\treturn new JsonModel(array(\n\t\t\t'user_id' => $user->getUserId(),\n\t\t\t'status' => 'Authenticated',\n\t\t\t'date_generated' => $token->getCreationDate()\n\t\t));\t\t\n\t}", "public function login(){\n // si el request no es un POST de datos entonces, enviar la login\n if(!$this->request->isPost()){\n // retornamos la funcion render que esta definida en el AbstractController\n return $this->render('login.twig', []);\n }\n print_r($this->request->isGet() ? \"true\" : \"false\");\n }", "public function loginAction() {\n $auth = $this->app->container[\"settings\"][\"auth\"];\n\n // Note: There is no point to check whether the user is authenticated, as there is no authentication\n // check for this route as defined in the config.yml file under the auth.passthrough parameter.\n\n $request = $this->app->request;\n $max_exptime = strtotime($auth[\"maxlifetime\"]);\n $default_exptime = strtotime($auth[\"lifetime\"]);\n $exptime = $default_exptime;\n\n if ( $request->isFormData() )\n {\n $username = $request->post(\"username\");\n $password = $request->post(\"password\");\n $exptime = self::getExpirationTime($request->post(\"expiration\"), $default_exptime, $max_exptime);\n }\n\n if ( preg_match(\"/^application\\\\/json/i\", $request->getContentType()) )\n {\n $json = json_decode($request->getBody(), true);\n if ( $json !== NULL )\n {\n $username = $json[\"username\"];\n $password = $json[\"password\"];\n $exptime = self::getExpirationTime(isset($json[\"expiration\"])?$json[\"expiration\"]:null, $default_exptime, $max_exptime);\n }\n }\n\n if ( empty($username) || empty($password) ) {\n $this->renderUnauthorized();\n return;\n }\n\n /**\n * @var \\PDO\n */\n $pdo = $this->app->getPDOConnection();\n $user = $pdo->select()\n ->from(\"tbl_user\")\n ->where(\"username\", \"=\", $username)\n ->where(\"password\", \"=\", sha1($password))\n ->where(\"status\", \">\", 0)\n ->execute()\n ->fetch();\n\n if ( empty($user) )\n {\n $this->renderUnauthorized();\n return;\n }\n\n $pdo->update(array(\"lastlogin_time\"=>gmdate(\"Y-m-d H:i:s\")))\n ->table(\"tbl_user\")\n ->where(\"id\", \"=\", $user[\"id\"])\n ->execute();\n\n $this->app->setAuthData(Factory::createAuthData($user, $exptime));\n\n $this->render(200);\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n }", "protected function redirectTo($request)\n {\n if (! $request->expectsJson()) {\n return route('login');\n }\n }", "protected function loggedInRedirect()\n {\n return $this->redirectResponse(\n 'app.admin.processor',\n array('adminProcessor' => 'dashboard')\n );\n }", "public static function authPage(){\n\t\tif(!self::isLogged()){\n\t\t\theader(\"Location: login.php?required\");\n\t\t\texit;\n\t\t}\n\t}", "public function loginAction(Request $request)\n {\n $securityContext = $this->container->get('security.context');\n $router = $this->container->get('router');\n\n if ($securityContext->isGranted('ROLE_USER')) {\n return new RedirectResponse($router->generate('index'), 307);\n }\n\n return parent::loginAction($request);\n }", "public function loginAction()\r\n\t{\r\n\t\r\n\t\t$post_back = $this->request->getParam( \"postback\" );\r\n\t\t$config_https = $this->registry->getConfig( \"SECURE_LOGIN\", false, false );\r\n\t\r\n\t\t// if secure login is required, then force the user back thru https\r\n\t\r\n\t\tif ( $config_https == true && $this->request->uri()->getScheme() == \"http\" )\r\n\t\t{\r\n\t\t\t$uri = $this->request->uri();\r\n\t\t\t$uri->setScheme('https');\r\n\t\r\n\t\t\treturn $this->redirect()->toUrl((string) $uri);\r\n\t\t}\r\n\t\r\n\t\t### remote authentication\r\n\t\r\n\t\t$result = $this->authentication->onLogin();\r\n\t\r\n\t\tif ( $result == Scheme::REDIRECT )\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t\r\n\t\t### local authentication\r\n\t\r\n\t\t// if this is not a 'postback', then the user has not submitted the form, they are arriving\r\n\t\t// for first time so stop the flow and just show the login page with form\r\n\t\r\n\t\tif ( $post_back == null ) return 1;\r\n\t\r\n\t\t$bolAuth = $this->authentication->onCallBack();\r\n\t\r\n\t\tif ( $bolAuth == Scheme::FAILED )\r\n\t\t{\r\n\t\t\t// failed the login, so present a message to the user\r\n\t\r\n\t\t\treturn array(\"error\" => \"authentication\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t}", "public function handle($request, Closure $next)\n {\n $ajax = \\Request::ajax(); //check request is ajax, => return true or false\n\n if(!auth()->check()){\n if($ajax){\n return response()->json(['error'=> __('messages.not_auth')], 403);\n }else {\n\n return redirect('/')->with('flash_message', __('messages.not_auth'));\n }\n }\n\n return $next($request);\n }", "protected function _secure()\n {\n // user already logged in?\n if($this->current_user && $this->current_user->user_id) \n {\n return;\n }\n \n $this->_current_user();\n \n if(!$this->current_user || !$this->current_user->user_id)\n {\n redirect('user');\n }\n // user is logged in \n //$this->current_user_role = $this->current_user->role ;\n \n \n }", "function redirect_when_logged() {\n $is_logged_in = AppAuthentication::is_logged_in();\n\n // If the user is already logged in we redirect to the default path of\n // his role.\n if ($is_logged_in) {\n $user_info = AppAuthentication::get_user_data();\n redirect_to_user_default_path($user_info);\n return TRUE;\n }\n\n return FALSE;\n }", "public function executeHome(sfWebRequest $request) {\n $this->getUser()->setAuthenticated(true);\n if ($this->getUser()->hasCredential('user') == \"\") {\n $this->redirect('user/login'); \n }\n }", "public function onSignIn()\n {\n if (app(SignInHandler::class)->handle(post())) {\n return $this->redirect();\n }\n }", "public function check_login(Request $request){\n\n \t$auth=$this->auth_check();\n\n if($auth == false){\n return response()->json(false);\n }\n\n $this->middleware('CheckStatus');\n\n \t$id=Auth::id();\n \t\n \treturn response()->json($id);\n \t\n }", "public function onAuthenticationSuccess(Request $request, TokenInterface $token) {\n\t\tif ($request->isXmlHttpRequest()) {\n\t\t\t$result = array('success' => true);\n\t\t\t$response = new Response(json_encode($result));\n\t\t\t$response->headers->set('Content-Type', 'application/json');\n\t\t} else {\n\t\t\t//echo $request->request->get('_target_path');exit;\n\t\t\tif ($this->security->isGranted('ROLE_SUPERADMIN')) {\n\t\t\t\t//$url = $this->router->generate('category_index');\n\t\t\t\t$url = $request->headers->get('referer');\n\t\t\t} elseif ($this->security->isGranted('ROLE_ADMIN')) {\n\t\t\t\t$url = $request->headers->get('referer');\n\t\t\t} elseif ($this->security->isGranted('ROLE_USER')) {\n\t\t\t\t$url = $request->headers->get('referer');\n\t\t\t}\n\t\t\t$response = new RedirectResponse($url);\n\t\t}\n\t\treturn $response;\n\t}", "public function login(){\n if (!isset($_GET['response']) && $_SERVER['REQUEST_METHOD'] === 'POST') {\n $email = $_POST[\"email\"];\n $password = trim($_POST[\"password\"]);\n }\n //if data comes from loginFrom, it is in requests body\n else if (isset($_GET['response'])) {\n $json_str = file_get_contents('php://input');\n $requestBody = json_decode($json_str, true);\n $email = $requestBody[\"email\"];\n $password = trim($requestBody[\"password\"]);\n }\n $msg = \"\";\n if(isset($email)){\n $realPassword = UserDao::getPassByEmail($email);\n if($realPassword == null){\n $msg .= \"Невалиден email\";\n $this->triggerError($msg, 'login.tpl');\n }\n else{\n if(password_verify($password, $realPassword)) {\n $user = UserDao::getByEmail($email);\n $_SESSION[\"user\"]= $user;\n //if request comes from loginForm we must return that login is successful\n if (isset($_GET['response']) && $_GET['response']==\"json\") {\n $response = array();\n $response[\"success\"]= \"true\";\n echo json_encode($response);\n die();\n }\n if($user->getIsAdmin() != null){\n $_SESSION[\"user\"]= $user;\n include_once URI . \"view/adminPanel.php\";\n }\n else {\n header(\"Location: \".BASE_PATH);\n }\n }\n else {\n if (isset($_GET['response']) && $_GET['response']==\"json\") {\n $response = array();\n $response[\"success\"]= \"false\";\n echo json_encode($response);\n die();\n }\n $msg .= \"Грешен email или парола\";\n $this->triggerError($msg, 'login.tpl');\n }\n }\n }\n else {\n $GLOBALS[\"smarty\"]->assign('msg', $msg);\n $GLOBALS[\"smarty\"]->assign('isLoggedIn', isset($_SESSION[\"user\"]));\n $GLOBALS[\"smarty\"]->display('login.tpl');\n }\n }", "public function postLoginAjax(LoginRequest $request, Guard $auth)\n\t{\n\t\t\t\t\t/*\n\t\t\t\t\t\n\t\t\t\t\tif($request->ajax()) {\n\t\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t\t'view' => view('back.posts.table', compact('posts'))->render(), \n\t\t\t\t\t\t\t'links' => e($links)\n\t\t\t\t\t\t]);\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$post = $this->post->find($id);\n\t\t\t\t\t#$this->authorize('change', $post);\n\t\t\t\t\t$this->post->updateActive($request->all(), $id);\n\t\t\t\t\treturn response()->json();\n\t\t\t\t\t*/\n\t\t\n\t\tif($request->ajax()){\n\t\t\n\t\t\tif($auth->user()) return response()->json('уже залогинен');\n\t\t\t#return response()->json($request->input('log'));\n\t\t\t\n\t\t\t$logValue = $request->input('log');\n\t\t\t$logAccess = filter_var($logValue, FILTER_VALIDATE_EMAIL) ? 'email' : 'username';\n\n\t\t\t$throttles = in_array(\n\t\t\t\tThrottlesLogins::class, class_uses_recursive(get_class($this))\n\t\t\t);\n\n\t\t\tif ($throttles && $this->hasTooManyLoginAttempts($request)) {\n\t\t\t\treturn response()->json(['error1', trans('front/login.maxattempt')]);\n\t\t\t}\n\n\t\t\t$credentials = [\n\t\t\t\t$logAccess => $logValue, \n\t\t\t\t'password' => $request->input('password')\n\t\t\t];\n\n\t\t\tif(!$auth->validate($credentials)) {\n\t\t\t\tif ($throttles) {\n\t\t\t\t\t$this->incrementLoginAttempts($request);\n\t\t\t\t}\n\n\t\t\t\treturn response()->json(['error2', trans('front/login.credentials')]);\n\t\t\t}\n\t\t\t\t\n\t\t\t$user = $auth->getLastAttempted();\n\n\t\t\tif($user->confirmed) {\n\t\t\t\tif ($throttles) {\n\t\t\t\t\t$this->clearLoginAttempts($request);\n\t\t\t\t}\n\n\t\t\t\t$auth->login($user, $request->has('memory'));\n\n\t\t\t\tif($request->session()->has('user_id'))\t{\n\t\t\t\t\t$request->session()->forget('user_id');\n\t\t\t\t}\n\n\t\t\t\treturn response()->json('ok');\n\t\t\t}\n\t\t\t\n\t\t\t$request->session()->put('user_id', $user->id);\t\n\n\t\t\treturn response()->json(['error3', trans('front/verify.again')]);\n\t\t\n\t\t}\n\t\telse abort(404);\n\n\t}", "public function loginRequired($checkAjax = true)\n {\n $request = Yii::$app->getRequest();\n if ($this->enableSession && (!$checkAjax || !$request->getIsAjax())) {\n $this->setReturnUrl($request->getUrl());\n }\n \n if ($this->loginUrl !== null) {\n $loginUrl = (array) $this->loginUrl;\n \n if ($loginUrl[0] !== Yii::$app->requestedRoute) {\n return Yii::$app->getResponse()->redirect('/common/web/index.php?r=site/login');\n }\n }\n \n throw new \\yii\\web\\ForbiddenHttpException(Yii::t('yii', 'Login Required'));\n }", "public function ajaxAction() {\n $result = $this->_auth->authenticate($this->_adapter);\n if ($result->isValid()) {\n $this->_auth->getStorage()->write(array(\"identity\" => $result->getIdentity(), \"user\" => new Josh_Auth_User($this->_type, $result->getMessages())));\n\n $ident = $this->_auth->getIdentity();\n\n $loggedIn = $this->view->partial('partials/userLoggedIn.phtml', array('userObj' => $ident['user']));\n $alert = $this->view->partial('partials/alert.phtml', array('alert' => 'Successful Login', 'alertClass' => 'alert-success'));\n\n $html = array(\"#userButton\" => $loggedIn, \"alert\" => $alert);\n $this->jsonResponse('success', 200, $html);\n } else {\n $errorMessage = $result->getMessages();\n $alert = $this->view->partial('partials/alert.phtml', array('alert' => $errorMessage['error'], 'alertClass' => 'alert-error'));\n\n $html = array(\"alert\" => $alert);\n $this->jsonResponse('error', 401, $html, $errorMessage['error']);\n }\n }", "public function postLoginGlobal ()\n {\n $user = Auth::validate(Input::all());\n if (! $user) {\n return Response::json(['message' => 'Invalid credentials'], 500);\n }\n if ($user->status == 0) {\n return Response::json(\n ['message' => 'Account is inactive.', 'code' => 4, 'email' => $user->email], 403);\n }\n Event::fire('user.login-global', [Auth::user()]);\n return $user;\n }", "public function postLogin()\n {\n if ($this->request->is('post')) {\n $input = $this->request->getData();\n // Check validate login of input data\n $validate = $this->Client->newEntity($input, ['validate' => 'login']);\n\n // Check this validate had error or not\n if ($validate->errors()) {\n $this->set($validate->errors());\n // Check login by account of Shop and redirect to Index page if success\n } else if ($shop = $this->Shop->checkLoginForShop($input) != null) {\n // Change to Model Shop to check authenticate.\n $this->Auth->config('authenticate', [\n 'Form' => ['userModel' => 'Shop']\n ]);\n\n $shop = $this->Auth->identify();\n $this->Auth->setUser($shop);\n\n return $this->redirect(['controller' => 'Pages', 'action' => 'index']);\n // Check login by account of Client and redirect to Index page if success\n } else if ($client = $this->Auth->identify()) {\n $this->Auth->setUser($client);\n return $this->redirect(['controller' => 'Pages', 'action' => 'home']);\n } else {\n $this->Flash->error('Username or password are not correct..');\n }\n $this->login();\n }\n }", "public function post_signin()\n\t{\n\t\tif(Service\\Validation\\Login::passes(Input::all()))\n\t\t{\n\t\t\tif(Service\\Security::authorize(array('username' => Input::get('username'), 'password' => Input::get('password'))))\n\t\t\t{\n\t\t\t\treturn Redirect::home();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to_route('login')->with_input()->with_errors(new Messages(array(\n\t\t\t\t\t__('login.failed')->get()\n\t\t\t\t)));\n\t\t\t}\n\t\t}\n\n\t\treturn Redirect::to_route('login')->with_input()->with_errors(Service\\Validation::errors());\n\t}", "function json_oauth_force_reauthentication() {\n\tif ( is_user_logged_in() ) {\n\t\t// Another handler has already worked successfully, no need to\n\t\t// reauthenticate.\n\n\t\treturn;\n\t}\n\n\t// Force reauthentication\n\tglobal $current_user;\n\t$current_user = null;\n\tget_currentuserinfo();\n}", "private function json_login()\n {\n $msg = \"Invalid Request. Email and Password Required\";\n $status = 400;\n $token = null;\n $input = json_decode(file_get_contents(\"php://input\"));\n\n if ($input) {\n\n if (isset($input->email) && isset($input->password)) {\n $query = \"SELECT userID, username, email, password FROM Users WHERE email LIKE :email\";\n $params = [\"email\" => $input->email];\n $res = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $password = ($res['count']) ? $res['data'][0]['password'] : null;\n if (password_verify($input->password, $password)) {\n $msg = \"User Authorised. Welcome \" . $res['data'][0]['email'];\n $status = 200;\n\n $token = array();\n $token['email'] = $input->email;\n $token['email'] = $res['data'][0]['email'];\n $token['userID'] = $res['data'][0]['userID'];\n $token['username'] = $res['data'][0]['username'];\n $token['iat'] = time();\n $token['exp'] = time() + (60 + 60);\n\n $jwtkey = JWTKEY;\n $token = \\Firebase\\JWT\\JWT::encode($token, $jwtkey);\n\n } else {\n $msg = \"Email or Password is Invalid\";\n $status = 401;\n }\n }\n }\n\n return json_encode(array(\"status\" => $status, \"message\" => $msg, \"token\" => $token));\n }", "public function indexAction(): Response\n {\n if ($this->loginService->isSessionActive() || $this->loginService->automaticLogIn()) {\n return new RedirectResponse('/admin');\n }\n\n return new HTMLResponse('login', ['title' => 'Log In']);\n }", "protected function checkRedirect() {}", "protected function redirectTo($request)\n {\n if (!$request->expectsJson()) {\n return route('login', ['redirect' => $request->getRequestUri()]);\n }\n }", "protected function _authenticated()\n\t{\n\t\tif(!$this->_logged_in()){\n\t\t\t\n\t\t\t$this->session->set('alert',array('type' => 'danger', 'message' => 'Please login'));\n\t\t\t\t\n\t\t\turl::redirect(Kohana::config('admin.url').'/account/login', 301);\n\t\t}\n\t}", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "public static function handleRequest()\n {\n if(isset($_SESSION['user']) && $_SESSION['user'] !== NULL)\n return true;\n return false;\n }", "public function preAuth(Request $request, Response $response);", "public function preAuth(Request $request, Response $response);", "public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "function checkSessionAjax(){\r\n if (!$this->Session->check('User'))\r\n {\r\n \t// Force the user to login\r\n $this->redirect('/user/ajaxnologin');\r\n exit();\r\n }\r\n\t}", "public function afterSuccessLogin($request)\n {\n $this->putAppSettingsInSession();\n $this->saveActivity(null, \"Login\");\n\n if ($request->ajax()) {\n return response()->json([\n 'success' => true,\n 'msg' => __('Successfully logged in')\n ], 200);\n } else {\n if ($request->filled('redirect_to')) {\n return redirect($request->get('redirect_to'));\n } else {\n return redirect()->route('home');\n }\n }\n }", "public function accountInfo(): Response\n {\n // logged in, or are logged in via a remember me cookie\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');\n\n // ...\n }", "protected function check_auth( )\n\t{\n\t\t$page = $this->uri->segment( 2);\n\t\t$section = $this->uri->segment(1);\t\t\n\t\t$function = $this->uri->segment(3);\n\t\t\n\t\tif( $section == 'api' and $page == 'users' and $function == 'login' )\n\t\t\treturn;\n\n\t\t$logged_in = $this->is_logged_in();\n\t\t$excused_uri = array('login' , 'recover_password' , 'auth_help' , 'token_login');\n\t\tif( ! $logged_in )\n\t\t{\n\t\t\t//if in app mode\n\t\t\tif( $this->_app_mode == 'json' and $section != 'admin' )\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$this->output->set_status_header('401');\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//check if is login page\n\t\t\tif( $section == 'admin' and ( ! in_array($page, $excused_uri) ) )\n\t\t\t{\n\t\t\t\theader('Location: /admin/login');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\treturn;\n\t}" ]
[ "0.6698295", "0.6521197", "0.63815457", "0.61297345", "0.6099187", "0.604042", "0.59660673", "0.59342396", "0.5889052", "0.58647996", "0.5857175", "0.5794604", "0.5779036", "0.57702166", "0.576867", "0.5766504", "0.57534266", "0.5747338", "0.5703438", "0.570227", "0.5700319", "0.56967926", "0.5689549", "0.568549", "0.5681485", "0.5675336", "0.56724787", "0.56383395", "0.5630743", "0.5628224", "0.56172645", "0.5608672", "0.56050485", "0.5600114", "0.55999905", "0.55957156", "0.55803335", "0.55730724", "0.55728984", "0.55674416", "0.5566984", "0.5543289", "0.5540368", "0.5537875", "0.5535401", "0.55303", "0.55294687", "0.5528827", "0.55273414", "0.5526602", "0.5512253", "0.5511867", "0.550771", "0.5496452", "0.5494087", "0.54927135", "0.5485601", "0.54816693", "0.5476724", "0.547666", "0.5476101", "0.5466547", "0.5466547", "0.5466547", "0.5466547", "0.5466547", "0.5462241", "0.5453244", "0.54508054", "0.54507685", "0.54374665", "0.5435524", "0.5415123", "0.54130226", "0.5408772", "0.5406431", "0.54034054", "0.54017764", "0.5400929", "0.5400365", "0.53979445", "0.5392379", "0.53879976", "0.5386934", "0.5384596", "0.53811324", "0.5380788", "0.5377118", "0.53729486", "0.53618795", "0.5361755", "0.5361115", "0.53595525", "0.53595525", "0.53566295", "0.53559315", "0.535303", "0.5343922", "0.53438705", "0.53372777" ]
0.53897434
82
Determine if the given request accepts any content type.
private function acceptsAnyContentType(Request $request): bool { $acceptable = $request->getAcceptableContentTypes(); return 0 === count($acceptable) || ( isset($acceptable[0]) && ('*/*' === $acceptable[0] || '*' === $acceptable[0]) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function acceptableContentTypes() {\n\t\t$accept = $this->getHeader('Accept');\n\t\treturn $accept === null ? array() : self::parseNegotiation($accept);\n\t}", "public function accepts_content_type($name = '') {\n\t\treturn ($name == 'channel' || $name == 'grid');\n\t}", "public function accepts($content_type) {\n\t\t$accept = $this->acceptableContentTypes();\n\t\treturn (\n\t\t\tarray_key_exists($content_type, $accept) &&\n\t\t\t$accept[$content_type] > 0\n\t\t);\n\t}", "public function getAcceptableContentTypes()\n {\n if ($this->_contentTypes === null) {\n if (isset($_SERVER['HTTP_ACCEPT'])) {\n $this->_contentTypes = $this->parseAcceptHeader($_SERVER['HTTP_ACCEPT']);\n } else {\n $this->_contentTypes = [];\n }\n }\n\n return $this->_contentTypes;\n }", "public function canHandleRequest();", "public function canHandleRequest();", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "private function isJsonRequest(Request $request): bool\n {\n return in_array($request->getContentTypeFormat(), [null, 'json', 'txt'], true);\n }", "public function accepts_content_type($name)\n {\n return true;\n }", "public function testPreferredContentTypeOfReturnsADesiredFormatIfItIsAccepted()\n {\n $server = [\n 'HTTP_ACCEPT' => 'text/text,application/xhtml+xml,application/json;q=0.9,*/*;q=0.8',\n ];\n $request = new Request($this->config, $server);\n\n $result = $request->preferredContentTypeOutOf(\n ['text/html', 'application/json']\n );\n\n $this->assertEquals('application/json', $result);\n\n $result = $request->preferredContentTypeOutOf();\n\n $this->assertEquals('application/json', $result);\n }", "public function negotiateRequestContent(string $type, IRequest $request): ContentNegotiationResult;", "private function wantsJson(Request $request): bool\n {\n $acceptable = $request->getAcceptableContentTypes();\n\n return isset($acceptable[0]) && $this->stringHelper->contains($acceptable[0], ['/json', '+json']);\n }", "private function isValidRequest(Request $request) :bool\n {\n return $request->getContentType() === 'json';\n }", "private function expectsJson()\r\n {\r\n $request = \\Yii::$app->request;\r\n return !$request->getIsPjax() && (in_array('application/json', explode(',', $request->headers->get('accept'))));\r\n }", "public function supports(Request $request);", "function canHandleRequest() ;", "public function canHandleRequest(\\Eeno\\Http\\Request $request)\n {\n if( strcasecmp($request->method() , $this->method() ) == 0 &&\n strcasecmp($this->url() , $request->url() ) == 0)\n return true;\n return false; \n }", "public function isFormRequest()\n {\n return str_contains($this->header('CONTENT_TYPE'), '/form-data');\n }", "static function isValidContentType($ct) {\n $valids = self::getValidContentTypes();\n\n foreach ($valids as $vct) {\n if (strpos($ct, $vct) !== FALSE) {\n return TRUE;\n }\n }\n\n return FALSE;\n }", "public function supports(Request $request): ?bool\n {\n return $request->headers->has($this->headerField);\n }", "public function getAcceptableContentTypes(): array\n {\n if (null !== $this->acceptableContentTypes) {\n return $this->acceptableContentTypes;\n }\n\n return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->header('accept'))->all());\n }", "static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }", "public function isRenderable(Throwable $e, $request): bool\n {\n if (true === $this->mustAccept($e, $request)) {\n return true;\n }\n\n if ($e instanceof JsonApiException) {\n return true;\n }\n\n $acceptable = $request->getAcceptableContentTypes();\n\n return isset($acceptable[0]) && 'application/vnd.api+json' === $acceptable[0];\n }", "public function isRequest();", "private function hasXmlContentType($params)\n {\n $header = $this->headerManager->get('Content-Type');\n\n if(preg_match($this->xmlPattern, $header)) return true;\n\n return false;\n }", "function http_negotiate_content_type(array $supported, ?array &$result = null) {}", "function canProcessRequests()\n\t{\n\t\tif ($this->getRequestMode() != -1) return true;\n\t\treturn false;\n\t}", "public function isRequestAllowed(Request $request);", "private function getContentType(Request $request)\n {\n return 1 === preg_match(\n '/\\/incc\\/([0-9]{4}\\/[0-9]{2}\\/[0-9]{2}\\/.*|post)/',\n $request->server()->get('REQUEST_URI')\n ) ? Page::TYPE_POST : Page::TYPE_PAGE;\n }", "public function checkMimeType()\n {\n if (empty($this->mediaRealType) && empty($this->allowUnknownTypes)) {\n $this->setErrors(\\XoopsLocale::E_FILE_TYPE_REJECTED);\n return false;\n }\n\n if ((!empty($this->allowedMimeTypes)\n && !in_array($this->mediaRealType, $this->allowedMimeTypes))\n || (!empty($this->deniedMimeTypes)\n && in_array($this->mediaRealType, $this->deniedMimeTypes))\n ) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_MIME_TYPE_NOT_ALLOWED, $this->mediaType));\n return false;\n }\n return true;\n }", "public function determineContentType()\n {\n // step 1: are we in a browser at all?\n if (!isset($_SERVER))\n {\n // no, so we must be a console app\n return App_Request::CT_CONSOLE;\n }\n\n // TODO: detect content negotiation properly\n return App_Request::CT_XHTML;\n }", "public function negotiateResponseContent(string $type, IRequest $request): ContentNegotiationResult;", "public function is_json_content_type()\n {\n }", "public static function accepts()\n {\n return ['application/json'];\n }", "protected function isMultipartRequest(Request $request)\n {\n $header = $request->getHeaderLine('Content-Type');\n return strpos($header, 'multipart/form-data') !== false;\n }", "public function hasACacheableContentType()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n foreach ($this->headersList() as $_key => $_header) {\n if (mb_stripos($_header, 'content-type:') === 0) {\n $content_type = $_header;\n } // Use last content-type header.\n } // unset($_key, $_header); // Housekeeping.\n\n if (isset($content_type[0]) && mb_stripos($content_type, 'html') === false\n && mb_stripos($content_type, 'xml') === false && mb_stripos($content_type, GLOBAL_NS) === false) {\n return $is = false; // Do NOT cache data sent by scripts serving other MIME types.\n }\n return $is = true;\n }", "public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}", "public function checkJsonRequested() {\n\t\t$contentTypes = \\Yii::$app->request->getAcceptableContentTypes();\n if (isset($contentTypes['application/json'])) {\n $this->jsonRequested = true;\n }\n\t}", "public function containsJson(): bool\n {\n return Str::contains($this->getContentType(), 'application/json');\n }", "public function isJSON()\n\t{\n\t\treturn $this->hasHeader('Content-Type')\n\t\t\t&& $this->header('Content-Type')->getValue() === 'application/json';\n\t}", "public function testIfPreferredFormatIsNotAcceptedReturnJson()\n {\n $server = [\n 'HTTP_ACCEPT' => 'text/text,application/xhtml+xml,application/json;q=0.9,*/*;q=0.8',\n ];\n $request = new Request($this->config, $server);\n\n $result = $request->preferredContentTypeOutOf([\n 'text/html',\n 'application/xml',\n ]);\n\n $this->assertEquals('json', $result);\n }", "private function hasJsonContentType($params)\n {\n $header = $this->headerManager->get('Content-Type');\n\n if(preg_match($this->jsonPattern, $header)) return true;\n\n return false;\n }", "private function get_content_type() {\n\n\t $ct = $this->content_types();\n\t $a = trim(reset(explode(',',$_SERVER['HTTP_ACCEPT'])));\n\t \n\t\theader('Content-type:'.$a); // Set header\n\t\n\t if (array_key_exists($a,$ct)) return $ct[$a];\n\t // throw error\n\t throw new Exception('Content type unknown - '.$a);\n\t \n }", "public function testAcceptsHeadersAreParsedCorrectly()\n {\n $server = [\n 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n ];\n $request = new Request($this->config, $server);\n\n $this->assertFalse($request->accepts('image/png'));\n $this->assertTrue($request->accepts('text/html'));\n $this->assertTrue($request->accepts('application/xhtml+xml'));\n $this->assertTrue($request->accepts('application/xml'));\n $this->assertTrue($request->accepts('*/*'));\n }", "protected function isFormRequest(Request $request)\n {\n $contentTypeParts = explode(';', $request->headers->get('Content-Type'));\n\n if (isset($contentTypeParts[0])) {\n return in_array($contentTypeParts[0], ['multipart/form-data', 'application/x-www-form-urlencoded']);\n }\n\n return false;\n }", "public function supports(Request $request)\n {\n return $request->headers->has('Authorization')\n && 0 === strpos($request->headers->get('Authorization'), 'Bearer ');\n\n }", "public function isJson()\n {\n return $this->request->isJson() || ($this->request->header('CONTENT_TYPE') === 'application/vnd.api+json');\n }", "public function isAllowedType()\n {\n $extension = $this->getFile()->guessExtension();\n if (in_array($extension, $this->allowedTypes)) {\n return true;\n } else {\n return false;\n }\n }", "public function getWantedType() {\n $accepts = $this->getHeaders('Accept');\n\n $accept = trim(explode(',', $accepts)[0]);\n\n $key = array_search($accept, self::$contentTypes);\n\n return $key ? $key : $accept;\n }", "public function hasMimeType() {\n return $this->_has(8);\n }", "public function canHandle(OAuth2Request $request)\n {\n $reflector = new ReflectionClass($request);\n $class_name = $reflector->getName();\n return\n ($class_name == 'oauth2\\requests\\OAuth2AuthorizationRequest' && $request->isValid() && $request->getResponseType() == $this->getResponseType());\n }", "public function isExpectedContent(array $configOptions, Request $request);", "public function isXml()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/xml');\n\t}", "function is_request($meta = array())\n {\n }", "public function getcontentType();", "protected function setContentTypes()\n\t{\n\t\t// Some temporary examples\n\t\t$content_types = array(\n\t\t\t'text/html' => 'html',\n\t\t\t'application/json' => 'js',\n\t\t\t'application/xml' => 'xml',\n\t\t);\n\n\t\t$accept = $_SERVER['HTTP_ACCEPT'];\n\n\t\t$accept = explode(',', $accept);\n\t\tforeach ($accept as $key => $value) {\n\t\t\t$accept[$key] = explode(';', $accept[$key]);\n\n\t\t\t/*\n\t\t\t*\tTODO:\n\t\t\t*\tParse q value and sort array.\n\t\t\t*/\n\n\t\t\t$type = $accept[$key][0];\n\t\t\tif (isset($content_types[$type])) {\n\t\t\t\t$this->request['accept'][$type] = $content_types[$type];\n\t\t\t}\n\t\t}\n\t}", "public function matches(Request $request)\n {\n return $this->isPreflightRequest($request);\n }", "public function isMimeSupported($mimeType = '*');", "public static function is_event_request($requestData = null, $contentTypes = null)\n {\n if (!$requestData) {\n $requestData = $_SERVER;\n }\n\n if (!$contentTypes) {\n $contentTypes = static::$eventContentTypes;\n }\n\n switch (false) { // All of these things must be true\n case isset($requestData['REQUEST_METHOD']):\n case $requestData['REQUEST_METHOD'] == 'POST':\n case isset($requestData['CONTENT_TYPE']):\n case in_array($requestData['CONTENT_TYPE'], $contentTypes):\n return false;\n }\n\n return array_search($requestData['CONTENT_TYPE'], $contentTypes);\n }", "public abstract function isMime();", "function supported($mime_type, $mode) {\r\r\n\t\treturn in_array(\r\r\n\t\t\tstrToLower($mime_type),\r\r\n\t\t\t$this->get_supported_types($mode)\r\r\n\t\t\t);\r\r\n\t\t}", "public function get_content_type()\n {\n }", "public function supports( Request $request ) : ?bool\r\n {\r\n return $request->headers->has( 'X-AUTH-TOKEN' );\r\n }", "public function isAllowedMIMEType()\n {\n if (!empty($this->allowed_upload_mime_type)) {\n if (!is_array($this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(MIME_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['type'], $this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_MIME_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function authorizeToViewAny(Request $request)\n {\n return $this->inContract($request) || parent::authorizedToView($request);\n }", "protected function _needsRenderer()\n {\n $types = $this->getRequest()->getAcceptTypes();\n $htmlPos = array_search(Clockworkgeek_Extrarestful_Model_Api2_Block_Renderer::MIME_TYPE, $types);\n if ($htmlPos !== false) {\n /** @var $helper Mage_Api2_Helper_Data */\n $helper = Mage::helper('api2');\n $adapters = $helper->getResponseRenderAdapters();\n foreach ($adapters as $item) {\n $typePos = array_search($item->type, $types);\n if ($typePos < $htmlPos) {\n return false;\n }\n }\n return true;\n }\n return false;\n }", "public function isJSON()\n {\n return isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json';\n }", "public function setAcceptableContentTypes($value)\n {\n $this->_contentTypes = $value;\n }", "public function isRequest(): bool {\n return $this->options['request'] ?? false;\n }", "public function validate_request() {\r\n\t\tif ($this->request != null && sizeof($this->request) != 1)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "protected function isDecodeable(Request $request)\n {\n if (!in_array($request->getMethod(), ['POST', 'PUT', 'PATCH', 'DELETE'])) {\n return false;\n }\n\n return !$this->isFormRequest($request);\n }", "private function is_request( $type ) {\n switch ( $type ) {\n case 'admin':\n return is_admin();\n case 'ajax':\n return defined( 'DOING_AJAX' );\n case 'cron':\n return defined( 'DOING_CRON' );\n case 'frontend':\n return ( ! is_admin() );\n }\n }", "public function supports(RequestInterface $request)\n {\n return !is_null($request->width) || !is_null($request->height);\n }", "public function testAcceptContentType()\n {\n\n $config = ['accepts' => ['text/html']];\n $response = m::mock(Response::class);\n $headers = m::mock(stdClass::class);\n $response->headers = $headers;\n $request = m::mock(Request::class);\n $app = m::mock(ApplicationContract::class);\n\n /*\n |------------------------------------------------------------\n | Expectation\n |------------------------------------------------------------\n */\n\n $response\n ->shouldReceive('isRedirection')->once()->andReturn(false)\n ->shouldReceive('getContent')->once()\n ->shouldReceive('setContent')->once();\n $headers->shouldReceive('get')->with('Content-type')->once()->andReturn('text/html');\n $request->shouldReceive('ajax')->once()->andReturn(false);\n $tracy = new Tracy($config, $app, $request);\n $excepted = $tracy->renderResponse($response);\n\n /*\n |------------------------------------------------------------\n | Assertion\n |------------------------------------------------------------\n */\n\n $this->assertSame($excepted, $response);\n }", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function canProcessRequest()\n\t{\n\t\t// Check the validity of the function name\n\t\tif(($this->sRequestedFunction) && !$this->validateFunction($this->sRequestedFunction))\n\t\t{\n\t\t\t$this->sRequestedFunction = null;\n\t\t}\n\t\treturn ($this->sRequestedFunction != null);\n\t}", "public function shouldRespondTo($filename, $media_range = null)\n {\n // If no media range is passed, evalute http header \"Accept\"\n if ($media_range === null && isset($_SERVER['ACCEPT'])) {\n $media_range = reset(explode(';', $_SERVER['ACCEPT']));\n }\n\n // Test if either the filename has the appropriate extension or\n // if the client accepts the content type\n return ($this->extension() && fnmatch('*' . $this->extension(), $filename))\n || ($media_range && fnmatch($media_range, $this->contentType()));\n }", "public function supports(Request $request) : bool\n {\n return $request->headers->has(Constants::APP_KEY_HEADER_NAME);\n }", "public function isJson()\n {\n $content_type = isset($_SERVER['CONTENT_TYPE']) ? trim($_SERVER['CONTENT_TYPE']) : '';\n return strcasecmp($content_type, 'application/json') != 0 ? false : true;\n }", "protected function isValid()\n {\n return !app('request') instanceof Request;\n }", "static function is_requested()\n {\n $retval = FALSE;\n if (self::is_requested_page()) {\n $retval = self::is_requested_page();\n } elseif (self::is_requested_post_type()) {\n $retval = self::is_requested_post_type();\n }\n return apply_filters('is_ngg_admin_page', $retval);\n }", "public function supports($resource, $type = null)\n {\n return is_string($resource) &&\n 'xml' === pathinfo($resource, PATHINFO_EXTENSION) &&\n 'rest' === $type;\n }", "private function is_request( $type )\n {\n switch ( $type ) {\n case 'admin':\n return is_admin();\n case 'ajax':\n return defined( 'DOING_AJAX' );\n case 'cron':\n return defined( 'DOING_CRON' );\n case 'frontend':\n return (!is_admin() || defined( 'DOING_AJAX' )) && !defined( 'DOING_CRON' );\n }\n }", "public function hasRequestBeenHandled() : bool\n {\n return $this->requestHandled;\n }", "public function acceptType() {\n\t\treturn $this->getDecoder()->acceptType();\n\t}", "protected function __get_is_xhr()\n\t{\n\t\treturn !empty($this->env['HTTP_X_REQUESTED_WITH']) && preg_match('/XMLHttpRequest/', $this->env['HTTP_X_REQUESTED_WITH']);\n\t}", "private function is_request( $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'admin' :\n\t\t\t\t\treturn is_admin();\n\t\t\t\tcase 'ajax' :\n\t\t\t\t\treturn defined( 'DOING_AJAX' );\n\t\t\t\tcase 'cron' :\n\t\t\t\t\treturn defined( 'DOING_CRON' );\n\t\t\t\tcase 'frontend' :\n\t\t\t\t\treturn ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );\n\t\t\t}\n\t\t}", "private function is_request( $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'admin' :\n\t\t\t\t\treturn is_admin();\n\t\t\t\tcase 'ajax' :\n\t\t\t\t\treturn defined( 'DOING_AJAX' );\n\t\t\t\tcase 'cron' :\n\t\t\t\t\treturn defined( 'DOING_CRON' );\n\t\t\t\tcase 'frontend' :\n\t\t\t\t\treturn ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );\n\t\t\t}\n\t\t}", "public function isJson()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/json');\n\t}", "public function testGetContentType()\n {\n $this->curlAdapter->open();\n \n $this->assertEmpty($this->curlAdapter->getContentType());\n \n $this->curlAdapter->close();\n }", "protected function _validateMimeType()\n\t{\n\t\t$this->_fileType = \\MimeType\\MimeType::getType($this->getFilePath());\n\n\t\tif (!in_array($this->_fileType, $this->_allowedMimeType)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function getAllowedContentTypes()\n {\n if (array_key_exists(\"allowedContentTypes\", $this->_propDict)) {\n if (is_a($this->_propDict[\"allowedContentTypes\"], \"\\Beta\\Microsoft\\Graph\\Model\\ContentTypeInfo\") || is_null($this->_propDict[\"allowedContentTypes\"])) {\n return $this->_propDict[\"allowedContentTypes\"];\n } else {\n $this->_propDict[\"allowedContentTypes\"] = new ContentTypeInfo($this->_propDict[\"allowedContentTypes\"]);\n return $this->_propDict[\"allowedContentTypes\"];\n }\n }\n return null;\n }", "public function isCorsRequest(Request $request);", "public function contentType();", "function is_request(): bool\n{\n return isset($_REQUEST);\n}", "public function supports(Request $request): bool\n {\n if ($request->getPathInfo() != '/login' || !$request->isMethod('POST')) {\n return false;\n }\n return true;\n }", "protected function shouldParseJsonPayload($request)\n {\n return in_array($request->method(), ['POST', 'PUT', 'PATCH']) && $request->isJson();\n }" ]
[ "0.683211", "0.682815", "0.6751245", "0.6692486", "0.66710466", "0.66710466", "0.65680546", "0.65680546", "0.65680546", "0.65680546", "0.65558404", "0.64473057", "0.640529", "0.63946104", "0.639117", "0.63432777", "0.6325101", "0.63057965", "0.6302268", "0.6297111", "0.6284891", "0.6277698", "0.61765116", "0.613444", "0.61175907", "0.6111665", "0.60978997", "0.60236883", "0.60200846", "0.6014454", "0.60137165", "0.601207", "0.60068053", "0.60061157", "0.5991115", "0.59654164", "0.59491736", "0.59475", "0.5930931", "0.58183634", "0.5818187", "0.5807493", "0.5807139", "0.5801512", "0.5788794", "0.578803", "0.5783262", "0.57606006", "0.5758272", "0.5754958", "0.5752669", "0.5748467", "0.571941", "0.5711704", "0.5707467", "0.57050383", "0.5701894", "0.56923115", "0.5685566", "0.5675836", "0.56721896", "0.566871", "0.5658191", "0.5656495", "0.56536734", "0.5652247", "0.56418395", "0.5640492", "0.5630223", "0.5629208", "0.5619194", "0.5617918", "0.5612182", "0.560737", "0.56073356", "0.5603227", "0.5601481", "0.5600578", "0.5596507", "0.5594288", "0.5578761", "0.5540948", "0.55306333", "0.55301327", "0.551796", "0.5513535", "0.55124813", "0.5509754", "0.5506319", "0.5495694", "0.5495694", "0.5487459", "0.54824877", "0.5482002", "0.5475501", "0.5466706", "0.54605633", "0.54595715", "0.54556865", "0.54537714" ]
0.83254397
0
Determine if the given request is asking for JSON.
private function wantsJson(Request $request): bool { $acceptable = $request->getAcceptableContentTypes(); return isset($acceptable[0]) && $this->stringHelper->contains($acceptable[0], ['/json', '+json']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isJson()\n {\n return $this->request->isJson() || ($this->request->header('CONTENT_TYPE') === 'application/vnd.api+json');\n }", "public function isJson(){\n\t\t\n\t\treturn $this['request']['json'];\n\t\t\n\t}", "public function isJSON()\n {\n return isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json';\n }", "private function isJsonRequest(Request $request): bool\n {\n return in_array($request->getContentTypeFormat(), [null, 'json', 'txt'], true);\n }", "public function isJSON()\n\t{\n\t\treturn $this->hasHeader('Content-Type')\n\t\t\t&& $this->header('Content-Type')->getValue() === 'application/json';\n\t}", "public function isJson()\n {\n $content_type = isset($_SERVER['CONTENT_TYPE']) ? trim($_SERVER['CONTENT_TYPE']) : '';\n return strcasecmp($content_type, 'application/json') != 0 ? false : true;\n }", "public function isJson()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/json');\n\t}", "private function expectsJson()\r\n {\r\n $request = \\Yii::$app->request;\r\n return !$request->getIsPjax() && (in_array('application/json', explode(',', $request->headers->get('accept'))));\r\n }", "function wp_is_json_request()\n {\n }", "public function checkJsonRequested() {\n\t\t$contentTypes = \\Yii::$app->request->getAcceptableContentTypes();\n if (isset($contentTypes['application/json'])) {\n $this->jsonRequested = true;\n }\n\t}", "protected function isJson()\n {\n $contentType = $this->getContentType();\n\n return Str::contains(Str::lower($contentType), 'json');\n }", "public static function isJson() {\n\t if(Str::endsWith(self::getContentType(),'json')) {\n\t return true;\n\t }\n\t return false;\n\t}", "private function isApplicationJson(): bool\n\t{\n\t\tif (is_null($this->isJson)) {\n\t\t\t$contentType = $this->getDI()->getShared('request')->getHeader('CONTENT_TYPE');\n\n\t\t\t$this->isJson = ($contentType && explode(';', $contentType)[0] === 'application/json');\n\t\t}\n\n\t\treturn $this->isJson;\n\t}", "protected function shouldParseJsonPayload($request)\n {\n return in_array($request->method(), ['POST', 'PUT', 'PATCH']) && $request->isJson();\n }", "protected function responseIsJson() : bool\n {\n $type = json_encode($this->responseHeaders->get('Content-Type'));\n\n return Str::contains($type, 'json');\n }", "public function containsJson(): bool\n {\n return Str::contains($this->getContentType(), 'application/json');\n }", "function isJson()\n {\n $json = @call_user_func_array('json_decode', func_get_args());\n\n return json_last_error() ? false : $json;\n }", "public function isJson()\n {\n return parent::isJson();\n }", "public function isJsonResponse()\n {\n return $this->jsonResponse;\n }", "public function isJsonResponse()\n {\n return $this->jsonResponse;\n }", "public function is_json_content_type()\n {\n }", "public function isJson(): bool\n {\n json_decode($this->apiString);\n return (json_last_error() == JSON_ERROR_NONE);\n }", "public function isRequest();", "public function isFormatJson()\n\t\t\t{\n\t\t\t\treturn $this->getFormat() == self::FORMAT_JSON;\n\t\t\t}", "private function isValidRequest(Request $request) :bool\n {\n return $request->getContentType() === 'json';\n }", "public function isJson()\n {\n if (!isset($this->str[0])) {\n return false;\n }\n\n json_decode($this->str);\n\n if (json_last_error() === JSON_ERROR_NONE) {\n return true;\n } else {\n return false;\n }\n }", "public function getIsGetRequest()\n\t{\n\t\treturn ($this->getRequestType() == 'GET');\n\t}", "public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}", "public function isJsonAvailable()\n {\n if (!function_exists('json_decode') && !function_exists('json_encode')) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_json_notice'), true, 'validator');\n\n return false;\n }\n\n return true;\n }", "private function isJsonPRequest(Request $request)\n {\n $method = $request->getMethod();\n if($method!=\"GET\") return false; //JSONP is forced to be on GET requests only\n $parameters = $this->findRequestParameters($request);\n\n if(array_key_exists(\"jsonp\", $parameters)) {\n $jsonpValue = $parameters[\"jsonp\"];\n if (($jsonpValue===true) || ($jsonpValue===\"true\")) {\n return true;\n }\n }\n\n return false;\n }", "function is_request($meta = array())\n {\n }", "private function _parseJson()\n {\n $data = @json_decode( $this->input, true );\n\n if( is_array( $data ) )\n {\n $_REQUEST = array_merge($_GET, $data);\n return true;\n }\n return false;\n }", "public function isAjaxRequest($request)\n {\n return $request->ajax() && $request->wantsJson();\n }", "private function is_json_valid() {\n\t\treturn $this->is_amp() ? $this->is_json_valid['amp'] : $this->is_json_valid['nonamp'];\n\t}", "static function isJson()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::isJson', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "function isGetRequest() {\r\n return ( filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'GET' );\r\n}", "public static function isJson($str) {}", "function ajan_is_get_request() {\n\treturn (bool) ( 'GET' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );\n}", "public function isRequest(): bool {\n return $this->options['request'] ?? false;\n }", "public function satisfiesJSONExtension(): bool\n {\n if (function_exists('extension_loaded') && extension_loaded('json')) {\n return true;\n } else if (function_exists('json_encode')) {\n return true;\n }\n\n return false;\n }", "public function testIfPreferredFormatIsNotAcceptedReturnJson()\n {\n $server = [\n 'HTTP_ACCEPT' => 'text/text,application/xhtml+xml,application/json;q=0.9,*/*;q=0.8',\n ];\n $request = new Request($this->config, $server);\n\n $result = $request->preferredContentTypeOutOf([\n 'text/html',\n 'application/xml',\n ]);\n\n $this->assertEquals('json', $result);\n }", "public function isRequest(): bool\n {\n return $this->form->getMethod() == $this->request->getMethod();\n }", "public function begin($request)\r\n\t{\r\n\t\t$ajax = $request->isAjax();\r\n\t\tif ($ajax) {\r\n\t\t\t$this->form_fields = $request->getRequestVars();\r\n\t\t\tif (empty($this->form_fields)) return false;\t// Assume HTML was intended\r\n\t\t}\r\n\t\tccTrace::tr($request);\r\n\t\treturn $ajax && $request->getFormat() == 'json';\r\n\t}", "public function canHandleRequest();", "public function canHandleRequest();", "public function isJsonExpected(bool $softMatch = false): bool\n {\n $acceptHeader = AcceptHeader::fromString($this->request()->getHeaderLine('Accept'));\n foreach ($this->jsonTypes as $jsonType) {\n if ($acceptHeader->has($jsonType)) {\n return true;\n }\n }\n\n if ($softMatch) {\n foreach ($acceptHeader->getAll() as $item) {\n $itemValue = \\strtolower($item->getValue());\n if (\\str_ends_with($itemValue, '/json') || \\str_ends_with($itemValue, '+json')) {\n return true;\n }\n }\n }\n\n return false;\n }", "protected function isJsonCheck()\n {\n return is_file($this->jsonFile) && Json::check($this->getJsonContent());\n }", "public static function checkRequest($request)\n {\n $request = json_decode($request);\n\n $isMessaging = isset($request->activities[0]);\n if ($isMessaging && count($request->activities)) {\n return true;\n }\n return false;\n }", "private function hasJsonContentType($params)\n {\n $header = $this->headerManager->get('Content-Type');\n\n if(preg_match($this->jsonPattern, $header)) return true;\n\n return false;\n }", "public static function is_JSON( string $json ): bool { // phpcs:ignore\n\t\tjson_decode( $json );\n\n\t\treturn ( json_last_error() === JSON_ERROR_NONE );\n\t}", "private function isJson($string) {\n\t\tjson_decode($string);\n\t\treturn (json_last_error() == \"JSON_ERROR_NONE\");\n\t}", "public function isJson($string){\n\t\treturn self::stringIsJson($string);\n\t}", "function is_graphql_request()\n {\n }", "static function isJSON($string){\n return is_string($string) && is_array(json_decode($string, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false;\n }", "public static function is_graphql_request()\n {\n }", "function is_graphql_http_request()\n {\n }", "private function is_request( $type ) {\n switch ( $type ) {\n case 'admin':\n return is_admin();\n case 'ajax':\n return defined( 'DOING_AJAX' );\n case 'cron':\n return defined( 'DOING_CRON' );\n case 'frontend':\n return ( ! is_admin() );\n }\n }", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function wantsJson(){\n return true;\n }", "private function is_request( $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'admin' :\n\t\t\t\t\treturn is_admin();\n\t\t\t\tcase 'ajax' :\n\t\t\t\t\treturn defined( 'DOING_AJAX' );\n\t\t\t\tcase 'cron' :\n\t\t\t\t\treturn defined( 'DOING_CRON' );\n\t\t\t\tcase 'frontend' :\n\t\t\t\t\treturn ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );\n\t\t\t}\n\t\t}", "private function is_request( $type ) {\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'admin' :\n\t\t\t\t\treturn is_admin();\n\t\t\t\tcase 'ajax' :\n\t\t\t\t\treturn defined( 'DOING_AJAX' );\n\t\t\t\tcase 'cron' :\n\t\t\t\t\treturn defined( 'DOING_CRON' );\n\t\t\t\tcase 'frontend' :\n\t\t\t\t\treturn ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );\n\t\t\t}\n\t\t}", "function canHandleRequest() ;", "public function isJson($string)\r\n {\r\n json_decode($string);\r\n return (json_last_error() == JSON_ERROR_NONE);\r\n }", "private function isJson($string) {\n json_decode($string);\n return (json_last_error() == JSON_ERROR_NONE);\n }", "private function is_request( $type )\n {\n switch ( $type ) {\n case 'admin':\n return is_admin();\n case 'ajax':\n return defined( 'DOING_AJAX' );\n case 'cron':\n return defined( 'DOING_CRON' );\n case 'frontend':\n return (!is_admin() || defined( 'DOING_AJAX' )) && !defined( 'DOING_CRON' );\n }\n }", "public static function isJson()\n {\n return new Matcher\\IsJson();\n }", "function wp_is_jsonp_request()\n {\n }", "public function is_xhr() {\n return $this->method == 'xhr';\n }", "function isJsonRequestBody($jsonRequestBody)\n {\n if (!empty($jsonRequestBody) && empty(json_decode($jsonRequestBody))) { // if received json from raw body is not valid\n return abort(400, 'Invalid json');\n }\n\n }", "function is_JSON(...$args) \n{\n json_decode(...$args);\n return json_last_error() === JSON_ERROR_NONE;\n}", "private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }", "public static function is_graphql_http_request()\n {\n }", "public function isJSON($string){\n return is_string($string) && is_array(json_decode($string, true)) ? true : false;\n }", "function is_json($value)\n {\n return is_string($value) && is_array(json_decode($value, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false;\n }", "public static function is_request()\n\t{\n\t\treturn self::$is_server;\n\t}", "static public function is_json($string)\n\t{\n\t\treturn is_string($string) && is_array(json_decode($string, true)) ? true : false;\n\t}", "function isJSON($string)\n{\n return (is_null(json_decode($string))) ? false : true;\n}", "function scrappy_isJson($string) {\n return ((is_string($string) &&\n (is_object(json_decode($string)) ||\n is_array(json_decode($string))))) ? true : false;\n}", "public function isJsonNumericCheck()\n {\n return $this->jsonNumericCheck;\n }", "function cargo_is_json( $obj ) {\n\treturn is_string( $obj ) && is_array( json_decode( $obj, true ) ) && json_last_error() === JSON_ERROR_NONE;\n}", "function is_json(string $string): bool\n\t{\n\t\tjson_decode($string);\n\n\t\treturn empty(json_last_error());\n\t}", "function wp_is_json_media_type($media_type)\n {\n }", "public function hasRequest(): bool;", "public function hasRequest(): bool;", "function is_request(): bool\n{\n return isset($_REQUEST);\n}", "protected function isJson($string)\n {\n json_decode($string);\n\n return json_last_error() == JSON_ERROR_NONE;\n }", "public function canHandleRequest(\\Eeno\\Http\\Request $request)\n {\n if( strcasecmp($request->method() , $this->method() ) == 0 &&\n strcasecmp($this->url() , $request->url() ) == 0)\n return true;\n return false; \n }", "function is_json(string $string): bool\n {\n json_decode($string);\n return json_last_error() === JSON_ERROR_NONE;\n }", "private function should_add_json() {\n\t\tif ( ! is_admin() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( is_network_admin() && Helper::is_plugin_active_for_network() ) {\n\t\t\treturn Param::get( 'page' ) === 'rank-math';\n\t\t}\n\n\t\treturn Param::get( 'page' ) === 'rank-math-status';\n\t}", "private function isCacheSupport(JsonRequest $jsonRequest)\n {\n try {\n $object = $this->getMethod($jsonRequest);\n $metadata = $this->mapper->loadObjectMetadata($object);\n\n return $jsonRequest->getId()\n && $metadata['cache']\n && !$this->isDebug()\n && $this->getCache();\n } catch (\\Exception $e) {\n return false;\n }\n }", "function isJson($str)\n\t{\n\n\t\tjson_decode($str);\n\t\treturn (json_last_error() == JSON_ERROR_NONE);\n\n\t}", "function is_json( $string ){\n if( is_string( $string ) ){\n \n @json_decode( $string );\n return ( json_last_error() == JSON_ERROR_NONE );\n \n } else {\n \n return false;\n \n }\n}", "public static function isJson($text) { \n if($text && is_string($text) && 'null' != $text) {\n $text = trim($text);\n $start = substr($text, 0, 1); $end = substr($text, -1);\n if(('{' == $start && '}' == $end) \n || ('[' == $start && ']' == $end)) {}\n else {\n return false;\n }\n @json_decode($text); return (json_last_error() === JSON_ERROR_NONE);\n }\n return false;\n }", "public function isRenderable(Throwable $e, $request): bool\n {\n if (true === $this->mustAccept($e, $request)) {\n return true;\n }\n\n if ($e instanceof JsonApiException) {\n return true;\n }\n\n $acceptable = $request->getAcceptableContentTypes();\n\n return isset($acceptable[0]) && 'application/vnd.api+json' === $acceptable[0];\n }", "public function request( string $type ): bool {\n\t\tswitch ( $type ) {\n\t\t\tcase 'backend':\n\t\t\t\treturn $this->is_admin_backend();\n\n\t\t\tcase 'ajax':\n\t\t\t\treturn $this->is_ajax();\n\n\t\t\tcase 'installing_wp':\n\t\t\t\treturn $this->is_installing_wp();\n\n\t\t\tcase 'rest':\n\t\t\t\treturn $this->is_rest();\n\n\t\t\tcase 'cron':\n\t\t\t\treturn $this->is_cron();\n\n\t\t\tcase 'frontend':\n\t\t\t\treturn $this->is_frontend();\n\n\t\t\tcase 'cli':\n\t\t\t\treturn $this->is_cli();\n\n\t\t\tcase 'amp':\n\t\t\t\treturn $this->is_amp();\n\n\t\t\tdefault:\n\t\t\t\t_doing_it_wrong( __METHOD__, esc_html( sprintf( 'Unknown request type: %s', $type ) ), '1.0.0' );\n\n\t\t\t\treturn false;\n\t\t}\n\t}", "protected function __get_is_xhr()\n\t{\n\t\treturn !empty($this->env['HTTP_X_REQUESTED_WITH']) && preg_match('/XMLHttpRequest/', $this->env['HTTP_X_REQUESTED_WITH']);\n\t}", "public static function isGet() {\n\n if (empty(self::$_requestType))\n self::_initRequestType();\n\n return (self::$_requestType == 'GET');\n }" ]
[ "0.8129987", "0.8120368", "0.8093243", "0.7915585", "0.7902211", "0.78757536", "0.78375", "0.77246094", "0.76874", "0.7677085", "0.7469925", "0.743065", "0.7429612", "0.72422785", "0.7165114", "0.7027684", "0.69252205", "0.68939775", "0.6857359", "0.6857359", "0.6782393", "0.67807674", "0.66732377", "0.66647875", "0.66385895", "0.65730935", "0.65247476", "0.651899", "0.65117127", "0.6500154", "0.6485275", "0.64467573", "0.6426863", "0.6385245", "0.63832515", "0.6350225", "0.6337103", "0.63326603", "0.6278525", "0.6273808", "0.62343836", "0.6202491", "0.61942375", "0.61772704", "0.61772704", "0.6170828", "0.6167015", "0.6158575", "0.6151465", "0.6125341", "0.6113704", "0.6104747", "0.60642713", "0.6053609", "0.6050622", "0.60489285", "0.6042501", "0.6036812", "0.6036812", "0.6036812", "0.6036812", "0.6016093", "0.6010242", "0.6010242", "0.5990337", "0.59834826", "0.5982708", "0.5981799", "0.59776855", "0.59686685", "0.5957641", "0.5953415", "0.59381425", "0.5926843", "0.59183466", "0.590258", "0.58983755", "0.58968204", "0.5894981", "0.5889248", "0.5883398", "0.5882357", "0.5878096", "0.58751225", "0.587193", "0.58605176", "0.58605176", "0.58541167", "0.58402497", "0.5838116", "0.5825158", "0.5823168", "0.582041", "0.58105445", "0.5808556", "0.5806056", "0.57994115", "0.5772419", "0.57668513", "0.5765858" ]
0.7839019
6
Generate an shop_asset path for the application.
function shop_asset($path, $secure = null) { $path = 'vendor/sunrise/laravel-wap-shop/' . $path; return app('url')->asset($path, $secure); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAssetsPath() {\n return Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'assets');\n }", "public function functional_asset_path() {\n\n\t\t$log_path = WP_CONTENT_DIR . '/uploads/nginx-helper/';\n\n\t\treturn apply_filters( 'nginx_asset_path', $log_path );\n\n\t}", "public static function assetsPath()\n {\n return asset(config('onion_engine.options.public_assets_path')).'/';\n }", "public function getAssetPath()\n {\n return WEB_PUBLIC_THEME . '/' . $this->directory;\n }", "function asset_url() {\n return url(\"/\");\n }", "public static function get_asset_path(): string {\n\t\treturn plugin_dir_url( dirname( __DIR__ ) );\n\t}", "public function assetPath($asset) {\n\t\treturn self::$config['APP_ROOT'] . self::$config['ASSETS_DIR'] . $asset;\n\t}", "protected function getPathToModuleWebAssets(): string\n {\n return $this->requestStack->getCurrentRequest()->getBasePath() . '/modules/zikulacontent/';\n }", "public static function apps_asset($path = Null)\n\t{\n\t\t$curr_apps\t= apps::getCurrent(\"current_apps\");\n\t\treturn self::getProtocol().self::asset().\"/$curr_apps\".($path?\"/\".$path:\"\");\n\t}", "public function getFullPath()\n {\n $assetstore = $this->get('assetstore');\n\n return $assetstore->getPath().'/'.$this->getPath();\n }", "protected function assetPath() {\n if (isset($this->config['assetPath']))\n {\n return $this->config['assetPath'];\n }\n return realpath('./assets');\n }", "function asset($name) {\n $url;\n\n if (config('mode') === 'development') {\n $url = config('asset_url') . $name;\n } else {\n $url = config('app_url') . $name;\n }\n\n return $url;\n}", "public function getAssetsPath()\n\t{\n\t\treturn dirname(__FILE__) . '/assets';\n\t}", "protected function _generateFilePath() {\n\t\treturn self::normalPaths(\n\t\t\tMage::getBaseDir(),\n\t\t\tMage::helper('pepperjam_network/config', $this->getStore())->getExportFilePath(),\n\t\t\t$this->_getFileName()\n\t\t);\n\t}", "function get_assets_path() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH . '/assets/';\n }", "function _asset($path, $secure = null)\n {\n if (! app()->environment('production')) {\n if (app()->environment('development')) {\n $path = 'assets/'.$path;\n }\n\n return asset($path, $secure);\n }\n\n return implode('/', [\n config('infoexam.static_url'),\n 'assets',\n json_decode(File::get(base_path('composer.json'), true), true)['version'],\n $path,\n ]);\n }", "public function assetURL($asset) {\n\t\treturn self::$config['APP_DIR'] . self::$config['ASSETS_DIR'] . $asset;\n\t}", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "public function assetPath($path = '')\n\t{\n\t\treturn $this['path.asset'].ltrim($path, '/');\n\t}", "protected function assetUrl() {\n if (isset($this->config['assetUrl']))\n {\n return $this->config['assetUrl'];\n }\n\n return '/assets';\n }", "function asset_path($filename, $dir)\n{\n\n $site = base_url();\n $mode = \"\";\n\n /*\n * cache invalidation removed for js css libraries\n */\n\n if (is_null($dir)) {\n $final_url = $mode . $filename;\n return $final_url;\n }\n\n if (ENVIRONMENT == 'development') {\n $mode = 'dist/' . $dir . '/';\n return $mode . $filename;\n } else if (ENVIRONMENT == 'production') {\n $mode = 'public/' . $dir . '/';\n }\n\n $final_url = $mode . $filename . '?v='.getUIVersion();\n\n return $final_url;\n\n}", "public function getAssetsUrl()\n\t{\n\t\treturn Yii::app()->getAssetManager()->publish($this->getAssetsPath());\n\t}", "public function to_asset($url = '')\n\t{\n\t\treturn $this->relative_url.'/'.$this->name.'/'.$url;\n\t}", "public function getWebappPath();", "public function getShopUri()\n {\n return sprintf(self::SHOP_URI, $this->getShopName());\n }", "function admin_asset(string $path = ''): string\n {\n return Admin::app()->asset($path);\n }", "public function getAssetFolder()\n {\n return $this->config()->asset_folder;\n }", "public function getAssetFolder()\n {\n return $this->config()->asset_folder;\n }", "function _asset_url(string $path = '') {\n\t\treturn asset(config('asset.directory')) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "function smarty_modifier_toAssetPath($string) {\n\n if (strpos($string, \"::\") !== false) {\n $parts = explode(\"::\", $string);\n $src = ModulesContext::instance()->getConfig()->get(\"businessRoot\", \"src\");\n $base = trim(str_replace(\"::\", \"/\", $src), \"/\");\n $result = \"$base/$parts[0]/assets/$parts[1]\";\n } else {\n $result = \"assets/$result\";\n }\n\n $resultingPath = Loader::toSinglePath($result, \".tpl\");\n\n return $resultingPath;\n}", "public static function dashboardAssetsPath()\n {\n return asset(config('onion_engine.options.public_assets_path').'dashboard/assets').'/';\n }", "protected function getComponentsPath(): string\n {\n return resource_path('js/Components');\n }", "function asset($path = '')\n {\n \treturn (!empty($path)) ? BASE_URL . $path : BASE_URL ; \n }", "public static function get_skin_assets_path() {\n if( self::is_skin_active() ) {\n return get_template_directory_uri() . '/skins/' . self::$skin_name . '/assets';\n } else {\n return get_template_directory_uri() . '/assets/';\n }\n }", "public function getAssetsUrl()\n\t{\n\t\tif ($this->_assetsUrl === null) {\n\t\t\t$assetsPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'assets';\n\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\tif ($this->debug===true) {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath, false, -1, true);\n\t\t\t} else {\n\t\t\t\t$this->_assetsUrl = app()->getAssetManager()->publish($assetsPath);\n\t\t\t}\n\t\t}\n\t\treturn $this->_assetsUrl;\n\t}", "protected function getImagePath()\n {\n return Yii::getAlias('@data/image.jpg');\n }", "public function path()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'app';\n }", "public function asset(): string\n {\n if (is_null($this->rootPath)) {\n\n $partials = explode('/', $this->fullPath);\n\n return array_pop($partials);\n\n }\n\n return substr($this->fullPath, strlen(rtrim($this->rootPath, '/')) + 1);\n }", "public function getImagePathAttribute()\n {\n return asset('public/uploads/supply_images/'.$this->image);\n }", "public function functional_asset_url() {\n\n\t\t$log_url = WP_CONTENT_URL . '/uploads/nginx-helper/';\n\n\t\treturn apply_filters( 'nginx_asset_url', $log_url );\n\n\t}", "public function path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}", "public static function iconPath()\n {\n return Craft::getAlias(\"@julianmjones/schedapiintegration/assetbundles/schedapiintegrationutilityutility/dist/img/SchedApiIntegrationUtility-icon.svg\");\n }", "protected function getPath()\n {\n\n $module = $this->option('module');\n if (is_null($module))\n {\n return $this->option('path') . '/' . ucwords($this->argument('name')) . '.php'; \n }\n else\n {\n $this->generator->getCache()->moduleName($module);\n $aux = '{Modulename}/Models/';\n $aux = str_replace('{Modulename}',ucwords($module),$aux); \n return $this->getModuleTargetPath() . $aux . ucwords($this->argument('name')) . '.php'; \n }\n\t\n\t}", "static function asset_path($source)\n {\n if ($source) {\n $decoded_source = json_decode($source);\n if ($url = $decoded_source->url) {\n // if $url then the file is stored on the cloud \n return $url;\n } else {\n // else it is on the local storage ( generating the URL dynamically in this case so if the\n // the admin changes his Domain or base URL the assets will still work)\n $replace = preg_replace('/.*\\/storage/', '', $decoded_source->path);\n $url = asset('/storage' . $replace);\n return $url;\n }\n }\n }", "protected function getGeneratorConfigPath(): string\n {\n if (null === $this->genConfigPath) {\n\n /**\n * @var $container LightServiceContainerInterface\n */\n $container = $this->getContextVar(\"container\");\n $appDir = $container->getApplicationDir();\n $planet = $this->getContextVar(\"planet\");\n $galaxy = $this->getContextVar(\"galaxy\");\n $planetDir = $this->getContextVar(\"planetDir\");\n $createFile = $this->getContextVar(\"createFile\");\n $tablePrefix = DeveloperWizardGenericHelper::getTablePrefix($planetDir, $createFile);\n $this->genConfigPath = $appDir . \"/config/data/$galaxy.$planet/Ling.Light_BreezeGenerator/$tablePrefix.generated.byml\";\n }\n return $this->genConfigPath;\n }", "public static function assets(){\n return self::adapterURI().\"assets/\";\n }", "public function assets_url() {\n\t\t\treturn get_template_directory_uri() . '/assets/';\n\t\t}", "function asset($name = null)\n {\n $document = explode('/', rtrim(app('http.request')->uri, \"/\"));\n $document = end($document);\n\n $defaultPath = $document === 'public' ? 'assets/' : 'public/assets/';\n\n $packpage = new \\Anonym\\Assets\\VersionPackpage('', '%f', $defaultPath);\n return $name !== null ? $packpage->getUrl($name) : $defaultPath;\n }", "public function __invoke( $asset ) {\n\t\treturn \"/assets/$asset\";\n\t}", "public function getUpgradesPath()\n {\n return Mage::getBaseDir('code')\n . DS\n . $this->_getData('codePool')\n . DS\n . uc_words($this->getId(), DS)\n . DS\n . 'upgrades';\n }", "public function getPathAssets($append = ''){\n\t\treturn $this->paths['assets'].$append;\n\t}", "public function path()\n {\n if (in_array($this->object->extension(), ['html', 'twig', 'md'])) {\n return $this->object->getViewPath();\n } else {\n return $this->object->getAssetPath();\n }\n }", "protected function generateUploadDir()\n\t{\n\t\treturn self::EXPORT_PATH;\n\t}", "public static function assetPath(string $asset): string\n {\n // ---------- WIP -----------\n // dddx(get_class_methods(app()));\n // dddx(Storage::disk('notify'));\n // dddx(Module::assetPath('notify')); ///var/www/html/ptvx/public_html/modules/notify\n // $module=Module::find('notify');\n // dddx([get_class_methods($module),$module->getPath()]);\n [$ns,$file] = explode('::', $asset);\n $module_path = Module::getModulePath($ns).'Resources';\n $path = $module_path.'/'.$file;\n\n return $path;\n }", "public static function asset($asset = '') {\n\t\tif (!empty($asset)) {\n\t\t\treturn CoreLoader::themeRootURL() . 'trueadmin/' . $asset;\n\t\t}\n\t\treturn CoreLoader::themeRootURL() . 'trueadmin';\n\t}", "public function getPath(): string\n {\n return asset('storage/upload/'.$this->path);\n }", "public static function get_asset_dir() {\n\n\t\tglobal $_llms_tests_bootstrap;\n\t\treturn $_llms_tests_bootstrap->assets_dir;\n\n\t}", "public function assetsDir(): string\n {\n return $this->root.'/www';\n }", "public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }", "public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }", "function asset($path) {\n echo getAbsolutePath() . \"public/$path\";\n}", "public static function getAplicationPath() {\n return self::$imagesAplicationPath;\n\n }", "public static function asset(string $path): string\n {\n /*\n to DOOOO\n viewNamespaceToPath => /images/prova.png\n viewNamespaceToDir => c:\\var\\wwww\\test\\images\\prova.png\n viewNamespaceToAsset => http://example.com/images/prova.png\n */\n // dddx(\\Module::asset('blog:img/logo.img')); //localhost/modules/blog/img/logo.img\n\n if (Str::startsWith($path, 'https://')) {\n return $path;\n }\n if (Str::startsWith($path, 'http://')) {\n return $path;\n }\n\n if (File::exists(public_path($path))) {\n return $path;\n }\n\n if (Str::startsWith($path, '/theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, '/theme/pub');\n }\n\n if (Str::startsWith($path, 'theme/pub')) {\n $path = 'pub_theme::'.Str::after($path, 'theme/pub');\n }\n\n $ns = Str::before($path, '::');\n $ns_after = Str::after($path, '::');\n if ($ns === $path) {\n $ns = inAdmin() ? 'adm_theme' : 'pub_theme';\n }\n\n $ns_after0 = Str::before($ns_after, '/');\n $ns_after1 = Str::after($ns_after, '/');\n $ns_after = str_replace('.', '/', $ns_after0).'/'.$ns_after1;\n\n if (Str::startsWith($ns_after, '/')) {\n $ns_after = Str::after($ns_after, '/');\n }\n if (\\in_array($ns, ['pub_theme', 'adm_theme'], true)) {\n $theme = config('xra.'.$ns);\n\n $filename_from = self::fixPath(base_path('Themes/'.$theme.'/Resources/'.$ns_after));\n // $filename_from = Str::replace('/Resources//', '/Resources/', $filename_from);\n $asset = 'themes/'.$theme.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n\n if (! File::exists($filename_to)) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n try {\n File::copy($filename_from, $filename_to);\n } catch (\\Exception $e) {\n throw new \\Exception('message:['.$e->getMessage().']\n path :['.$path.']\n file from ['.$filename_from.']\n file to ['.$filename_to.']');\n }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n }\n\n $module_path = Module::getModulePath($ns);\n if (Str::endsWith($module_path, '/')) {\n $module_path = Str::beforeLast($module_path, '/');\n }\n $filename_from = self::fixPath($module_path.'/Resources/'.$ns_after);\n $asset = 'assets/'.$ns.'/'.$ns_after;\n $filename_to = self::fixPath(public_path($asset));\n $asset = Str::replace(url(''), '', asset($asset));\n if (! File::exists($filename_from)) {\n throw new \\Exception('file ['.$filename_from.'] not Exists , path ['.$path.']');\n }\n\n // dddx(app()->environment());// local\n if (! File::exists($filename_to) || 'production' !== app()->environment()) {\n if (! File::exists(\\dirname($filename_to))) {\n File::makeDirectory(\\dirname($filename_to), 0755, true, true);\n }\n // 105 If condition is always true.\n // if (File::exists($filename_from)) {\n File::copy($filename_from, $filename_to);\n // }\n }\n Assert::string($asset, 'wip');\n\n return $asset;\n\n // return asset(self::viewNamespaceToAsset($path));\n }", "public function getBaseAssetsDir()\n {\n return $this->paths->getBaseAssetsDir();\n }", "public function getAsset()\r\n\t{\r\n\t\treturn Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);\r\n\t}", "public function getResourcesPath()\n {\n return $this->createPath($this->sourcePath, 'Asar', 'Resources');\n }", "public function path()\n {\n return \"/books/{$this->slug}\";\n }", "function get_static_image_path($file = NULL)\n {\n return get_static_asset($file, 'images/'); \n }", "public function assetUrl(string $filename): string\n {\n if (file_exists($hotFile = __DIR__ . '/../build/hot')) {\n // @codeCoverageIgnoreStart\n return trim(file_get_contents($hotFile)) . $filename;\n // @codeCoverageIgnoreEnd\n }\n\n if (file_exists($manifestFile = __DIR__ . '/../build/mix-manifest.json')) {\n $manifest = json_decode(file_get_contents($manifestFile), true);\n // Need to add then remove the leading \"/\"\n if (isset($manifest[\"/$filename\"])) {\n $filename = substr($manifest[\"/$filename\"], 1);\n }\n }\n\n return route('migrations-ui.asset', $filename);\n }", "public function getWebPath()\n {\n// ... $webPath being the full image URL, to be used in templates\n\n return $webPath;\n }", "public function getPath()\n {\n $controller = str_replace('\\\\', '/', $this->get('controller'));\n\n $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('engine');\n\n return empty($this->parameters['bundle']) ? $path : '@' . $this->get('bundle') . '/resource/view/' . $path;\n }", "protected function getAssetsUrl()\n {\n if (!isset($this->_assetsUrl)) {\n //$assetPath = Yii::getPathOfAlias($this->assetPathAlias);\n //if (!$assetPath) {\n // throw new CException(\"Asset path alias $this->assetPathAlias could not be resolved\");\n //}\n $assetPath = $this->assetPath;\n $this->_assetsUrl = Yii::app()->assetManager->publish($assetPath, false, -1, $this->forceCopyAssets);\n }\n return $this->_assetsUrl;\n }", "public function getFullPath()\n {\n return sfAssetsLibraryTools::getMediaDir(true) . $this->getRelativePath();\n }", "public function getPath(){\n\t\treturn \\GO::view()->getPath().'themes/'.$this->getName().'/';\n\t}", "function asset($url = '')\n{\n return ASSET . $url;\n}", "function asset_url( ?string $path = null ): string\n {\n return Asset::url( '/', $path );\n }", "public function getAssetBasePath()\n {\n return $this->assetBasePath;\n }", "private function assetPublisher() {\n $assetOrigin = $this->getDir().$this->getPathConfig().'/assets';\n if ($this->fs->exists($assetOrigin)) {\n $assetDest = $this->getPublicPath($this->getPathConfig());\n $this->fs->copyDirectory($assetOrigin,$assetDest);\n }\n }", "public function getInvoiceUri() {\n return Yii::app()->s3->assetsPath . Yii::app()->s3->s3_billing_invoices_path . '/';\n }", "protected function viewsPath()\n {\n return base_path('nova-components/views/' . $this->resourceName());\n }", "protected function getBasePath()\n {\n // Note that the actual filesystem base is the 'assets' subdirectory within this\n return ASSETS_PATH . '/SecureAssetsMigrationHelperTest';\n }", "public function getName()\n {\n return 'assets';\n }", "public function getName()\n {\n return 'assets';\n }", "function vcex_asset_dir_path( $part = '' ) {\n\treturn TTC_PLUGIN_DIR_PATH . 'inc/vcex/assets/' . $part;\n}", "public function getPath()\n {\n return 'bundles/jobhub/'.$this->getUploadDir().'/'.$this->path;\n }", "public function getCode()\n {\n return 'resource_to_asset';\n }", "public function getCalculatePath()\n {\n return '\\\\App'.$this->getExtensions().$this->getModules().'\\\\Controllers\\\\'.$this->getController();\n }", "public function packagePath()\n {\n return $this->vendorPath().'/'.$this->package();\n }", "function assets_path($path = '')\n {\n return phanda()->assetsPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "function asset( $path ) {\n\n\t\tif ( ! $this->mix ) {\n\t\t\t$file = $this->path( 'public/mix-manifest.json' );\n\t\t\t$this->mix = (array) json_decode( file_get_contents( $file ), true );\n\t\t}\n\n\t\t// Make sure to trim any slashes from the front of the path.\n\t\t$path = '/' . ltrim( $path, '/' );\n\n\t\tif ( $this->mix && isset( $this->mix[ $path ] ) ) {\n\t\t\t$path = $this->mix[ $path ];\n\t\t}\n\n\t\treturn $this->uri( 'public' . $path );\n\t}", "public function getPhotoUrlAttribute()\n {\n return asset(env('FRONTEND_IMAGES_PATH') . $this->image);\n }", "function _asset($path, $secure = null)\n {\n\n if(env('APP_ASSETS') == 'local'){\n return app('url')->asset($path, $secure);\n } else {\n return app('url')->asset(\"public/\".$path, $secure);\n }\n }", "protected function getTestAssetPath($name)\n {\n return __DIR__ . '/TestAssets/Json/' . $name . '.json';\n }", "public function asset($asset = null)\n\t{\n\t\treturn rtrim($this->assetUrl,\"/\").($asset ? \"/\". trim($asset, '/') : '');\n\t}", "function asset_url(){\n return base_url().'assets/';\n}", "public function assetUrl($url = '')\n\t{\n\t\treturn $this['url.asset'].ltrim($url, '/');\n\t}", "function asset_base_path(string $path = '') {\n\t\t$path = trim($path, DIRECTORY_SEPARATOR);\n\t\treturn dirname(__DIR__) . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n\t}", "public function getBasePathAttribute() {\n return public_path('images/uploads/'.$this->id.'/');\n }", "protected function destinationDir(): string\n {\n return $this->container->get('config')->get('app', 'app_dir') . '/app/' . $this->namespacePath();\n }", "public function appPath()\n {\n return ltrim($this->basePath().'/app', '/');\n }" ]
[ "0.6387205", "0.6351781", "0.62962955", "0.6202298", "0.61916107", "0.6093497", "0.6089069", "0.60499847", "0.60439104", "0.59171784", "0.5914478", "0.58822405", "0.582918", "0.5805029", "0.5778988", "0.5775473", "0.5736072", "0.5722596", "0.5720527", "0.5709238", "0.57004327", "0.56939167", "0.56784755", "0.56730694", "0.5670862", "0.5636211", "0.563313", "0.563313", "0.56250906", "0.5619045", "0.5614985", "0.5601985", "0.56017995", "0.5588894", "0.558801", "0.55856663", "0.55461884", "0.5540746", "0.55325484", "0.5528987", "0.55244255", "0.5521274", "0.55147", "0.55114675", "0.551128", "0.55033094", "0.5466586", "0.5457521", "0.54569197", "0.54565275", "0.54472107", "0.5446734", "0.5435701", "0.5412657", "0.5412257", "0.5408355", "0.54041576", "0.53975266", "0.5379838", "0.5379838", "0.5376908", "0.5349823", "0.53482753", "0.5341446", "0.5338642", "0.5330372", "0.5329384", "0.53288287", "0.5324574", "0.5319277", "0.5301992", "0.52969897", "0.5288794", "0.5286246", "0.5280463", "0.5278188", "0.52774704", "0.52727526", "0.5263795", "0.5260715", "0.52565396", "0.525427", "0.525427", "0.5251136", "0.52462167", "0.5237059", "0.5228686", "0.5224795", "0.52232754", "0.5218246", "0.5218148", "0.5214466", "0.5207795", "0.51984215", "0.5197833", "0.51976746", "0.5192879", "0.51917225", "0.51890624", "0.51827407" ]
0.6779088
0
is a simple checksum formula used to validate a variety of identification numbers
private function verifyByLuhnAlgorithm($number){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calculateChecksum() {}", "public function calculateChecksum() {}", "function ean_checksum2($ean){\n $ean=(string)$ean;\n $even=true; $esum=0; $osum=0;\n for ($i=strlen($ean)-1;$i>=0;$i--){\n\tif ($even) $esum+=$ean[$i];\telse $osum+=$ean[$i];\n\t$even=!$even;\n }\n \n return (10-((3*$esum+$osum)%10))%10;\n}", "function checksum_validate($number)\n{\n $original = substr($number, 0, strlen($number) - 1);\n return checksum_generate($original) === $number;\n}", "abstract public function checksum($barcode);", "public function getChecksum();", "public function isValidChecksum()\n\t{\n\t\t$length = strlen($this->number);\n\t\t$value = $this->ccNumber;\n\t\t$sum = 0;\n $weight = 2;\n\n for ($i = $length - 2; $i >= 0; $i--) {\n $digit = $weight * $value[$i];\n $sum += floor($digit / 10) + $digit % 10;\n $weight = $weight % 2 + 1;\n }\n\n if ((10 - $sum % 10) % 10 != $value[$length - 1]) {\n return false;\n }\n\n return true;\n\t}", "protected function validateChecksum() {\n\t}", "function calc_checksum($cmd,$data){\n $xor_value = 0;\n $xor_value = $xor_value ^ $cmd;\n foreach($data as $byte) {\n $xor_value = $xor_value ^ $byte;\n }\n /*\n If value is less than 0x20 then add 0x20\n Eg If xor of CMD and DATA results in 0x0A then CHECKSUM = 0x2A\n */\n if ($xor_value < CHECKSUM_OFFSET) {\n $xor_value = $xor_value + CHECKSUM_OFFSET;\n }\n return $xor_value;\n}", "function sri_checksum($input)\n{\n $algorithm = settings::algorithm();\n $hash = hash($algorithm, $input, true);\n $hash_base64 = base64_encode($hash);\n\n return \"$algorithm-$hash_base64\";\n}", "private function getChecksum(): int\n {\n $this->generateChecksum(true);\n return ((($this->base) - ($this->luhnValue % $this->base)) % $this->base);\n }", "function calc_checksum2($cmd1,$cmd2,$bytes){\n $xor_value = 0;\n $xor_value = $xor_value ^ $cmd1;\n $xor_value = $xor_value ^ $cmd2;\n foreach($bytes as $byte) {\n $xor_value = $xor_value ^ $byte;\n }\n /*\n If value is less than 0x20 then add 0x20\n Eg If xor of CMD and DATA results in 0x0A then CHECKSUM = 0x2A\n */\n if ($xor_value < CHECKSUM_OFFSET) {\n $xor_value = $xor_value + CHECKSUM_OFFSET;\n }\n return $xor_value;\n}", "function checksum_generate($number)\n{\n $stack = 0;\n $digits = str_split(strrev($number), 1);\n foreach ($digits as $key => $value) {\n if ($key % 2 === 0) {\n $value = array_sum(str_split($value * 2, 1));\n }\n $stack += $value;\n }\n $stack %= 10;\n if ($stack !== 0) {\n $stack -= 10;\n }\n return (int)(implode('', array_reverse($digits)) . abs($stack));\n}", "function calculateChecksum(string $data): string\n{\n $checksum = '';\n while (strlen($checksum) % 2 === 0) {\n $checksum = '';\n $length = strlen($data);\n for ($i = 0; $i < $length - 1; $i += 2) {\n if ($data[$i] === $data[$i + 1]) {\n $checksum .= '1';\n } else {\n $checksum .= '0';\n }\n }\n $data = $checksum;\n }\n return $checksum;\n}", "protected function calculateChecksum() {\r\n // Calculating Checksum\r\n // Consider the right-most digit of the message to be in an \"odd\" position,\r\n // and assign odd/even to each character moving from right to left\r\n // Odd Position = 3, Even Position = 1\r\n // Multiply it by the number\r\n // Add all of that and do 10-(?mod10)\r\n $odd = true;\r\n $this->checksumValue = 0;\r\n $c = strlen($this->text);\r\n for ($i = $c; $i > 0; $i--) {\r\n if ($odd === true) {\r\n $multiplier = 3;\r\n $odd = false;\r\n } else {\r\n $multiplier = 1;\r\n $odd = true;\r\n }\r\n\r\n if (!isset($this->keys[$this->text[$i - 1]])) {\r\n return;\r\n }\r\n\r\n $this->checksumValue += $this->keys[$this->text[$i - 1]] * $multiplier;\r\n }\r\n\r\n $this->checksumValue = (10 - $this->checksumValue % 10) % 10;\r\n }", "public static function calculateTableChecksum($data) {}", "function check_armstrong($number){\r\n$n=$number;\r\n$total_sum=0;\r\nwhile($n!=0){\r\n\t$rem=$n%10;\r\n\t$n=$n/10;\r\n\t$sum=1;\r\n\tfor($i=0; $i<3; $i++){\r\n\t\t$sum*=$rem;\r\n\t}\r\n\t$total_sum+=$sum;\r\n\t$sum=1;\r\n}\r\nif($total_sum==$number){\r\n\techo \"It is an armstrong number\".$total_sum;\r\n}\r\nelse{\r\n\techo \"It is not armstrong number\";\r\n\r\n}\r\n}", "function checksum ($etiquette, $valeur) {\n $sum = 32; // Somme des codes ASCII du message+un espace\n for ($i=0;$i<strlen($etiquette);$i++) {\n $sum = $sum + ord($etiquette[$i]);\n }\n for ($i=0;$i<strlen($valeur);$i++) {\n $sum = $sum + ord($valeur[$i]);\n }\n $sum = ($sum & 63) + 32;\n return (chr($sum));\n }", "function checkVatID_c($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t// LUHN-10 code http://www.ee.unb.ca/tervo/ee4253/luhn.html\n\n\t\t$id = substr($vat_id, 1);\n\t\t$checksum = 0;\n\t\tfor ($i = 9; $i > 0; $i --) {\n\t\t\t$digit = $vat_id {\n\t\t\t\t$i};\n\t\t\tif ($i % 2 == 1)\n\t\t\t\t$digit *= 2;\n\t\t\tif ($digit >= 10) {\n\t\t\t\t$checksum += $digit -10 + 1;\n\t\t\t} else {\n\t\t\t\t$checksum += $digit;\n\t\t\t}\n\t\t}\n\t\tif ($this->modulo($checksum, 10) == 0)\n\t\t\treturn 1;\n\n\t\treturn 0;\n\t} // Canada\n\n\t// belgien\n\tfunction checkVatID_be($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checkvals = (int) substr($vat_id, 2, -2);\n\t\t$checksum = (int) substr($vat_id, -2);\n\n\t\tif (97 - $this->modulo($checkvals, 97) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end belgien\n\n\t// daenemark\n\tfunction checkVatID_dk($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$weights = array (2, 7, 6, 5, 4, 3, 2, 1);\n\t\t$checksum = 0;\n\n\t\tfor ($i = 0; $i < 8; $i ++)\n\t\t\t$checksum += (int) $vat_id[$i +2] * $weights[$i];\n\t\tif ($this->modulo($checksum, 11) > 0)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end daenemark\n\n\t// deutschland\n\tfunction checkVatID_de($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$prod = 10;\n\t\t$checkval = 0;\n\t\t$checksum = (int) substr($vat_id, -1);\n\n\t\tfor ($i = 2; $i < 10; $i ++) {\n\t\t\t$checkval = $this->modulo((int) $vat_id[$i] + $prod, 10);\n\t\t\tif ($checkval == 0)\n\t\t\t\t$checkval = 10;\n\t\t\t$prod = $this->modulo($checkval * 2, 11);\n\t\t} // end for($i = 2; $i < 10; $i++)\n\t\t$prod = $prod == 1 ? 11 : $prod;\n\t\tif (11 - $prod != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end deutschland\n\n\t// estland\n\tfunction checkVatID_ee($vat_id) {\n\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end estland\n\n\t// finnland\n\tfunction checkVatID_fi($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$weights = array (7, 9, 10, 5, 8, 4, 2);\n\t\t$checkval = 0;\n\t\t$checksum = (int) substr($vat_id, -1);\n\n\t\tfor ($i = 0; $i < 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[$i +2] * $weights[$i];\n\n\t\tif (11 - $this->modulo($checkval, 11) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end finnland\n\n\t// frankreich\n\tfunction checkVatID_fr($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id), 4))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end frankreich\n\n\t// griechenland\n\tfunction checkVatID_el($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checksum = substr($vat_id, -1);\n\t\t$checkval = 0;\n\n\t\tfor ($i = 1; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * pow(2, $i);\n\t\t$checkval = $this->modulo($checkval, 11) > 9 ? 0 : $this->modulo($checkval, 11);\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end griechenland\n\n\t// grossbrittanien\n\tfunction checkVatID_gb($vat_id) {\n\t\tif (strlen($vat_id) != 11 && strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end grossbrittanien\n\n\t/********************************************\n\t* irland *\n\t********************************************/\n\t// irland switch\n\tfunction checkVatID_ie($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!checkVatID_ie_new($vat_id) && !checkVatID_ie_old($vat_id))\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end irland switch\n\n\t// irland alte methode\n\tfunction checkVatID_ie_old($vat_id) {\n\t\t// in neue form umwandeln\n\t\t$transform = array (substr($vat_id, 0, 2), '0', substr($vat_id, 4, 5), $vat_id[2], $vat_id[9]);\n\t\t$vat_id = join('', $transform);\n\n\t\t// nach neuer form pruefen\n\t\treturn checkVatID_ie_new($vat_id);\n\t} // end irland alte methode\n\n\t// irland neue methode\n\tfunction checkVatID_ie_new($vat_id) {\n\t\t$checksum = strtoupper(substr($vat_id, -1));\n\t\t$checkval = 0;\n\t\t$checkchar = 'A';\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 23);\n\t\tif ($checkval == 0) {\n\t\t\t$checkchar = 'W';\n\t\t} else {\n\t\t\tfor ($i = $checkval -1; $i > 0; $i --)\n\t\t\t\t$checkchar ++;\n\t\t}\n\t\tif ($checkchar != $checksum)\n\t\t\treturn false;\n\n\t\treturn true;\n\t} // end irland neue methode\n\t/* end irland\n\t********************************************/\n\n\t// italien\n\tfunction checkVatID_it($vat_id) {\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end italien\n\n\t// lettland\n\tfunction checkVatID_lv($vat_id) {\n\n\t\tif (strlen($vat_id) != 13)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end lettland\n\n\t// litauen\n\tfunction checkVatID_lt($vat_id) {\n\n\t\tif ((strlen($vat_id) != 13) || (strlen($vat_id) != 11))\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end litauen\n\n\t// luxemburg\n\tfunction checkVatID_lu($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) substr($vat_id, -2);\n\t\t$checkval = (int) substr($vat_id, 2, 6);\n\t\tif ($this->modulo($checkval, 89) != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // luxemburg\n\n\t// malta\n\tfunction checkVatID_mt($vat_id) {\n\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end malta\n\n\t// niederlande\n\tfunction checkVatID_nl($vat_id) {\n\t\tif (strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif (strtoupper($vat_id[11]) != 'B')\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[12] == 0 || (int) $vat_id[13] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 9; $i ++)\n\t\t\t$checkval += (int) $vat_id[11 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) > 9 ? 0 : $this->modulo($checkval, 11);\n\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end niederlande\n\n\t// oesterreich\n\tfunction checkVatID_at($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\t\tif (strtoupper($vat_id[2]) != 'U')\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 3; $i < 10; $i ++)\n\t\t\t$checkval += $this->cross_summa((int) $vat_id[$i] * ($this->is_even($i) ? 2 : 1));\n\t\t$checkval = substr((string) (96 - $checkval), -1);\n\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end oesterreich\n\n\t// polen\n\tfunction checkVatID_pl($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\n\t\t$weights = array (6, 5, 7, 2, 3, 4, 5, 6, 7);\n\t\t$checksum = (int) $vat_id[11];\n\t\t$checkval = 0;\n\t\tfor ($i = 0; $i < count($weights); $i ++)\n\t\t\t$checkval += (int) $vat_id[$i +2] * $weights[$i];\n\t\t$checkval = $this->modulo($checkval, 11);\n\n\t\tif ($checkval != $checksum)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end polen\n\n\t// portugal\n\tfunction checkVatID_pt($vat_id) {\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[10];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i < 10; $i ++) {\n\t\t\t$checkval += (int) $vat_id[11 - $i] * $i;\n\t\t}\n\t\t$checkval = (11 - $this->modulo($checkval, 11)) > 9 ? 0 : (11 - $this->modulo($checkval, 11));\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end portugal\n\n\t// schweden\n\tfunction checkVatID_se($vat_id) {\n\t\tif (strlen($vat_id) != 14)\n\t\t\treturn 0;\n\t\tif ((int) substr($vat_id, -2) < 1 || (int) substr($vat_id, -2) > 94)\n\t\t\treturn 0;\n\t\t$checksum = (int) $vat_id[11];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 0; $i < 10; $i ++)\n\t\t\t$checkval += $this->cross_summa((int) $vat_id[10 - $i] * ($this->is_even($i) ? 2 : 1));\n\t\tif ($checksum != ($this->modulo($checkval, 10) == 0 ? 0 : 10 - $this->modulo($checkval, 10)))\n\t\t\treturn 0;\n\n\t\t$checkval = 0;\n\t\tfor ($i = 0; $i < 13; $i ++)\n\t\t\t$checkval += (int) $vat_id[13 - $i] * ($this->is_even($i) ? 2 : 1);\n\t\tif ($this->modulo($checkval, 10) > 0)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end schweden\n\n\t// slowakische republik\n\tfunction checkVatID_sk($vat_id) {\n\t\tif (strlen($vat_id) != 12)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\n\t} // end slowakische republik\n\n\t// slowenien\n\tfunction checkVatID_si($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[2] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[9];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) == 10 ? 0 : 11 - $this->modulo($checkval, 11);\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t} // end slowenien\n\n\t// spanien\n\tfunction checkVatID_es($vat_id) {\n\t\t// Trim country info\n\t\t$vat_id = substr($vat_id, 2);\n\n\t\t// Is it a naturalized foreigner?\n\t\tif (strtoupper($vat_id[0]) == 'X')\n\t\t\t$vat_id = substr($vat_id, 1); // Truncated $vat_id is validated as a regular one\n\n\t\t// Length check \n\t\tif (strlen($vat_id) > 9) // $vat_id at this point should be 9 chars at most\n\n\n\n\t\t\treturn 0;\n\n\t\t// Is it a company?\n\t\tif (!is_numeric($vat_id[0])) {\n\t\t\t$allowed = array ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H');\n\t\t\t$checkval = false;\n\n\t\t\tfor ($i = 0; $i < count($allowed); $i ++) {\n\t\t\t\tif (strtoupper($vat_id[0]) == $allowed[$i])\n\t\t\t\t\t$checkval = true;\n\t\t\t} // end for($i=0; $i<count($allowed); $i++)\n\t\t\tif (!$checkval)\n\t\t\t\treturn 9; // Few more letters are allowed, but not likely to happen\n\n\t\t\t$vat_len1 = strlen($vat_id) - 1;\n\n\t\t\t$checksum = (int) $vat_id[$vat_len1];\n\t\t\t$checkval = 0;\n\n\t\t\tfor ($i = 1; $i < $vat_len1; $i ++)\n\t\t\t\t$checkval += $this->cross_summa((int) $vat_id[$i] * ($this->is_even($i) ? 1 : 2));\n\n\t\t\tif ($checksum != 10 - $this->modulo($checkval, 10))\n\t\t\t\treturn 0;\n\n\t\t\treturn 1;\n\t\t} // end Is it a company?\n\n\t\t// Is it an Individual? (or naturalized foreigner)\n\t\tif (!is_numeric($vat_id[strlen($vat_id) - 1])) {\n\t\t\t$allowed1 = \"TRWAGMYFPDXBNJZSQVHLCKE\";\n\n\t\t\t$vat_len1 = strlen($vat_id) - 1;\n\n\t\t\t$checksum = strtoupper($vat_id[$vat_len1]);\n\t\t\t$checkval = $this->modulo((int) substr($vat_id, 0, $vat_len1), 23);\n\n\t\t\tif ($checksum != $allowed1[$checkval])\n\t\t\t\treturn 0;\n\n\t\t\t$this->vat_mod = array ('status' => $allowed1[$checkval]);\n\n\t\t\treturn 1;\n\t\t} // end Is it an Individual?\n\n\t\treturn 0; // No match found\n\t} // end spanien\n\n\t// tschechien\n\tfunction checkVatID_cz($vat_id) {\n\n\t\tif ((strlen($vat_id) != 10) || (strlen($vat_id) != 11) || (strlen($vat_id) != 12))\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end tschechien\n\n\t// ungarn\n\tfunction checkVatID_hu($vat_id) {\n\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif (!is_numeric(substr($vat_id, 2)))\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end ungarn\n\n\t// zypern\n\tfunction checkVatID_cy($vat_id) {\n\n\t\tif (strlen($vat_id) != 11)\n\t\t\treturn 0;\n\n\t\tif ($this->live_check = true) {\n\n\t\t\treturn $this->live($vat_id);\n\n\t\t} else {\n\t\t\treturn 9; // es gibt keinen algorithmus\n\t\t}\n\t} // end zypern\n\n\t/*******************************************************************/\n\n\t/********************************************************************\n\t* mathematische Hilfsfunktionen *\n\t********************************************************************/\n\t// modulo berechnet den rest einer division von $val durch $param\n\tfunction modulo($val, $param) {\n\t\treturn $val - (floor($val / $param) * $param);\n\t} // end function modulo($val, $param)\n\n\t// stellt fest, ob eine zahl gerade ist\n\tfunction is_even($val) {\n\t\treturn ($val / 2 == floor($val / 2)) ? true : false;\n\t} // end function is_even($val)\n\n\t// errechnet die quersumme von $val\n\tfunction cross_summa($val) {\n\t\t$val = (string) $val;\n\t\t$sum = 0;\n\t\tfor ($i = 0; $i < strlen($val); $i ++)\n\t\t\t$sum += (int) $val[$i];\n\t\treturn $sum;\n\t} // end function cross_summa((string) $val)\n\t/*******************************************************************/\n\n\t/********************************************************************\n\t* Live Check *\n\t********************************************************************/\n\t// Live Check überprüft die USTid beim Bundesamt für Finanzen\n\tfunction live($abfrage_nummer) {\n\n\t\t$eigene_nummer = STORE_OWNER_VAT_ID;\n\n\t\t/* Hier wird der String für den POST per URL aufgebaut */\n\t\t$ustid_post = \"eigene_id=\".$eigene_nummer.\"&abfrage_id=\".$abfrage_nummer.\"\";\n\n\t\t/* Zur Verbindung mit dem Server wird CURL verwendet */\n\t\t/* mit curl_init wird zunächst die URL festgelegt */\n\n\t\t$ch = curl_init(\"http://wddx.bff-online.de//ustid.php?\".$ustid_post.\"\");\n\n\t\t/* Hier werden noch einige Parameter für CURL gesetzt */\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0); /* Header nicht in die Ausgabe */\n\t\tcurl_setopt($ch, CURLOPT_NOBODY, 0); /* Ausgabe nicht in die HTML-Seite */\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); /* Umleitung der Ausgabe in eine Variable ermöglichen */\n\n\t\t/* Aufruf von CURL und Ausgabe mit WDDX deserialisieren */\n\n\t\t$des_out = wddx_deserialize(curl_exec($ch));\n\t\tcurl_close($ch);\n\n\t\t/* Die deserialisierte Ausgabe in ein Array schreiben */\n\n\t\twhile (list ($key, $val) = each($des_out)) {\n\t\t\t$ergebnis[$key] = $val;\n\t\t}\n\n\t\tif ($ergebnis[fehler_code] == '200') {\n\t\t\treturn 1;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '201') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '202') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '203') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '204') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '205') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '206') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '207') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '208') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '209') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '210') {\n\t\t\treturn 0;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '666') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '777') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '888') {\n\t\t\treturn 9;\n\t\t}\n\t\telseif ($ergebnis[fehler_code] == '999') {\n\t\t\treturn 9;\n\t\t} else {\n\t\t\treturn 9;\n\t\t}\n\n\t} // end function Live\n\t/*******************************************************************/\n}", "function checksum_code39($code) {\n\n $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', \n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', \n 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', \n 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');\n $sum = 0;\n for ($i=0 ; $i<strlen($code); $i++) {\n $a = array_keys($chars, $code[$i]);\n $sum += $a[0];\n }\n $r = $sum % 43;\n return $chars[$r];\n}", "public function base58Checksum($payload);", "function crc32($str)\n{\n}", "protected function calculateChecksum($value): int\n {\n $checksum = 0;\n\n // chars without check digit in reverse\n $chars = array_reverse(str_split(substr($value, 0, -1)));\n\n foreach ($chars as $key => $char) {\n $multiplier = $key % 2 ? 1 : 3;\n $checksum += intval($char) * $multiplier;\n }\n\n $remainder = $checksum % 10;\n\n if ($remainder === 0) {\n return 0;\n }\n\n return 10 - $remainder;\n }", "public static function calculateChecksum($number, $length = 0) {\n\t\t$number = strval(self::toInteger($number));\n\n\t\tif ($length === 0) {\n\t\t\t$length = strlen($number);\n\t\t}\n\n\t\t$checkSum = 0;\n\n\t\t// Start at the next last digit\n\t\tfor ($i = $length - 2; $i >= 0; $i -= 2) {\n\t\t\t// Multiply number with 2\n\t\t\t$tmp = intval($number[$i]) * 2;\n\n\t\t\t// If a 2 digit number, split and add togheter\n\t\t\tif ($tmp > 9) {\n\t\t\t\t$tmp = ($tmp / 10) + ($tmp % 10);\n\t\t\t}\n\n\t\t\t// Sum it upp\n\t\t\t$checkSum += $tmp;\n\t\t}\n\n\t\t// Start at the next last digit\n\t\tfor ($i = $length - 1; $i >= 0; $i -= 2) {\n\t\t\t// Sum it upp\n\t\t\t$checkSum += intval($number[$i]);\n\t\t}\n\n\t\treturn $checkSum;\n\t}", "function TestCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n}", "protected function calculateChecksum() {\r\n // Checksum\r\n // First CheckSUM \"C\"\r\n // The \"C\" checksum character is the modulo 11 remainder of the sum of the weighted\r\n // value of the data characters. The weighting value starts at \"1\" for the right-most\r\n // data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20.\r\n // After 10, the sequence wraps around back to 1.\r\n\r\n // Second CheckSUM \"K\"\r\n // Same as CheckSUM \"C\" but we count the CheckSum \"C\" at the end\r\n // After 9, the sequence wraps around back to 1.\r\n $sequence_multiplier = array(10, 9);\r\n $temp_text = $this->text;\r\n $this->checksumValue = array();\r\n for ($z = 0; $z < 2; $z++) {\r\n $c = strlen($temp_text);\r\n\r\n // We don't display the K CheckSum if the original text had a length less than 10\r\n if ($c <= 10 && $z === 1) {\r\n break;\r\n }\r\n\r\n $checksum = 0;\r\n for ($i = $c, $j = 0; $i > 0; $i--, $j++) {\r\n $multiplier = $i % $sequence_multiplier[$z];\r\n if ($multiplier === 0) {\r\n $multiplier = $sequence_multiplier[$z];\r\n }\r\n\r\n $checksum += $this->findIndex($temp_text[$j]) * $multiplier;\r\n }\r\n\r\n $this->checksumValue[$z] = $checksum % 11;\r\n $temp_text .= $this->keys[$this->checksumValue[$z]];\r\n }\r\n }", "public function luhnChecksum(string $number): int {\n $number = $this->clean($number);\n\n // Reverse the string\n $number = strrev($number);\n\n $total = 0;\n\n // From the rightmost digit, which is the check digit,\n // and moving left, double the value of every second digit.\n for ($i = 0; $i <= strlen($number) - 1; $i++) {\n $val = (int) $number[$i];\n\n $val = ($i & 1) ? $val * 2 : $val;\n\n // If the result of this doubling operation is\n // greater than 9 then subtract 9 from the product\n if ($val > 9) {\n $val -= 9;\n }\n\n // Take the sum of all the digits\n $total += $val;\n }\n\n return $total % 10;\n }", "public function boxIDCheckSum(): int\n {\n $twoLetter = 0;\n $threeLetter = 0;\n\n foreach ($this->inputArray as $inputValue) {\n $count = array_count_values(str_split($inputValue));\n if (in_array(3, $count, true) !== false) {\n $threeLetter++;\n }\n if (in_array(2, $count, true) !== false) {\n $twoLetter++;\n }\n }\n\n return $twoLetter * $threeLetter;\n }", "function checkVatID_si($vat_id) {\n\t\tif (strlen($vat_id) != 10)\n\t\t\treturn 0;\n\t\tif ((int) $vat_id[2] == 0)\n\t\t\treturn 0;\n\n\t\t$checksum = (int) $vat_id[9];\n\t\t$checkval = 0;\n\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 11) == 10 ? 0 : 11 - $this->modulo($checkval, 11);\n\t\tif ($checksum != $checkval)\n\t\t\treturn 0;\n\n\t\treturn 1;\n\t}", "private function validateChecksum($vat): void\n {\n $numbers = trim(substr($vat, 2));\n\n $len = strlen($numbers);\n\n self::assertEquals(10, $len);\n self::assertStringStartsWith('0', $numbers);\n\n // Mod97 check on first 8 digits\n $checksum = 97 - fmod(substr($numbers, 0, 8), 97);\n // Make sure checksum is 2 characters long\n $checksum = sprintf('%02d', $checksum);\n\n self::assertEquals((string) $checksum, substr($numbers, 8, 10));\n }", "function GetCheckDigit($barcode)\n{\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n $r=$sum%10;\n if($r>0)\n $r=10-$r;\n return $r;\n}", "function calc_md5_response($trans_id = '', $amount = '') {\r\n if ($amount == '' || $amount == '0') $amount = '0.00';\r\n $validating = md5(MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH . MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN . $trans_id . $amount);\r\n return strtoupper($validating);\r\n }", "function at_affilinet_validate_ean($barcode){\n if (!preg_match(\"/^[0-9]{13}$/\", $barcode)) {\n return false;\n }\n\n $digits = $barcode;\n\n // 1. Add the values of the digits in the\n // even-numbered positions: 2, 4, 6, etc.\n $even_sum = $digits[1] + $digits[3] + $digits[5] +\n $digits[7] + $digits[9] + $digits[11];\n\n // 2. Multiply this result by 3.\n $even_sum_three = $even_sum * 3;\n\n // 3. Add the values of the digits in the\n // odd-numbered positions: 1, 3, 5, etc.\n $odd_sum = $digits[0] + $digits[2] + $digits[4] +\n $digits[6] + $digits[8] + $digits[10];\n\n // 4. Sum the results of steps 2 and 3.\n $total_sum = $even_sum_three + $odd_sum;\n\n // 5. The check character is the smallest number which,\n // when added to the result in step 4, produces a multiple of 10.\n $next_ten = (ceil($total_sum / 10)) * 10;\n $check_digit = $next_ten - $total_sum;\n\n // if the check digit and the last digit of the\n // barcode are OK return true;\n if ($check_digit == $digits[12]) {\n return true;\n }\n\n return false;\n }", "protected function checksum_code93($code) {\n\t\t$chars = array(\n\t\t\t'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n\t\t\t'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',\n\t\t\t'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n\t\t\t'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%',\n\t\t\t'<', '=', '>', '?');\n\t\t// translate special characters\n\t\t$code = strtr($code, chr(128).chr(131).chr(129).chr(130), '<=>?');\n\t\t$len = strlen($code);\n\t\t// calculate check digit C\n\t\t$p = 1;\n\t\t$check = 0;\n\t\tfor ($i = ($len - 1); $i >= 0; --$i) {\n\t\t\t// FIXME: use strpos() instead and check result\n\t\t\t$k = array_keys($chars, $code[$i]);\n\t\t\t$check += ( (int) $k[0] * $p);\n\t\t\t++$p;\n\t\t\tif ($p > 20) {\n\t\t\t\t$p = 1;\n\t\t\t}\n\t\t}\n\t\t$check %= 47;\n\t\t$c = $chars[$check];\n\t\t$code .= $c;\n\t\t// calculate check digit K\n\t\t$p = 1;\n\t\t$check = 0;\n\t\tfor ($i = $len; $i >= 0; --$i) {\n\t\t\t// FIXME: use strpos() instead and check result\n\t\t\t$k = array_keys($chars, $code[$i]);\n\t\t\t$check += ( (int) $k[0] * $p);\n\t\t\t++$p;\n\t\t\tif ($p > 15) {\n\t\t\t\t$p = 1;\n\t\t\t}\n\t\t}\n\t\t$check %= 47;\n\t\t$checksum = $c.$chars[$check];\n\t\t// restore special characters\n\t\t$checksum = strtr($checksum, '<=>?', chr(128).chr(131).chr(129).chr(130));\n\t\treturn $checksum;\n\t}", "function checksum_code39($code) {\n\n\t $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n\t 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',\n\t 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n\t 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');\n\t $sum = 0;\n\t for ($i=0 ; $i<strlen($code); $i++) {\n\t $a = array_keys($chars, $code{$i});\n\t $sum += $a[0];\n\t }\n\t $r = $sum % 43;\n\t return $chars[$r];\n\t}", "private function generateChecksum(bool $excluding = false): void\n {\n $sum = 0;\n $reverse = array_reverse($this->numberArray);\n $length = count($reverse);\n\n $i = 1;\n if ($excluding === true) {\n $res = $reverse[0] * 2;\n if ($res >= $this->base) {\n $res -= ($this->base - 1);\n }\n $sum += $res;\n $i++;\n }\n\n for (; $i < $length; $i += 2) {\n $res = $reverse[$i] * 2;\n if ($res >= $this->base) {\n $res -= ($this->base - 1);\n }\n $sum += $res;\n\n $res = $reverse[$i - 1];\n if ($res >= $this->base) {\n $res -= ($this->base - 1);\n }\n $sum += $res;\n }\n\n if ($i === $length) {\n $res = $reverse[$i - 1];\n $sum += $res;\n }\n\n $this->luhnValue = $sum;\n }", "function generate_checksum($byteArray)\n{\n\t$byte = 0;\n\t$arr = $byteArray;\n\tfor ($i = 0; $i < strlen($byteArray); $i++)\n\t{\n\t\t$byte ^= ord($arr[$i]);\n\t}\n\treturn $byte % NUM_LETTERS;\n}", "function getConfigurationChecksum() ;", "protected function getChecksumData() {}", "private function isValid(): bool\n {\n $this->generateChecksum();\n return (($this->luhnValue % $this->base == 0) && ($this->luhnValue != 0));\n }", "static function esCedulaValida($numero) {\r\n if (strlen($numero) == 0) {\r\n return FALSE;\r\n }\r\n $resultado = \"\";\r\n $suma = 0;\r\n $residuo = 0;\r\n $pri = false;\r\n $pub = false;\r\n $nat = false;\r\n $numeroProvincias = 22;\r\n $modulo = 11;\r\n\r\n /* Aqui almacenamos los digitos de la cedula en variables. */\r\n $d1 = substr($numero, 0, 1);\r\n $d2 = substr($numero, 1, 1);\r\n $d3 = substr($numero, 2, 1);\r\n $d4 = substr($numero, 3, 1);\r\n $d5 = substr($numero, 4, 1);\r\n $d6 = substr($numero, 5, 1);\r\n $d7 = substr($numero, 6, 1);\r\n $d8 = substr($numero, 7, 1);\r\n $d9 = substr($numero, 8, 1);\r\n $d10 = substr($numero, 9, 1);\r\n\r\n $p1 = 0;\r\n $p2 = 0;\r\n $p3 = 0;\r\n $p4 = 0;\r\n $p5 = 0;\r\n $p6 = 0;\r\n $p7 = 0;\r\n $p8 = 0;\r\n $p9 = 0;\r\n\r\n /* El tercer digito es: */\r\n /* 9 para sociedades privadas y extranjeros */\r\n /* 6 para sociedades publicas */\r\n /* menor que 6 (0,1,2,3,4,5) para personas naturales */\r\n\r\n if ($d3 == 7 || $d3 == 8) {\r\n $resultado = '0';\r\n }\r\n\r\n /* Solo para personas naturales (modulo 10) */\r\n if ($d3 < 6) {\r\n $nat = true;\r\n $p1 = $d1 * 2;\r\n if ($p1 >= 10)\r\n $p1 -= 9;\r\n $p2 = $d2 * 1;\r\n if ($p2 >= 10)\r\n $p2 -= 9;\r\n $p3 = $d3 * 2;\r\n if ($p3 >= 10)\r\n $p3 -= 9;\r\n $p4 = $d4 * 1;\r\n if ($p4 >= 10)\r\n $p4 -= 9;\r\n $p5 = $d5 * 2;\r\n if ($p5 >= 10)\r\n $p5 -= 9;\r\n $p6 = $d6 * 1;\r\n if ($p6 >= 10)\r\n $p6 -= 9;\r\n $p7 = $d7 * 2;\r\n if ($p7 >= 10)\r\n $p7 -= 9;\r\n $p8 = $d8 * 1;\r\n if ($p8 >= 10)\r\n $p8 -= 9;\r\n $p9 = $d9 * 2;\r\n if ($p9 >= 10)\r\n $p9 -= 9;\r\n $modulo = 10;\r\n }\r\n\r\n /* Solo para sociedades publicas (modulo 11) */\r\n /* Aqui el digito verficador esta en la posicion 9, en las otras 2 en la pos. 10 */\r\n else {\r\n if ($d3 == 6) {\r\n $pub = true;\r\n $p1 = $d1 * 3;\r\n $p2 = $d2 * 2;\r\n $p3 = $d3 * 7;\r\n $p4 = $d4 * 6;\r\n $p5 = $d5 * 5;\r\n $p6 = $d6 * 4;\r\n $p7 = $d7 * 3;\r\n $p8 = $d8 * 2;\r\n $p9 = 0;\r\n } else {\r\n /* Solo para entidades privadas (modulo 11) */\r\n if ($d3 == 9) {\r\n $pri = true;\r\n $p1 = $d1 * 4;\r\n $p2 = $d2 * 3;\r\n $p3 = $d3 * 2;\r\n $p4 = $d4 * 7;\r\n $p5 = $d5 * 6;\r\n $p6 = $d6 * 5;\r\n $p7 = $d7 * 4;\r\n $p8 = $d8 * 3;\r\n $p9 = $d9 * 2;\r\n }\r\n }\r\n }\r\n $suma = $p1 + $p2 + $p3 + $p4 + $p5 + $p6 + $p7 + $p8 + $p9;\r\n $residuo = $suma % $modulo;\r\n\r\n /* Si residuo=0, dig.ver.=0, caso contrario 10 - residuo */\r\n if ($residuo == 0)\r\n $digitoVerificador = 0;\r\n else\r\n $digitoVerificador = $modulo - $residuo;\r\n\r\n /* ahora comparamos el elemento de la posicion 10 con el dig. ver. */\r\n if ($pub == true) {\r\n if ($digitoVerificador != $d9) {\r\n $resultado = '0';\r\n }\r\n /* El ruc de las empresas del sector publico terminan con 0001 */\r\n if (substr($numero, 9, 4) != '0001') {\r\n $resultado = '0';\r\n }\r\n } else {\r\n if ($pri == true) {\r\n if ($digitoVerificador != $d10) {\r\n $resultado = '0';\r\n }\r\n if (substr($numero, 10, 3) != '001') {\r\n $resultado = '0';\r\n }\r\n } else {\r\n if ($nat == true) {\r\n if ($digitoVerificador != $d10) {\r\n $resultado = '0';\r\n }\r\n if (strlen($numero) > 10 && substr($numero, 10, 3) != '001') {\r\n $resultado = '0';\r\n }\r\n }\r\n }\r\n }\r\n if ($resultado == \"\") {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function hasMd5checksum(){\n return $this->_has(3);\n }", "public function hasMd5checksum(){\n return $this->_has(3);\n }", "function isSumEqual(string $input)\n{\n if (strlen($input) !== 6) {\n throw new invalidArgumentException('You should write 6 digits. Your input is ' . $input);\n } else {\n return (($input[0] + $input[1] + $input[2]) == ($input[3] + $input[4] + $input[5]));\n }\n}", "public function Checksum_Good($tle_set)\n {\n if (strlen($tle_set) < 69) {\n return false;\n }\n\n $checksum = 0;\n\n for ($i = 0; $i < 68; $i++) {\n if (($tle_set[$i] >= '0') && ($tle_set[$i] <= '9')) {\n $value = $tle_set[$i] - '0';\n } else if ($tle_set[$i] == '-' ) {\n $value = 1;\n } else {\n $value = 0;\n }\n\n $checksum += $value;\n }\n\n $checksum %= 10;\n $check_digit = $tle_set[68] - '0';\n\n return $checksum == $check_digit;\n }", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "public function generateChecksumForTitle($title, $account) {\n\t\t// Note that the encoded hash ($m) must be <= to length of n in hex (32)\n\t\t// We want to protect the \n\t\t// \tinstitution name (from T_AccountRoot)\n\t\t//\thosting domain (need to add to T_AccountRoot) -- but what would this be for network? Just empty I suppose.\n\t\t//\texpiry date\n\t\t//\tmaxStudents\n\t\t//\tlicenceType\n\t\t//\trootID\n\t\t//\tproductCode\n\t\t//$protectedString = $account->name.$account->selfHostDomain.$title-> expiryDate.$title-> maxStudents.$title-> licenceType.$account->id.$title-> productCode;\n\t\t$protectedString = $account->name.$title-> expiryDate.$title-> maxStudents.$title-> licenceType.$account->id.$title-> productCode;\n\t\t$escapedString = $this->actionscriptEscape($protectedString);\n\t\t//$protectedString = \"adrian raper's college of languagehttp://www.clarityenglish.com2009-12-10153138\";\n\n\t\t//NetDebug::trace(\"checksum protected=$protectedString\");\n\t\t//NetDebug::trace(\"escaped=$escapedString\");\n\t\t// v6.5.5.5 because php and actionscript do md5 differently, we need to escape first\n\t\t$hash = md5($escapedString);\n\t\t//NetDebug::trace(\"hash=$hash\");\n\t\t\n\t\t// Encode and sign the hash\n\t\t$m = Base8::encode($hash);\n\t\t//NetDebug::trace(\"checksum m=$m\");\n\t\t$c = $this->dmsKey->sign($m);\n\t\t//NetDebug::trace(\"checksum c=$c\");\n\t\t$c = $this->orchidPublicKey->encrypt($c);\n\t\t//NetDebug::trace(\"checksum=$c\");\n\t\t//echo \"checksum c=$c\";\n\t\t\n\t\treturn $c;\n\t}", "public static function getChecksum()\n\t{\n\t\t$strungString = md5(self::$_saltDepth);\n\t\t$strungString .= md5(self::$_hash);\n\t\t$strungString .= md5(self::$_salt);\n\t\t$strungString .= md5(var_export(self::$_poisonConstraints,true));\n\t\t$strungString .= md5(var_export(self::$_hashTableFrom,true));\n\t\t$strungString .= md5(var_export(self::$_hashTableTo,true));\n\n\t\t$supportedHashes = hash_algos();\n\n\t\t$strungString .= md5((isset($supportedHashes['whirlpool'])?\n\t\t\tmd5('whirlpool'):\n\t\t\t(isset($supportedHashes['sha512'])?\n\t\t\t\tmd5('sha512'):\n\t\t\t\t(isset($supportedHashes['ripemd320'])?\n\t\t\t\t\tmd5('ripemd320'):md5('md5')\n\t\t\t\t)\n\t\t\t)\n\t\t));\n\n\t\treturn md5($strungString);\n\t}", "function checkWeightedSum($isbn){\n $odd = 0;\n $even = 0;\n for($i = 0; $i<strlen($isbn)-1; $i++){\n if($i%2 == 0){\n $odd += $isbn[$i];\n }else{\n $even += $isbn[$i]*3;\n }\n }\n $sum = $odd + $even;\n $mod = $sum%10;\n $check = ($mod == 0) ? 0 : 10-$mod;\n if($check == substr($isbn, 12,12)){\n return 1;\n }else{\n return 0;\n }\n }", "abstract protected function calculateCheckDigit(AccountNumber $number): string;", "public function validationSha($code){\r\n\t\t//variables\r\n\t\t$error = '';\r\n\t\t$user_browser = $_SERVER['HTTP_USER_AGENT']; //navegador\r\n\t\t$ip = $_SERVER['REMOTE_ADDR']; //ip\r\n\t\r\n\t\t$this->where('macro_sha', $code);\r\n\t\tif($salida = $this->getOne('solicitudes_clave')){\r\n\t\t\t\r\n\t\t\tif($salida['navegador'] != $user_browser){\t$error = 'navegador no concide';\t}\r\n\t\t\tif($salida['ip'] != $ip){\t\t\t\t\t$error = 'remote ip no concide';\t}\r\n\t\t\t\r\n\t\t\tif($error != ''){\r\n\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t$nuevo_sha = hash('sha512', $salida['email'].$user_browser.$salida['telefono'].$ip);\r\n\t\t\t\tif($nuevo_sha != $salida['macro_sha']){\r\n\t\t\t\t\t$error = 'Shas no coinciden';\r\n\t\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//succes!!\r\n\t\t\t\t\t$_SESSION['email_val'] = $salida['email'];\r\n\t\t\t\t\t$_SESSION['corrector'] = $salida['salt'];\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$error = 'no hubo conexion a db';\r\n\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function TestCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n return ($sum+$barcode[12])%10==0;\n }", "protected function getCheckSum($parts) {\n\t\t$hash = md5(implode(':', $parts) . config('app.key'));\n\n\t\treturn base_convert_arbitrary($hash, 16, 10);\n\t}", "public function base58EncodeChecksum($payload);", "protected static function create_hash($string)\n\t{\n\t\t$check1 = static::string_to_number($string, 0x1505, 0x21);\n\t\t$check2 = static::string_to_number($string, 0, 0x1003F);\n\n\t\t$factor = 4;\n\t\t$halfFactor = $factor/2;\n\n\t\t$check1 >>= $halfFactor;\n\t\t$check1 = (($check1 >> $factor) & 0x3FFFFC0 ) | ($check1 & 0x3F);\n\t\t$check1 = (($check1 >> $factor) & 0x3FFC00 ) | ($check1 & 0x3FF);\n\t\t$check1 = (($check1 >> $factor) & 0x3C000 ) | ($check1 & 0x3FFF); \n\n\t\t$calc1 = (((($check1 & 0x3C0) << $factor) | ($check1 & 0x3C)) << $halfFactor ) | ($check2 & 0xF0F );\n\t\t$calc2 = (((($check1 & 0xFFFFC000) << $factor) | ($check1 & 0x3C00)) << 0xA) | ($check2 & 0xF0F0000 );\n\n\t\treturn ($calc1 | $calc2);\n\t}", "protected static function check_hash($hashNumber)\n\t{\n\t\t$check = 0;\n\t\t$flag = 0;\n\n\t\t$hashString = sprintf('%u', $hashNumber) ;\n\t\t$length = strlen($hashString);\n\n\t\tfor($i = $length - 1; $i >= 0; $i --)\n\t\t{\n\t\t\t$r = $hashString{$i};\n\n\t\t\tif(1 === ($flag % 2))\n\t\t\t{ \n\t\t\t\t$r += $r; \n\t\t\t\t$r = (int)($r / 10) + ($r % 10);\n\t\t\t}\n\n\t\t\t$check += $r;\n\t\t\t$flag ++; \n\t\t}\n\n\t\t$check %= 10;\n\n\t\tif(0 !== $check)\n\t\t{\n\t\t\t$check = 10 - $check;\n\n\t\t\tif(1 === ($flag % 2) )\n\t\t\t{\n\t\t\t\tif(1 === ($check % 2))\n\t\t\t\t{\n\t\t\t\t\t$check += 9;\n\t\t\t\t}\n\n\t\t\t\t$check >>= 1;\n\t\t\t}\n\t\t}\n\n\t\treturn '7'.$check.$hashString;\n\t}", "function RSHash($string) {\n $a = 63689;\n $b = 378551;\n $hash = 0;\n\n for ($i = 0, $x = strlen($string); $i < $x; $i++) {\n $hash = $hash * $a + (int) ord($string[$i]);\n $hash = fmod($hash, 65535);\n $a = $a * $b;\n $a = fmod($a, 65535);\n }\n\n return $hash;\n }", "public function addMd5checksums( $value){\n return $this->_add(1, $value);\n }", "public function addMd5checksums( $value){\n return $this->_add(1, $value);\n }", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "public function hash();", "function serendipity_FTPChecksum($filename, $type = null) {\n /** Only read the finfo database once */\n static $debug_exts = array();\n\n // Must be able to read the file\n if (!is_readable($filename)) {\n return false;\n }\n\n // Figure out whether it's binary or text by extension\n if ($type == null) {\n $parts = pathinfo($filename);\n $ext = '';\n // Some PHP versions throw a warning if the index doesn't exist\n if (isset($parts['extension'])) {\n $ext = $parts['extension'];\n }\n // If they're case-insensitive equal, strcasecmp() returns 0, or\n // 'false'. So I use && to find if any of them are 0, in the\n // most likely fail-fast order.\n if (strcasecmp($ext, 'php') &&\n strcasecmp($ext, 'tpl') &&\n strcasecmp($ext, 'sql') &&\n strcasecmp($ext, 'js') &&\n strcasecmp($ext, 'txt') &&\n strcasecmp($ext, 'htc') &&\n strcasecmp($ext, 'css') &&\n strcasecmp($ext, 'dist') &&\n strcasecmp($ext, 'lib') &&\n strcasecmp($ext, 'sh') &&\n strcasecmp($ext, 'html') &&\n strcasecmp($ext, 'htm') &&\n strcasecmp($ext, 'xml') &&\n strcasecmp($ext, 'inc') &&\n strcasecmp($ext, 'svg') &&\n !empty($ext)) {\n if (!in_array($ext, array_keys($debug_exts))) {\n $debug_exts[$ext] = $filename;\n }\n $type = 'bin';\n } else {\n $type = 'text';\n }\n }\n\n // Calculate the checksum\n $md5 = false;\n if (stristr($type, 'text')) {\n // This is a text-type file. We need to remove linefeeds before\n // calculating a checksum, to account for possible FTP conversions\n // that are inconvenient, but still valid. But we don't want to\n // allow newlines anywhere; just different *kinds* of newlines.\n $newlines = array(\"#\\r\\n#\", \"#\\r#\", \"#\\n#\");\n $file = file_get_contents($filename);\n $file = preg_replace($newlines, ' ', $file);\n $md5 = md5($file);\n } else {\n // Just get its md5sum\n $md5 = md5_file($filename);\n }\n\n return $md5;\n}", "function isArmstrong($number)\n{\n\t$sum = 0;\n\t$digits = calculateDigits($number);\n\n\t$temporary = $number;\n\n\twhile($temporary>0)\n\t{\n\t\t$lastDigit = $temporary%10;\n\t\t$sum = $sum + pow($lastDigit,$digits);\n\n\t\t$temporary = $temporary - $lastDigit;\n\n\t\tif($temporary>0)\n\t\t$temporary = $temporary/10; \t\n\t}\n\n\tif($sum==$number)\n\t\techo $number.\" is an Armstrong number\";\n\telse\n\t\techo $number.\" is not an Armstrong number \".$sum;\n\t \n}", "public function checksum() { return $this->_m_checksum; }", "function GetCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n $r=$sum%10;\n if($r>0)\n $r=10-$r;\n return $r;\n }", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function serendipity_verifyFTPChecksums() {\n global $serendipity;\n\n $badsums = array();\n\n // Load the checksums\n $f = S9Y_INCLUDE_PATH . 'checksums.inc.php';\n\n if (!file_exists($f) || filesize($f) < 1) {\n return $badsums;\n }\n\n require_once $f;\n // Verify that every file in the checksum list was uploaded correctly\n $basedir = realpath(dirname(__FILE__) . '/../');\n\n if (!is_array($serendipity['checksums_' . $serendipity['version']])) {\n return $badsums;\n }\n\n foreach ($serendipity['checksums_' . $serendipity['version']] as $prel => $sum) {\n $path = $basedir . '/' . $prel;\n // Don't take checksums of directories\n if (is_dir($path)) {\n // Weird that it's even here.\n continue;\n }\n\n // Can't checksum unreadable or nonexistent files\n if (!is_readable($path)) {\n $badsums[$prel] = 'missing';\n continue;\n }\n\n // Validate checksum\n $calcsum = serendipity_FTPChecksum($path);\n if ($sum != $calcsum) {\n $badsums[$prel] = $calcsum;\n continue;\n }\n }\n\n return $badsums;\n}", "protected function _computeHashR6($data, $inputPassword, $userKey = '') {}", "function isbn10checker($input, $convert = FALSE){\n\t$output = FALSE;\n\tif (strlen($input) < 9){\n\t\t$output = array('error'=>'ISBN too short.');\n\t}\n\tif (strlen($input) > 10){\n\t\t$output = array('error'=>'ISBN too long.');\n\t}\n\tif (!$output){\n\t\t$runningTotal = 0;\n\t\t$r = 1;\n\t\t$multiplier = 10;\n\t\tfor ($i = 0; $i < 10 ; $i++){\n\t\t\t$nums[$r] = substr($input, $i, 1);\n\t\t\t$r++;\n\t\t}\n\t\t$inputChecksum = array_pop($nums);\n\t\tforeach($nums as $key => $value){\n\t\t\t$runningTotal += $value * $multiplier;\n\t\t\t//echo $value . 'x' . $multiplier . ' + ';\n\t\t\t$multiplier --;\n\t\t\tif ($multiplier === 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//echo ' = ' . $runningTotal;\n\t\t$remainder = $runningTotal % 11;\n\t\t$checksum = $remainder == 1 ? 'X' : 11 - $remainder;\n\t\t$checksum = $checksum == 11 ? 0 : $checksum;\n\t\t$output = array('checksum'=>$checksum);\n\t\t$output['isbn10'] = substr($input, 0, 9) . $checksum;\n\t\tif ($convert){\n\t\t\t$output['isbn13'] = isbn10to13($output['isbn10']);\n\t\t}\n\t\tif ((is_numeric($inputChecksum) || $inputChecksum == 'X') && $inputChecksum != $checksum){\n\t\t\t$output['error'] = 'Input checksum digit incorrect: ISBN not valid';\n\t\t\t$output['input_checksum'] = $inputChecksum;\n\t\t}\n\t}\n\treturn $output;\n}", "function nip_valida($cif) {\n $cif = strtoupper($cif);\n for ($i = 0; $i < 9; $i ++)\n $num[$i] = substr($cif, $i, 1);\n//si no tiene un formato valido devuelve error\n if (!ereg('((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)', $cif))\n return 0;\n//comprobacion de NIFs estandar\n if (ereg('(^[0-9]{8}[A-Z]{1}$)', $cif))\n if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($cif, 0, 8) % 23, 1))\n return 1;\n else\n return -1;\n//algoritmo para comprobacion de codigos tipo CIF\n $suma = $num[2] + $num[4] + $num[6];\n for ($i = 1; $i < 8; $i += 2)\n $suma += substr((2 * $num[$i]),0,1) + substr((2 * $num[$i]),1,1);\n $n = 10 - substr($suma, strlen($suma) - 1, 1);\n//comprobacion de NIFs especiales (se calculan como CIFs)\n if (ereg('^[KLM]{1}', $cif))\n if ($num[8] == chr(64 + $n))\n return 1;\n else\n return -1;\n//comprobacion de CIFs\n if (ereg('^[ABCDEFGHJNPQRSUVW]{1}', $cif))\n if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1))\n return 2;\n else\n return -2;\n//comprobacion de NIEs\n //T\n if (ereg('^[T]{1}', $cif))\n if ($num[8] == ereg('^[T]{1}[A-Z0-9]{8}$', $cif))\n return 3;\n else\n return -3;\n //XYZ\n if (ereg('^[XYZ]{1}', $cif))\n if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $cif), 0, 8) % 23, 1))\n return 3;\n else\n return -3;\n//si todavia no se ha verificado devuelve error\n return 0;\n}", "function isbn13checker($input, $convert = FALSE){\n\t$output = FALSE;\n\tif (strlen($input) < 12){\n\t\t$output = array('error'=>'ISBN too short.');\n\t}\n\tif (strlen($input) > 13){\n\t\t$output = array('error'=>'ISBN too long.');\n\t}\n\tif (!$output){\n\t\t$runningTotal = 0;\n\t\t$r = 1;\n\t\t$multiplier = 1;\n\t\tfor ($i = 0; $i < 13 ; $i++){\n\t\t\t$nums[$r] = substr($input, $i, 1);\n\t\t\t$r++;\n\t\t}\n\t\t$inputChecksum = array_pop($nums);\n\t\tforeach($nums as $key => $value){\n\t\t\t$runningTotal += $value * $multiplier;\n\t\t\t$multiplier = $multiplier == 3 ? 1 : 3;\n\t\t}\n\t\t$div = $runningTotal / 10;\n\t\t$remainder = $runningTotal % 10;\n\n\t\t$checksum = $remainder == 0 ? 0 : 10 - substr($div, -1);\n\n\t\t$output = array('checksum'=>$checksum);\n\t\t$output['isbn13'] = substr($input, 0, 12) . $checksum;\n\t\tif ($convert){\n\t\t\t$output['isbn10'] = isbn13to10($output['isbn13']);\n\t\t}\n\t\tif (is_numeric($inputChecksum) && $inputChecksum != $checksum){\n\t\t\t$output['error'] = 'Input checksum digit incorrect: ISBN not valid';\n\t\t\t$output['input_checksum'] = $inputChecksum;\n\t\t}\n\t}\n\treturn $output;\n}", "function checkVatID_ie_new($vat_id) {\n\t\t$checksum = strtoupper(substr($vat_id, -1));\n\t\t$checkval = 0;\n\t\t$checkchar = 'A';\n\t\tfor ($i = 2; $i <= 8; $i ++)\n\t\t\t$checkval += (int) $vat_id[10 - $i] * $i;\n\t\t$checkval = $this->modulo($checkval, 23);\n\t\tif ($checkval == 0) {\n\t\t\t$checkchar = 'W';\n\t\t} else {\n\t\t\tfor ($i = $checkval -1; $i > 0; $i --)\n\t\t\t\t$checkchar ++;\n\t\t}\n\t\tif ($checkchar != $checksum)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "function GetCheckDigit($barcode)\n {\n $sum=0;\n for($i=1;$i<=11;$i+=2)\n $sum+=3*$barcode[$i];\n for($i=0;$i<=10;$i+=2)\n $sum+=$barcode[$i];\n $r=$sum%10;\n if($r>0)\n $r=10-$r;\n return $r;\n }", "public function getConfigurationChecksum() {}", "protected function getUrlChecksum($url)\n {\n $checksum = strtolower(urldecode($this->glueUrl($url, true)));\n $checksum = preg_replace('#\\s#', '', $this->decodeTranslit($checksum));\n return dechex(crc32($checksum));\n }", "public function validate()\n {\n // get the value; remove spaces, dashes, and dots\n $value = str_replace([' ', '-', '.'], '', (string) $this->getValue());\n\n // is it composed only of digits?\n if (! ctype_digit($value)) {\n return false;\n }\n\n // luhn mod-10 algorithm: https://gist.github.com/1287893\n $sumTable = [\n [0,1,2,3,4,5,6,7,8,9],\n [0,2,4,6,8,1,3,5,7,9],\n ];\n\n $sum = 0;\n $flip = 0;\n\n for ($i = strlen($value) - 1; $i >= 0; $i--) {\n $sum += $sumTable[$flip++ & 0x1][$value[$i]];\n }\n return $sum % 10 === 0;\n }", "protected function processChecksum() {\r\n if ($this->checksumValue === false) { // Calculate the checksum only once\r\n $this->calculateChecksum();\r\n }\r\n\r\n if ($this->checksumValue !== false) {\r\n $ret = '';\r\n $c = count($this->checksumValue);\r\n for ($i = 0; $i < $c; $i++) {\r\n $ret .= $this->keys[$this->checksumValue[$i]];\r\n }\r\n\r\n return $ret;\r\n }\r\n\r\n return false;\r\n }", "function checkTWId($twid)\n{\n $ret = false;\n if (preg_match(\"/^[A-Z][12]\\d{8}$/\", $twid)) {\n $letters = 'ABCDEFGHJKLMNPQRSTUVXYWZIO';\n\n $c1 = substr($twid, 0, 1); //'A'\n $n12 = strpos($letters, $c1) + 10;\n// echo $n12 . '<hr>';\n $n1 = (int)($n12 / 10);\n $n2 = $n12 % 10;\n $n3 = substr($twid, 1, 1);\n $n4 = substr($twid, 2, 1);\n $n5 = substr($twid, 3, 1);\n $n6 = substr($twid, 4, 1);\n $n7 = substr($twid, 5, 1);\n $n8 = substr($twid, 6, 1);\n $n9 = substr($twid, 7, 1);\n $n10 = substr($twid, 8, 1);\n $n11 = substr($twid, 9, 1);\n\n $sum = $n1 * 1 + $n2 * 9 + $n3 * 8 + $n4 * 7 + $n5 * 6 + $n6 * 5 + $n7 * 4 + $n8 * 3 + $n9 * 2 + $n10 * 1 + $n11 * 1;\n $ret = ($sum % 10 == 0);\n\n\n }\n return $ret;\n\n}", "public static function luhn_check( $str ) {\n\t\t$odd = (strlen( $str ) % 2);\n\t\t$sum = 0;\n\n\t\tfor( $i = 0; $i < strlen( $str ); $i++ ) {\n\t\t\tif ( $odd ) {\n\t\t\t\t$sum += $str[$i];\n\t\t\t} else {\n\t\t\t\tif ( ( $str[$i] * 2 ) > 9 ) {\n\t\t\t\t\t$sum += $str[$i] * 2 - 9;\n\t\t\t\t} else {\n\t\t\t\t\t$sum += $str[$i] * 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$odd = !$odd;\n\t\t}\n\t\treturn( ( $sum % 10 ) == 0 );\n\t}", "function formIsCreditNumber( $number ) { \r\n \r\n $tmp = $number; \r\n $number = preg_replace( \"/[^0-9]/\", \"\", $tmp ); \r\n\r\n if ( preg_match( \"/[^\\d\\s]/\", $number ) ) return 0; \r\n if ( strlen($number) < 13 && 0+$number ) return 0; \r\n\r\n for ($i = 0; $i < strlen($number) - 1; $i++) { \r\n $weight = substr($number, -1 * ($i + 2), 1) * (2 - ($i % 2)); \r\n $sum += (($weight < 10) ? $weight : ($weight - 9)); \r\n } \r\n\r\n if ( substr($number, -1) == (10 - $sum % 10) % 10 ) return $number; \r\n return $number; \r\n}", "function ssn($ssn)\n {\n if (!preg_match(\"/^\\d{9}$/\", $ssn)) return false;\n\n $weights = array(3, 7);\n $sum = 0;\n for ($i = 0; $i<8; $i++) {\n $sum += $weights[$i % 2] * intval(substr($ssn, $i, 1));\n }\n return substr($ssn, 8, 1) == ($sum % 10);\n }", "function is_md5($str)\n{\n\t//return false;\n\treturn preg_match(\"/^[a-f0-9]{32}$/i\", $str);\n}", "function validMd5($api_key) {\n\n return preg_match(\"/^[a-f0-9]{32}$/\", $api_key);\n}", "function verifyPaymentDatafeed($src, $prc, $successCode, $merchantReferenceNumber, $paydollarReferenceNumber, $currencyCode, $amount, $payerAuthenticationStatus, $secureHashSecret, $secureHash) {\r\n\t$buffer = $src . '|' . $prc . '|' . $successCode . '|' . $merchantReferenceNumber . '|' . $paydollarReferenceNumber . '|' . $currencyCode . '|' . $amount . '|' . $payerAuthenticationStatus . '|' . $secureHashSecret;\r\n\t$verifyData = sha1($buffer);\r\n\tif ($secureHash == $verifyData) { return true; }\r\n\treturn false;\r\n}", "function fileRaid($fileCut)\n{\n for($i = 0 , $j = 1 ; $i < 16 ; $i = $i + 4)\n {\n $sum = checkSum($fileCut[$i], $fileCut[$i + 2]); //fichier checkSum.php\n $sum .= \"@-'-\".$j.\"-'-@\";\n array_push($fileCut, $sum);\n $j = $j + 2;\n }\n return($fileCut);\n}", "abstract public function nonce_check();", "protected function calculateArrayChecksum(array $data)\n {\n return md5(implode('', $data) . $this->getMerchantPassword());\n }", "public function calculateHash(string $text)\n {\n return hash('haval160,4', $text);\n }", "public function isValid()\n {\n $this->checkJMBG();\n\n $arr = @$this->explode();\n if (count($arr) <> 13) return false;\n foreach ($arr as $k => $v) $$k = (int)$v;\n\n $checksum = 11 - (7 * ($A + $G) + 6 * ($B + $H) + 5 * ($C + $I) + 4 * ($D + $J) + 3 * ($E + $K) + 2 * ($F + $L)) % 11;\n return ($checksum == $M);\n }", "public function verify_checksums( $args, $assoc_args ) {\n\t\tself::run( 'core verify-checksums', $args, $assoc_args );\n\t}", "function fn_crc32($key)\n{\n\treturn sprintf('%u', crc32($key));\n}", "final public function calculateDigestString($data) {}", "public function codeRechargement()\n {\n $code_secret = $this->utils->securite_xss($_POST['codesecret']);\n $fk_agence = $this->utils->securite_xss($_POST['fkagence']);\n $frais = $this->compteModel->verifCodeRechargement($fk_agence, $code_secret);\n if ($frais == 1) echo 1;\n elseif ($frais == 0) echo 0;\n else echo -2;\n }", "function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }", "public function hasMd5checksums(){\n return $this->_has(1);\n }", "public function hasMd5checksums(){\n return $this->_has(1);\n }", "private function luhn_check($number) {\r\n\r\n\t\t// Set the string length and parity\r\n\t\t$number_length=strlen($number);\r\n\t\t$parity=$number_length % 2;\r\n\r\n\t\t// Loop through each digit and do the maths\r\n\t\t$total=0;\r\n\t\tfor ($i=0; $i<$number_length; $i++) {\r\n\t\t\t$digit=$number[$i];\r\n\t\t\t// Multiply alternate digits by two\r\n\t\t\tif ($i % 2 == $parity) {\r\n\t\t\t\t$digit*=2;\r\n\t\t\t\t// If the sum is two digits, add them together (in effect)\r\n\t\t\t\tif ($digit > 9) {\r\n\t\t\t\t\t$digit-=9;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Total up the digits\r\n\t\t\t$total+=$digit;\r\n\t\t}\r\n\r\n\t\t// If the total mod 10 equals 0, the number is valid\r\n\t\treturn ($total % 10 == 0) ? TRUE : FALSE;\r\n\r\n\t}", "function validar_dni($dni){\n $letra = substr($dni, -1);\n $numeros = substr($dni, 0, -1);\n if ( substr(\"TRWAGMYFPDXBNJZSQVHLCKE\", $numeros%23, 1) == $letra && strlen($letra) == 1 && strlen ($numeros) == 8 ){\n echo 'valido';\n }else{\n echo 'no valido';\n }\n}", "public function myHash($str) {\n $hash = 0;\n $s = md5($str);\n $seed = 5;\n $len = 32;\n for ($i = 0; $i < $len; $i++) {\n // (hash << 5) + hash 相当于 hash * 33\n //$hash = sprintf(\"%u\", $hash * 33) + ord($s{$i});\n //$hash = ($hash * 33 + ord($s{$i})) & 0x7FFFFFFF;\n $hash = ($hash << $seed) + $hash + ord($s{$i});\n }\n\n return $hash & 0x7FFFFFFF;\n }", "public function processInput()\n {\n foreach ($this->input as $line) {\n # Get the checksum\n $splitString = explode('[', $line);\n $encryptedName = $splitString[0];\n $checksumDirty = $splitString[1];\n\n # Get rid of the square bracket\n $checksumLine = substr(trim($checksumDirty), 0, -1);\n\n list($checksum, $number) = $this->getChecksum($encryptedName);\n if ($checksum == $checksumLine) {\n $this->sum += $number;\n }\n }\n\n return $this->sum;\n }" ]
[ "0.75123715", "0.75123715", "0.7105643", "0.70976377", "0.7041343", "0.6958584", "0.6897897", "0.67599106", "0.6650287", "0.6634824", "0.65252453", "0.6513376", "0.6490912", "0.64551055", "0.642151", "0.6297981", "0.6272884", "0.62656474", "0.6232772", "0.6130845", "0.61121863", "0.61038065", "0.60926414", "0.5978319", "0.59394515", "0.59368706", "0.59300774", "0.5925264", "0.5879669", "0.58302385", "0.5793891", "0.5791677", "0.57731897", "0.5770938", "0.5719228", "0.57019377", "0.5697778", "0.56943285", "0.56744677", "0.5649", "0.56478226", "0.5640791", "0.5640791", "0.5637706", "0.56149065", "0.5613183", "0.560026", "0.5594107", "0.5558923", "0.55433625", "0.55370706", "0.5529021", "0.55249906", "0.5521559", "0.5515505", "0.5483563", "0.5466937", "0.5459929", "0.5459929", "0.5459556", "0.54455703", "0.54114413", "0.5394575", "0.5392081", "0.53920275", "0.5384273", "0.5370059", "0.53632593", "0.5357605", "0.5345647", "0.5339209", "0.5315659", "0.5307172", "0.5300088", "0.5296963", "0.5277646", "0.5268369", "0.52592903", "0.525641", "0.52551305", "0.5241412", "0.5221847", "0.5219284", "0.51911986", "0.51877093", "0.5179892", "0.5163481", "0.5162815", "0.5161248", "0.5153717", "0.51459247", "0.5145552", "0.5137608", "0.51096463", "0.51073307", "0.51073307", "0.5092004", "0.5085181", "0.5084642", "0.5082795" ]
0.6386734
15
Converts query entry to query.
public function getQuery();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toQuery();", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "public static function parse_query( $query ) {\n\t\t\t$helper = Tribe__Admin__Helpers::instance();\n\n\t\t\t// set paged\n\t\t\tif ( $query->is_main_query() && isset( $_GET['tribe_paged'] ) ) {\n\t\t\t\t$query->set( 'paged', $_REQUEST['tribe_paged'] );\n\t\t\t}\n\n\t\t\t// Return early as we don't want to change a post that is not part of the valid group of event post types.\n\t\t\t$valid_post_types = array(\n\t\t\t\tTribe__Events__Main::POSTTYPE,\n\t\t\t\tTribe__Events__Venue::POSTTYPE,\n\t\t\t\tTribe__Events__Organizer::POSTTYPE,\n\t\t\t);\n\t\t\tif (\n\t\t\t\t$query->is_main_query()\n\t\t\t\t&& $query->is_single()\n\t\t\t\t// Make sure we are not in a Post Type declared by the plugin.\n\t\t\t\t&& false === in_array( $query->get( 'post_type' ), $valid_post_types )\n\t\t\t) {\n\t\t\t\treturn $query;\n\t\t\t}\n\n\t\t\t// Don't change query on pages as we might be ina shortcode.\n\t\t\tif ( $query->is_main_query() && $query->is_page() ) {\n\t\t\t\treturn $query;\n\t\t\t}\n\n\t\t\t// Add tribe events post type to tag queries only in tag archives\n\t\t\tif (\n\t\t\t\t$query->is_tag\n\t\t\t\t&& (array) $query->get( 'post_type' ) != array( Tribe__Events__Main::POSTTYPE )\n\t\t\t\t&& ! $helper->is_post_type_screen( 'post' )\n\t\t\t) {\n\t\t\t\t$types = $query->get( 'post_type' );\n\n\t\t\t\tif ( empty( $types ) ) {\n\t\t\t\t\t$types = array( 'post' );\n\t\t\t\t}\n\n\t\t\t\tif ( is_array( $types ) && $query->is_main_query() ) {\n\t\t\t\t\t$types[] = Tribe__Events__Main::POSTTYPE;\n\t\t\t\t} elseif ( $query->is_main_query() ) {\n\t\t\t\t\tif ( is_string( $types ) ) {\n\t\t\t\t\t\t$types = array( $types, Tribe__Events__Main::POSTTYPE );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $types != 'any' ) {\n\t\t\t\t\t\t\t$types = array( 'post', Tribe__Events__Main::POSTTYPE );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$query->set( 'post_type', $types );\n\t\t\t}\n\n\t\t\t$types = ( ! empty( $query->query_vars['post_type'] ) ? (array) $query->query_vars['post_type'] : array() );\n\n\t\t\t// check if any possiblity of this being an event query\n\t\t\t$query->tribe_is_event = ( in_array( Tribe__Events__Main::POSTTYPE, $types ) && count( $types ) < 2 )\n\t\t\t\t? true // it was an event query\n\t\t\t\t: false;\n\n\t\t\t$query->tribe_is_multi_posttype = ( in_array( Tribe__Events__Main::POSTTYPE, $types ) && count( $types ) >= 2 || in_array( 'any', $types ) )\n\t\t\t\t? true // it's a query for multiple post types, events post type included\n\t\t\t\t: false;\n\n\t\t\tif ( 'default' === $query->get( 'eventDisplay' ) ) {\n\t\t\t\t$query->set( 'eventDisplay', Tribe__Events__Main::instance()->default_view() );\n\t\t\t}\n\n\t\t\t// check if any possiblity of this being an event category\n\t\t\t$query->tribe_is_event_category = ! empty ( $query->query_vars[ Tribe__Events__Main::TAXONOMY ] )\n\t\t\t\t? true // it was an event category\n\t\t\t\t: false;\n\n\t\t\t$query->tribe_is_event_venue = ( in_array( Tribe__Events__Main::VENUE_POST_TYPE, $types ) )\n\t\t\t\t? true // it was an event venue\n\t\t\t\t: false;\n\n\t\t\t$query->tribe_is_event_organizer = ( in_array( Tribe__Events__Main::ORGANIZER_POST_TYPE, $types ) )\n\t\t\t\t? true // it was an event organizer\n\t\t\t\t: false;\n\n\t\t\t$query->tribe_is_event_query = ( $query->tribe_is_event\n\t\t\t || $query->tribe_is_event_category\n\t\t\t || $query->tribe_is_event_venue\n\t\t\t || $query->tribe_is_event_organizer )\n\t\t\t\t? true // this is an event query of some type\n\t\t\t\t: false; // move along, this is not the query you are looking for\n\n\t\t\t// is the query pulling posts from the past?\n\t\t\t$past_requested = ! empty( $_REQUEST['tribe_event_display'] ) && 'past' === $_REQUEST['tribe_event_display'];\n\t\t\t$display_past = 'past' === $query->get( 'eventDisplay' );\n\n\t\t\tif ( $query->is_main_query() && $past_requested ) {\n\t\t\t\t$query->tribe_is_past = true;\n\t\t\t} elseif ( tribe_is_ajax_view_request() && ( $display_past || $past_requested ) ) {\n\t\t\t\t$query->tribe_is_past = true;\n\t\t\t} elseif ( $query->get( 'tribe_is_past' ) ) {\n\t\t\t\t$query->tribe_is_past = true;\n\t\t\t} else {\n\t\t\t\t$query->tribe_is_past = isset( $query->tribe_is_past ) ? $query->tribe_is_past : false;\n\t\t\t}\n\n\t\t\t// never allow 404 on month view\n\t\t\tif (\n\t\t\t\t$query->is_main_query()\n\t\t\t\t&& 'month' === $query->get( 'eventDisplay' )\n\t\t\t\t&& ! $query->is_tax\n\t\t\t\t&& ! $query->tribe_is_event_category\n\t\t\t) {\n\t\t\t\t$query->is_post_type_archive = true;\n\t\t\t\t$query->queried_object = get_post_type_object( Tribe__Events__Main::POSTTYPE );\n\t\t\t\t$query->queried_object_id = 0;\n\t\t\t}\n\n\t\t\tif ( tribe_is_events_front_page() ) {\n\t\t\t\t$query->is_home = true;\n\t\t\t} elseif ( $query->tribe_is_event_query ) {\n\t\t\t\t// fixing is_home param\n\t\t\t\t$query->is_home = empty( $query->query_vars['is_home'] ) ? false : $query->query_vars['is_home'];\n\t\t\t\tdo_action( 'tribe_events_parse_query', $query );\n\t\t\t}\n\t\t}", "function addQuery() {}", "function readQuery($query) {\n if (gettype($query) === \"string\") {\n return parent::query($query);\n }\n }", "public function formatQuery(string $query): string;", "public function sanitizeQuery($query) {\n\t\treturn $query;\n\t}", "function normalizeQuery($query) {\n // Remove whitespace at the beginning and end of the query.\n $normalizedQuery = trim($query);\n\n // Substitutes multiple spaces, tabs and newlines for a unique space.\n $normalizedQuery = preg_replace(array('/\\s{2,}/', '/[\\t\\n]/'), ' ', $normalizedQuery);\n\n // Make the query lower cased, as the search functions need a lower case query.\n return strtolower($normalizedQuery);\n}", "public function query() {\n $this->field_alias = $this->real_field;\n }", "protected static function filterToQuery($filter, array $opts = [])\n {\n $filter = static::castForDB($filter);\n $filter = static::mapToFields($filter);\n\n $opts += ['deleted' => false]; // Defaults to no deleted\n\n if ($opts['deleted'] === 'only' || in_array('from-trash', $opts, true)) {\n $filter['_deleted'] = true;\n } elseif ($opts['deleted'] !== 'included' && !in_array('include-trash', $opts, true)) {\n $filter['_deleted'] = null;\n }\n\n return DB::filterToQuery($filter);\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "protected function toQuery()\n\t{\n\t\treturn $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder())->first();\n\t}", "public function query($query) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t// We do table/key replacement here\n\t\t$query = $this->replace_tables($query);\n\t\tif (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax\n\t\t\t$args = $args[0];\n\t\t}\n\t\tif ($args) {\n\t\t\tZend_Gdata_Fusion_Utils::query_callback($args, TRUE);\n\t\t\t$query = preg_replace_callback(DB_QUERY_REGEXP, array('Zend_Gdata_Fusion_Utils', 'query_callback'), $query);\n\t\t}\n\t\treturn $this->_query($query);\n\t}", "static public function objectToQuery($type)\n\t{\n\t\treturn QuickBooks_Utilities::actionToObject($type) . 'Query';\n\t}", "protected function convertQuery(Zend_Search_Lucene_Search_Query $query, $context = null) {\n // Clear the query stack\n $this->queryStack = array();\n \n // Delegare to the query-specific conversion method\n $parts = explode('_', get_class($query));\n $functionName = \"convertQuery_\".array_pop($parts);\n return $this->$functionName($query, $context);\n }", "protected function toQuery() {\n\t\t$query = $this->mapper()->all($this->entityName(), $this->conditions())->order($this->relationOrder());\n\t\t$query->snapshot();\n\t\treturn $query;\n\t}", "public function rawQuery($query);", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "private function createSingleResultQuery(array &$queryParameters): string\n {\n // Get the base query\n $query = $this->createBaseQuery();\n\n // Add the ID to the query\n $query .= 'AND entries.id = :entry_id ';\n\n $queryParameters[] = new Parameter('entry_id', $this->propertyFilters['id']['='], Types::STRING);\n\n return $query;\n }", "protected function _prepare_entry ($entry)\n {\n parent::_prepare_entry ($entry);\n\n $db = $this->db;\n $entry->kind = $db->f ('entry_kind');\n\n switch ($entry->type)\n {\n case 'change':\n $entry->number = $db->f ('chng_number');\n $entry->job_id = $db->f ('chng_job_id');\n break;\n case 'job':\n $entry->time_created->set_from_iso ($db->f ('job_time_created'));\n $branch_info = $entry->main_branch_info ();\n $branch_info->status = $db->f ('job_status');\n $branch_info->priority = $db->f ('job_priority');\n $branch_info->time_closed->set_from_iso ($db->f ('job_time_closed'));\n $branch_info->closer_id = $db->f ('job_closer_id');\n break;\n }\n }", "public function get_query(){\n return $this->build_query()->query;\n }", "public function setQuery($query)\n {\n $oldQuery = parent::setQuery($query);\n\n if (! $this->_useSquareBracketNotation) {\n $this->_query = preg_replace('#%5B.*?%5D#', '', $this->_query);\n }\n\n return $oldQuery;\n }", "abstract protected function buildQuery(): string;", "abstract function query( $p_filter_input );", "public abstract function get_query();", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function hm_modify_parse_query( $wp_query ) {\n\n\tglobal $hm_rewrite_rules, $hm_current_rewrite_rule, $wp_the_query;\n\n\tif ( $wp_the_query != $wp_query )\n\t\treturn;\n\n\tif ( isset( $hm_current_rewrite_rule ) && $hm_current_rewrite_rule[4] === $wp_query->query ) {\n\n\t\t$hm_current_rewrite_rule[3]['parse_query_properties'] = wp_parse_args( ( isset( $hm_current_rewrite_rule[3]['parse_query_properties'] ) ? $hm_current_rewrite_rule[3]['parse_query_properties'] : '' ), array( 'is_home' => false ) );\n\n\t\t// Apply some post query stuff to wp_query\n\t\tif ( isset( $hm_current_rewrite_rule[3]['parse_query_properties'] ) ) {\n\n\t\t\t// $post_query\n\t\t\tforeach( wp_parse_args( $hm_current_rewrite_rule[3]['parse_query_properties'] ) as $property => $value )\n\t\t\t\t$wp_query->$property = $value;\n\n\t\t}\n\t}\n\n}", "private function processQueryParameters(): void\n {\n // Check if a collection alias was defined\n $matches = [];\n preg_match_all('~(IN @\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $matches = array_pop($matches);\n\n if (count($matches)) {\n // Stores if found.\n $collection = [];\n $match = array_pop($matches);\n preg_match_all('~(@\\w+)~', $match, $collection, PREG_PATTERN_ORDER);\n $occurrence = array_shift($collection);\n $this->collectionAlias = array_pop($occurrence);\n }\n\n $matches = [];\n preg_match_all('~(@\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $this->queryParameters = array_pop($matches);\n }", "private function parse_query( $query ) {\n\n\t\treturn json_decode( json_encode( $query ) );\n\n\t}", "public function query() {\n if (!empty($this->value)) {\n $this->ensureMyTable();\n $field = \"$this->tableAlias.nid\";\n\n $configuration = array(\n 'type' => 'INNER',\n 'table' => 'menu_link_content_data',\n 'field' => 'link__uri',\n 'left_table' => 'node_field_data',\n 'left_field' => 'nid',\n 'operator' => '=',\n );\n $join = Views::pluginManager('join')->createInstance('standard', $configuration);\n $this->query->addRelationship('my_uu', $join, 'node_field_data');\n $this->query->addWhere($this->options['group'], $field, $this->value, '=');\n }\n }", "public function query($query);", "public function query($query);", "public function query($query);", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "private function buildQuery()\n {\n $params = JComponentHelper::getParams('com_easybookreloaded');\n\n // If type is feed, then the order has to be DESC to get the latest entries in the feed reader\n $document = JFactory::getDocument();\n\n if($document->getType() == 'feed')\n {\n $order = 'DESC';\n }\n else\n {\n $order = $params->get('entries_order', 'DESC');\n }\n\n // Check whether limit is already set - e.g. from feed function\n $limit = JFactory::getApplication()->input->getInt('limit', 0);\n\n if(empty($limit))\n {\n $limit = (int)$params->get('entries_perpage', 5);\n }\n\n $start = JFactory::getApplication()->input->getInt('limitstart', 0);\n\n if(_EASYBOOK_CANEDIT)\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n else\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" WHERE \".$this->_db->quoteName('published').\" = 1 ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n\n return $query;\n }", "private function rewriteExactMatch(string $query): string\n\t{\n\t\treturn (string) preg_replace_callback('/\"([^\"]+)\"/', fn(array $match): string => '{%column% LIKE \\'%' . $this->escapeLikeString($match[1]) . '%\\'}', $query);\n\t}", "private function _normalizeQuery($query)\n\t{\n\n\t\t//Check query\n\t\tif($query === NULL)\n\t\t\treturn array();\n\n\t\t$ret = array();\n\t\tforeach($query as $key=>$val)\n\t\t{\n\t\t\tif($val instanceof \\Framework\\Interfaces\\IModelDataType)\n\t\t\t\t$value = $this->_driver->convertModelDataTypeToNativeDataType($val);\n\t\t\telse\n\t\t\t\t$value = $val;\n\n\t\t\t$ret[$key] = $value;\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function modifyQuery(QueryInterface $query)\n {\n return $query;\n }", "static public function convertActionToQuery($action)\n\t{\n\t\treturn QuickBooks_Utilities::objectToQuery(QuickBooks_Utilities::actionToObject($action));\n\t}", "public function query(QueryObject $query);", "private function sanitizeSearchQuery($query)\n {\n return $query;\n //return preg_replace('/[^[:alnum:] ]/', '', trim(preg_replace('/[[:space:]]+/', ' ', $query)));\n }", "protected abstract function sanitizeQuery($query);", "public function parseQuery($query = null)\n {\n $baseQuery = $this->getModel()->newQuery();\n\n if (is_callable($query)) {\n $query = $query($baseQuery);\n }\n\n return $query ?? $baseQuery;\n }", "function query() {\n // Don't filter if we're exposed and the checkbox isn't selected.\n\n if ((!empty($this->options['exposed'])) && empty($this->value)) {\n return;\n }\n if (!$this->options['exposed']) {\n $value = $this->options['uid'];\n }\n else {\n $value = $this->validated_exposed_input[0];\n }\n\n\n $this->ensure_my_table();\n\n\n $table = 'scheduling_appointments';\n //$field1 = $this->query->add_field($table, 'nid');\n //$field2 = $this->query->add_field($table, 'title');\n\n\n //$field1 = $table . '.nid';\n //$field2 = $table . '.title';\n if ($value != '') {\n $this->query->add_where(\n $this->options['group'],\n db_and()\n ->condition($table . '.uid', $value, '=')\n );\n }\n }", "public static function queryString($query)\n {\n if (app()->environment() === 'development') {\n return $query->toSql();\n }\n }", "public function transformAstToQuery(AstNode $query) {\n switch (true) {\n case $query instanceof Conjunction:\n // We map conjunctions into `and`-filters.\n return ['bool' => [\n 'must' => array_map([$this, 'transformAstToQuery'], $query->getArrayCopy())\n ]];\n\n case $query instanceof Disjunction:\n // ... and disjunctions into `or`-filters\n return ['bool' => [\n 'should' => array_map([$this, 'transformAstToQuery'], $query->getArrayCopy()),\n 'minimum_should_match' => 1\n ]];\n\n case $query instanceof Field:\n // We have a field, so let's look at the type of comparison we\n // are making, to determine how to transform it into a ES-php\n // DSL query\n $field = 'metadata.' . $query->field();\n $comparison = $query->comparison();\n\n switch (true) {\n case $comparison instanceof Equals:\n // Equality we make into `match`-queries\n if ($comparison->value() === '') {\n // Elastic doesn't support matches against empty\n // values. Instead we can do something equiv. to it\n // using the wildcard- and exists-operator\n return ['bool' => [\n 'must_not' => [\n 'wildcard' => [\n $field => '*',\n ],\n ],\n 'must' => [\n ['exists' => [\n 'field' => $field,\n ]],\n ],\n ]];\n }\n\n return ['match' =>\n [$field => $comparison->value()]\n ];\n\n case $comparison instanceof NotEquals:\n // And not-equals we make into a `bool`-filter with a\n // `must_not`-clause containing a `match`-qyuery inside\n // it\n if ($comparison->value() === '') {\n // Except if you are trying to find something that\n // isn't empty - because Elastic doesn't support that\n // so we use a wildcard-operator to do something\n // equivalent\n return ['wildcard' => [\n $field => '*',\n ]];\n }\n\n return ['bool' => ['must_not' => ['match' =>\n [$field => $comparison->value()]\n ]]];\n\n case $comparison instanceof In:\n // We make in-set checks into a `terms`-filter\n return ['terms' => [\n $field => $comparison->value(),\n ]];\n\n case $comparison instanceof NotIn:\n // And likewise a not-in into a `bool`-filter with a\n // `must_not`-clause containing a `terms`-filter.\n return ['bool' => ['must_not' => ['terms' => [\n $field => $comparison->value(),\n ]]]];\n\n case $comparison instanceof LessThan:\n // Less-than we do with a `range`-filter\n return ['range' => [\n $field => [\n 'lt' => $comparison->value(),\n ],\n ]];\n\n case $comparison instanceof LessThanEquals:\n // And like-wise with less-than-or-equals\n return ['range' => [\n $field => [\n 'lte' => $comparison->value(),\n ],\n ]];\n\n case $comparison instanceof GreaterThan:\n // ... and with greater-than\n return ['range' => [\n $field => [\n 'gt' => $comparison->value(),\n ],\n ]];\n\n case $comparison instanceof GreaterThanEquals:\n // and unsurprisingly also with greater-than-or-equals\n return ['range' => [\n $field => [\n 'gte' => $comparison->value(),\n ],\n ]];\n\n case $comparison instanceof Exists:\n if ($comparison->value()) {\n return ['exists' => [\n 'field' => $field,\n ]];\n } else {\n return ['bool' => [\n 'must_not' => [\n 'exists' => [\n 'field' => $field,\n ],\n ],\n ]];\n }\n }\n }\n }", "public function query($query) {\n\t\t$query = \"\nPREFIX sioc: <http://rdfs.org/sioc/ns#>\nPREFIX sioct: <http://rdfs.org/sioc/types#>\nPREFIX foaf: <http://xmlns.com/foaf/0.1/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX dc: <http://purl.org/dc/elements/1.1/>\nPREFIX dct: <http://purl.org/dc/terms/>\nPREFIX tags: <http://www.holygoat.co.uk/owl/redwood/0.1/tags/>\nPREFIX moat: <http://moat-project.org/ns#>\nPREFIX opo: <http://online-presence.net/opo/ns#>\nPREFIX opo-actions: <http://online-presence.net/opo-actions/ns#>\nPREFIX ctag: <http://commontag.org/ns#>\nPREFIX smob: <http://smob.me/ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX rev: <http://purl.org/stuff/rev#>\nPREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>\n$query\n\";\n\t\treturn $query;\n\t}", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function queryFilter($query)\n {\n global $pagenow;\n\n if (!is_admin() || !$pagenow || $pagenow !== 'edit-comments.php' || !isset($_GET['post_type']) || !$_GET['post_type']) {\n return;\n }\n\n $query->set('post_type', $_GET['post_type']);\n }", "public function __invoke($query, $input)\n {\n $arguments = $this->getFilterParams($input);\n \n // Convert the invoice_date parameter to created_at parameter\n if ( isset($arguments['invoice_date'])) {\n\n $arguments['created_at'] = $arguments['invoice_date'];\n\n unset($arguments['invoice_date']);\n }\n\n // Convert the grand_total parameter to base_grand_total parameter\n if ( isset($arguments['grand_total'])) {\n\n $arguments['base_grand_total'] = $arguments['grand_total'];\n\n unset($arguments['grand_total']);\n }\n\n return $query->where($arguments);\n }", "public function createQuery(): QueryInterface;", "public function add_query_filter_wptc(){\n\t\t// add_filter('query', array($this->hooks_handler_obj, 'wtc_record_query'), 10);\n\t}", "public function setQuery($query)\n\t{\n\t\t$query = trim($query);\n\t\t$query = preg_replace('# {2,}#', ' ', $query);\n\t\t$query = Strings::utf8_strtolower($query);\n\t\t$query = Strings:: utf8_accents_to_ascii($query);\n\n\t\t$this['query'] = $query;\n\t}", "public function newQuery();", "function change_query($request = NULL, $user_query = NULL) {\n $default_query = array(\n 'case' => 'select',\n 'query' => QUERY_SELECT_ALL\n );\n if (!empty($request) && !is_bool($request)) {\n $getValue = array_keys($request);\n $sanitized_req = filter_var($getValue[0], FILTER_SANITIZE_STRING);\n switch ($sanitized_req) {\n case 'IMG' :\n $this->query = array(\n 'case' => 'real_img',\n 'query' => QUERY_SELECT_IMG\n );\n break;\n case 'INFO' :\n $this->query = array(\n 'case' => 'api',\n 'query' => QUERY_SELECT_JSON\n );\n break;\n default :\n $this->query = $default_query;\n }\n } else if (is_bool($request)) {\n $this->query = array(\n 'case' => 'insert',\n 'query' => $user_query\n );\n } else {\n $this->query = $default_query;\n }\n }", "function transformEntry($timeTrackerEntry);", "function createQuery() ;", "public function updateQueryTranslation(Query $query, string $locale, QueryTranslationUpdateStruct $translationUpdateStruct): Query;", "function query() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\t$sql = array_shift($args);\r\n\t\t\tforeach ($args as $key => $value)\r\n\t\t\t\t$args[$key] = $this->clean($value);\r\n\t\t\treturn mysql_query(vsprintf($sql, $args));\r\n\t\t}", "protected static function normalizeQuery($query)\n {\n $query = self::encodeQueryFragment(\n self::decodeUrlEncodedChars(\n $query,\n '/[' . self::CHAR_UNRESERVED . self::CHAR_QUERY_DELIMS . ':@\\/\\?]/'\n )\n );\n\n return $query;\n }", "protected function getOriginalFormatQuery()\n {\n return $this->originalFormatQuery;\n }", "protected function _transformQuery()\n {\n if (!$this->_dirty || $this->_type !== 'select') {\n return;\n }\n\n if (empty($this->_parts['from'])) {\n $this->from([$this->_repository->getAlias() => $this->_repository->table()]);\n }\n $this->_addDefaultFields();\n $this->getEagerLoader()->attachAssociations($this, $this->_repository, !$this->_hasFields);\n $this->_addDefaultSelectTypes();\n }", "function simplenews_build_issue_filter_query(EntityFieldQuery $query) {\n if (isset($_SESSION['simplenews_issue_filter'])) {\n foreach ($_SESSION['simplenews_issue_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n case 'newsletter':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->fieldCondition(variable_get('simplenews_newsletter_field', 'simplenews_newsletter'), 'target_id', $value);\n }\n break;\n }\n }\n }\n}", "public function withQuery($query): self\n {\n $query = $this->formatQueryAndFragment($this->filterString($query));\n if ('' === $query) {\n $query = null;\n }\n\n if ($query === $this->query) {\n return $this;\n }\n\n $clone = clone $this;\n $clone->query = $query;\n $clone->assertValidState();\n\n return $clone;\n }", "private function preprocessQuery($query, string $endpoint) {\n if ($endpoint === 'reverse' && is_array($query) && count($query) === 2) {\n list($latitude, $longitude) = $query;\n\n if (is_numeric($latitude) && is_numeric($longitude)) {\n return $latitude . ',' . $longitude;\n }\n }\n\n return $query;\n }", "abstract protected function getQuery();", "public function buildQuery() {\n\t\t\tif (isset($this->postTypes[$this->postType])) {\n\t\t\t\t$this->SetFilter('type', array($this->postTypes[$this->postType] + 1));\n\t\t\t}\n\t\t\t$this->SetFilter('status', array(1));\n\t\t\tswitch ($this->matchMode) {\n\t\t\t\tcase 'any';\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetMatchMode(SPH_MATCH_ALL);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch ($this->sortMode) {\n\t\t\t\tcase 'posted':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, 'posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, '@relevance DESC, posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'top':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXPR, 'upvotes - downvotes + @weight + LN(posted) * 1000');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->SetLimits((int) $this->currentPage, (int) $this->pageLimit, (int) $this->resultLimit);\n\t\t}", "public function __toString() {\n return $this->query;\n }", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "abstract protected function initQuery(Query $query): Query;", "abstract public function newQuery();", "protected function _hydrateEntry($entry) {\n\t\t//echo \"Hydrating: \"; print_r($entry);\n\t\t\n\t\tif ($entry->published && is_numeric($entry->published)) {\n\t\t\t$entry->published = date('c', $entry->published);\n\t\t}\n\n\t\tif ($entry->updated && is_numeric($entry->updated) && $entry->updated>0) {\n\t\t\t$entry->updated = date('c', $entry->updated);\n\t\t}\n\t\t\n\t\tif ($entry->author_id) {\n\t\t\t$entry->author = $this->getAuthorById($entry->author_id);\n\t\t\t//echo \"Hydrating author: \"; print_r($entry->author);\n\t\t\tunset($entry->author_id);\n\t\t}\n\t\t\n\t\treturn $entry;\n\t}", "public final function query( $query ) {\n return $this->_query( $query );\n }", "public function createQuery()\n {\n $query = $this->persistenceManager->createQueryForType($this->objectType);\n if ($this->defaultOrderings !== []) {\n $query->setOrderings($this->defaultOrderings);\n }\n if ($this->defaultQuerySettings !== null) {\n $query->setQuerySettings(clone $this->defaultQuerySettings);\n }\n return $query;\n }", "public function query() {\n // Leave empty to avoid a query on this field.\n }", "private function makeQuery($gid) {\n\t\t$query = 'editions:' . $gid . '';\n\n\t\treturn urlencode($query);\n\t}", "private function sanitizeSearchQuery(string $query): string\n {\n return trim(preg_replace('/[[:space:]]+/', ' ', $query));\n }", "protected function parse_query($query) {\n $this->query = array();\n if ($query)\n foreach (explode('&', $query) as $p) {\n list($k, $v) = explode('=', $p);\n if ($k) $this->query[urldecode($k)] = urldecode($v);\n }\n return $this;\n }", "public function apply($query)\n {\n $member_id = request('member_id');\n $inviter_id = request('inviter_id');\n\n if ($member_id) {\n return $query->where('id', $member_id);\n }\n if ($inviter_id) {\n return $query->where('inviter_id', $inviter_id);\n }\n }", "public function comment_query ()\n {\n include_once ('webcore/db/entry_comment_query.php');\n return new ENTRY_COMMENT_QUERY ($this);\n }", "function query() {}", "public function get_query_args() {\n\t\t$args = $this->args;\n\n\t\tif ( empty( $args['meta_query'] ) ) {\n\t\t\t// Add new meta key/value if `meta_key` or `meta_value` is empty.\n\t\t\tif ( empty( $args['meta_key'] ) || empty( $args['meta_value'] ) ) {\n\t\t\t\t$args['meta_key'] = papi_get_page_type_key();\n\t\t\t\t$args['meta_value'] = $args['entry_type'];\n\t\t\t} else if ( papi_entry_type_exists( $args['entry_type'] ) ) {\n\t\t\t\t$item = [\n\t\t\t\t\t'key' => $args['meta_key'],\n\t\t\t\t\t'value' => $args['meta_value']\n\t\t\t\t];\n\n\t\t\t\t// Add `meta_compare` if set.\n\t\t\t\tif ( isset( $args['meta_compare'] ) ) {\n\t\t\t\t\t$item['compare'] = $args['meta_compare'];\n\n\t\t\t\t\tunset( $args['meta_compare'] );\n\t\t\t\t}\n\n\t\t\t\t// Add new meta query item.\n\t\t\t\t$args['meta_query'][] = $item;\n\n\t\t\t\t// Add Papi entry/page type meta query.\n\t\t\t\t$args['meta_query'][] = [\n\t\t\t\t\t'key' => papi_get_page_type_key(),\n\t\t\t\t\t'value' => $args['entry_type']\n\t\t\t\t];\n\n\t\t\t\t// Add meta query relation when two query items.\n\t\t\t\tif ( isset( $args['relation'] ) ) {\n\t\t\t\t\t$args['meta_query']['relation'] = $args['relation'];\n\t\t\t\t} else {\n\t\t\t\t\t$args['meta_query']['relation'] = 'AND';\n\t\t\t\t}\n\n\t\t\t\tunset( $args['meta_key'] );\n\t\t\t\tunset( $args['meta_value'] );\n\t\t\t}\n\t\t} else if ( papi_entry_type_exists( $args['entry_type'] ) ) {\n\t\t\t// Add Papi entry/page type meta query.\n\t\t\t$args['meta_query'][] = [\n\t\t\t\t'key' => papi_get_page_type_key(),\n\t\t\t\t'value' => $args['entry_type']\n\t\t\t];\n\n\t\t\t// Add meta query relation if not set.\n\t\t\tif ( ! isset( $args['meta_query']['relation'] ) ) {\n\t\t\t\t$args['meta_query']['relation'] = 'AND';\n\t\t\t}\n\t\t}\n\n\t\t// Since the real query classes don't support\n\t\t// custom arguments the should be deleted.\n\t\tforeach ( array_keys( $this->default_args ) as $key ) {\n\t\t\tif ( isset( $args[$key] ) ) {\n\t\t\t\tunset( $args[$key] );\n\t\t\t}\n\t\t}\n\n\t\treturn $args;\n\t}", "private function toQuery ($item, $fields = null, $join = ',') {\n $query = '';\n // Get the keys. Apply the filter criteria if specified.\n $keys = $fields\n ? array_intersect(explode(',', $fields), array_keys(get_object_vars($item)))\n : array_keys(get_object_vars($item));\n // Create the key - value pair string.\n foreach ($keys as $key) {\n $query .= $key . '=\\'' . $item->$key . '\\'' . $join;\n }\n return rtrim($query, $join);\n }", "public function prepare_query($query = array()) {\n\n // Invoking parent method to build the query string\n parent::prepare_query($query);\n\n // Injecting custom query string for taxonomy\n if (isset($this->query['tax_query'])) {\n global $wpdb;\n\n $tax_query = new WP_Tax_Query($this->query['tax_query']);\n $taxsql = $tax_query->get_sql($wpdb->users, 'ID');\n\n if (!empty($taxsql['join'])) {\n $this->query_from .= $taxsql['join'];\n $this->query_where .= $taxsql['where'];\n }\n\n }\n }", "protected function setQueryParameters($query)\n {\n // Exceptions\n if (!isset($this->task)) {\n throw new \\Exception(__METHOD__ . ': task is not set. Please set it with ' . __CLASS__ . '::init() !');\n }\n\n switch ($this->task) {\n case self::TASK_SEARCH_PHRASE_BY_LANG:\n $query->andWhere(self::FIELD_RESOURCE . ' IN (?2)')\n ->andWhere(self::FIELD_LOCALE . ' = ?3')\n ->andWhere(self::FIELD_TRANSLATION_TYPE . ' = ?4')\n ->andWhere(self::FIELD_DELETED_DATE . ' IS NULL')\n ->andWhere(self::FIELD_EXPIRY_DATE . ' IS NULL')\n ->andWhere(self::FIELD_TARGET . ' LIKE ?1')\n ->setParameter(1, $this->searchString)\n ->setParameter(2, $this->resources)\n ->setParameter(3, $this->locale)\n ->setParameter(4, $this->translationType)\n ->addOrderBy(ResourceRepo::FIELD_NAME, 'ASC')\n ->addOrderBy(self::FIELD_TARGET, 'ASC');\n\n break;\n case self::TASK_ALL_CONTENT_BY_LANG:\n case self::TASK_ALL_CONTENT_BY_RES:\n if (!empty($this->resources)) {\n $query->andWhere(self::FIELD_RESOURCE . ' IN (?3)')\n ->setParameter(3, $this->resources);\n }\n\n $query->andwhere(self::FIELD_LOCALE . ' IN (?1)')\n ->andWhere(self::FIELD_TRANSLATION_TYPE . ' = ?2')\n ->andWhere(self::FIELD_DELETED_DATE . ' IS NULL')\n ->andWhere(self::FIELD_EXPIRY_DATE . ' IS NULL')\n ->andWhere(self::FIELD_TRANSLATE_ME . ' = 0');\n\n if ($this->locale == $this->commonLanguageId) {\n $query->andWhere(self::FIELD_RELEASED . ' = 1');\n }\n\n $query->setParameter(1, $this->locales)\n ->setParameter(2, $this->translationType);\n\n break;\n case self::TASK_SEARCH_FLAGGED_TEXTS:\n $query->andWhere(self::FIELD_RESOURCE . ' IN (?1)')\n ->setParameter(1, $this->resources);\n\n if (!empty($this->locale)) {\n $query->andWhere(self::FIELD_LOCALE . ' = ?3')\n ->setParameter(3, $this->locale);\n }\n if (!empty($this->locales)) {\n $query->andWhere(self::FIELD_LOCALE . ' IN (?4)')\n ->setParameter(4, $this->locales);\n }\n\n $query->andWhere(self::FIELD_TRANSLATION_TYPE . ' = ?2')\n ->setParameter(2, $this->translationType)\n ->andWhere(self::FIELD_DELETED_DATE . ' IS NULL');\n\n if (!empty($this->expiryDate)) {\n // expired texts\n $query->andWhere(self::FIELD_EXPIRY_DATE . ' <= ?5')\n ->setParameter(5, $this->expiryDate);\n } else {\n // non released texts\n $query->andWhere(self::FIELD_EXPIRY_DATE . ' IS NULL')\n ->andWhere(self::FIELD_RELEASED . ' IS NULL OR ' . self::FIELD_RELEASED . ' = 0');\n }\n\n $query->addOrderBy(ResourceRepo::FIELD_NAME, 'ASC')\n ->addOrderBy(LanguageRepo::FIELD_LOCALE, 'ASC')\n ->addOrderBy(self::FIELD_TARGET, 'ASC');\n\n break;\n case self::TASK_SEARCH_BY_TRANSLATED_STATUS:\n $query->andWhere(self::FIELD_RESOURCE . ' IN (?1)')\n ->setParameter(1, $this->resources);\n\n if (!empty($this->locale)) {\n $query->andWhere(self::FIELD_LOCALE . ' = ?3')\n ->setParameter(3, $this->locale);\n }\n if (!empty($this->locales)) {\n $query->andWhere(self::FIELD_LOCALE . ' IN (?4)')\n ->setParameter(4, $this->locales);\n }\n\n $query->andWhere(self::FIELD_TRANSLATION_TYPE . ' = ?2')\n ->setParameter(2, $this->translationType)\n ->andWhere(self::FIELD_DELETED_DATE . ' IS NULL');\n\n $query->andWhere(self::FIELD_TRANSLATE_ME . ' = ?5')\n ->setParameter(5, intval(!$this->translated));\n\n $query->addOrderBy(LanguageRepo::FIELD_LOCALE, 'ASC')\n ->addOrderBy(self::FIELD_SOURCE, 'ASC');\n\n break;\n case self::TASK_MISSING_TRANS_BY_LANG:\n default:\n $query->where(self::FIELD_RESOURCE . ' IN (?1)')\n ->andWhere(self::FIELD_LOCALE . ' = ?2')\n ->andWhere(self::FIELD_TRANSLATION_TYPE . ' = ?3')\n ->andWhere(self::FIELD_DELETED_DATE . ' IS NULL')\n ->andWhere(self::FIELD_EXPIRY_DATE . ' IS NULL')\n ->andWhere(self::FIELD_TRANSLATE_ME . ' = 1')\n ->andWhere(self::FIELD_RELEASED . ' = 1')\n ->andWhere(self::FIELD_DONTTRANSLATE . ' IS NULL OR ' . self::FIELD_DONTTRANSLATE . ' = 0')\n // just get the unflagged translations\n // 0 = open state, 1 = already sent to translation service\n ->andWhere(self::FIELD_TS . ' IS NULL OR ' . self::FIELD_TS . ' = 0')\n ->setParameter(1, $this->resources)\n ->setParameter(2, $this->locale)\n ->setParameter(3, $this->translationType);\n\n $query->addOrderBy(ResourceRepo::FIELD_NAME, 'ASC')\n ->addOrderBy(self::FIELD_SOURCE, 'ASC');\n\n break;\n }\n }", "protected function convertQuery_Term(Zend_Search_Lucene_Search_Query_Term $query, $context = null) {\n // A term query just holds... er... a query term\n array_push($this->queryStack, $query);\n $nativeQuery = $this->convertTerm($query->getTerm(), $context);\n array_pop($this->queryStack);\n \n return $nativeQuery;\n }", "public function getQuery(): string\n {\n return (string) $this->query;\n }", "public function getQuery(Builder $query);" ]
[ "0.6020657", "0.5705051", "0.53866863", "0.53828233", "0.53366524", "0.5314558", "0.53043824", "0.5262684", "0.5261943", "0.5250271", "0.5226067", "0.5226067", "0.52099454", "0.52002275", "0.5148248", "0.5147306", "0.51470685", "0.5107476", "0.51037675", "0.5099964", "0.5094104", "0.5091153", "0.50732946", "0.50711846", "0.5061723", "0.50524205", "0.5030018", "0.501414", "0.50137085", "0.5004731", "0.49807563", "0.49785367", "0.49785367", "0.49785367", "0.49558592", "0.49325183", "0.4921603", "0.49213937", "0.49043286", "0.49043286", "0.49043286", "0.49026224", "0.4891933", "0.48884457", "0.48880997", "0.48694578", "0.48672068", "0.4865252", "0.48623866", "0.48521936", "0.48475856", "0.48472998", "0.48364398", "0.48364398", "0.48364398", "0.48364398", "0.48364398", "0.48364398", "0.48364398", "0.48364398", "0.48364398", "0.4835341", "0.48262307", "0.48178104", "0.48154688", "0.4812052", "0.4806896", "0.48060685", "0.48053458", "0.48024344", "0.48013857", "0.47933322", "0.47746035", "0.47694835", "0.47567677", "0.47510865", "0.474831", "0.4742089", "0.47412422", "0.47398272", "0.4728861", "0.47265553", "0.47216105", "0.47210765", "0.47113925", "0.47113022", "0.47108158", "0.47065163", "0.4683031", "0.46802792", "0.46779534", "0.4676879", "0.46744484", "0.46728206", "0.46670002", "0.46655756", "0.4663999", "0.46635932", "0.4662484", "0.46486676", "0.4643401" ]
0.0
-1
Decodes data in JSON format.
public function decode(string $json) { // max depth is 0+ for json_encode(), and 1+ for json_decode() $result = json_decode($json, $this->decodeObjectAsArray, $this->maxDepth + 1, $this->options); $this->checkLastError(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function decode($data) {\n return $this->encoder->decode($data->get('json_data'), \"json\");\n }", "protected function get_decoded_data() {\n return json_decode($this->get_data());\n }", "private function decode_data ( $data ) {\n $cleanedData = $this->security->xss_clean ( $data );\n return json_decode ( $cleanedData, true ); \n }", "public function getDecodedJsonData()\n {\n return $this->decodedJsonData;\n }", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function _unserialize($data)\n\t{\n\t\treturn json_decode($data, TRUE);\n\t}", "protected static function data_decode($data) {\n //Return decoded data\n\t\t\tif (! self::valid($data)) {\n\t\t\t\t//Return a stdObj with failure codes and message\n\t\t\t\t$failure = new stdClass();\n\t\t\t\t$failure->code = -1;\n\t\t\t\t$failure->message = 'OandaWrap throws curl error: ' . curl_error(self::$socket);\n\n\t\t\t\treturn $failure;\n\t\t\t}\n\n\t\t\treturn json_decode(($decoded = @gzinflate(substr($data,10,-8))) ? $decoded : $data);\n\t\t}", "public function decode($data);", "protected function decodeArrrayJsonContent()\n {\n return json_decode($this->getJsonContent(), true);\n }", "public function getJsonData() {\n\t\treturn FormatJson::decode( $this->getNativeData(), true );\n\t}", "function getData(){ \n return json_decode($this->data); \n }", "public function getData(){ \n return json_decode($this->data); \n }", "protected function _jsonDecode($data, $asArray = true)\n {\n $ret = json_decode($data, $asArray);\n $this->_checkJsonError($data);\n\n // return the array\n return $ret;\n }", "public function decode($json);", "public function deserialize($data);", "abstract public function decode($data);", "public static function fromJson($data)\n {\n return json_decode($data, true);\n }", "protected function jsonDecode(array $data)\n {\n foreach ($data as &$value) {\n if (is_array($value)) {\n $value = $this->jsonDecode($value);\n } else {\n $value = json_decode($value, true, 512, JSON_THROW_ON_ERROR);\n }\n }\n\n return $data;\n }", "protected function getData()\n {\n if($this->jsonData === null)\n {\n $rawData = parent::getData();\n $this->jsonData = json_decode($rawData, true); // the second parameter turns JSON-objects into associative arrays which makes extracting the record fields easier\n if ($this->jsonData === null)\n {\n $error = json_last_error();\n // In case of an error 500, FF 6.6 does not return valid JSON; try to fix it\n $this->jsonData = json_decode('{'.$rawData.'}', true);\n if ($this->jsonData === null)\n throw new InvalidArgumentException('json_decode() raised error '.$error);\n }\n }\n return $this->jsonData;\n }", "protected function jsonDecode(array $data)\n {\n foreach ($data as &$value) {\n if (\\is_array($value)) {\n $value = $this->jsonDecode($value);\n } else {\n $value = json_decode($value, true);\n }\n }\n\n return $data;\n }", "protected function decodeData($value) {\n\t\treturn wireDecodeJSON($value);\n\t}", "private function process($data) {\n\t\treturn json_decode($data, true);\n\t}", "function json_decode($data, $output_as_array) {\n\t\t\t$json_mode = $output_as_array ? SERVICES_JSON_LOOSE_TYPE : null;\n\t\t\t$json = new Services_JSON($json_mode);\n\t\t\treturn($json->decode($data));\n\t\t}", "public function decode($data)\n {\n $decoded = @json_decode($data, true);\n if ($decoded && isset($decoded['content']))\n return $decoded['content'];\n else\n return null;\n }", "public function deserialize($data)\n {\n }", "private function unpackData()\n {\n return json_decode($this->packedData, true);\n }", "public static function DecodeJson (& $jsonStr);", "public function decode()\n {\n return json_decode(trim($this->body), true);\n }", "public static function decodeJSON()\n {\n $body = file_get_contents('php://input');\n $object = json_decode($body);\n \n return $object;\n }", "public function json()\n {\n if (! $this->decoded) {\n $this->decoded = json_decode($this->response, true);\n }\n\n return $this->decoded;\n }", "public function deserialize(string $data)\n {\n if( $this->deserializer ){\n return \\call_user_func($this->deserializer, $data);\n }\n\n return \\json_decode($data);\n }", "private function response($data) {\n\t\treturn json_decode($data);\n\t}", "function JDecode($arr){\r\n\t\tif (version_compare(PHP_VERSION,\"5.2\",\"<\"))\r\n\t\t{ \r\n\t\t\trequire_once(\"./JSON.php\"); //if php<5.2 need JSON class\r\n\t\t\t$json = new Services_JSON();//instantiate new json object\r\n\t\t\t$data=$json->decode($arr); //decode the data in json format\r\n\t\t} else {\r\n\t\t\t$data = json_decode($arr); //decode the data in json format\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function JDecode($arr){\r\n\t\tif (version_compare(PHP_VERSION,\"5.2\",\"<\"))\r\n\t\t{ \r\n\t\t\trequire_once(\"./JSON.php\"); //if php<5.2 need JSON class\r\n\t\t\t$json = new Services_JSON();//instantiate new json object\r\n\t\t\t$data=$json->decode($arr); //decode the data in json format\r\n\t\t} else {\r\n\t\t\t$data = json_decode($arr); //decode the data in json format\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function JDecode($arr){\r\n\t\tif (version_compare(PHP_VERSION,\"5.2\",\"<\"))\r\n\t\t{ \r\n\t\t\trequire_once(\"./JSON.php\"); //if php<5.2 need JSON class\r\n\t\t\t$json = new Services_JSON();//instantiate new json object\r\n\t\t\t$data=$json->decode($arr); //decode the data in json format\r\n\t\t} else {\r\n\t\t\t$data = json_decode($arr); //decode the data in json format\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function JDecode($arr){\r\n\t\tif (version_compare(PHP_VERSION,\"5.2\",\"<\"))\r\n\t\t{ \r\n\t\t\trequire_once(\"./JSON.php\"); //if php<5.2 need JSON class\r\n\t\t\t$json = new Services_JSON();//instantiate new json object\r\n\t\t\t$data=$json->decode($arr); //decode the data in json format\r\n\t\t} else {\r\n\t\t\t$data = json_decode($arr); //decode the data in json format\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "function deserialise(string $data): void;", "public function parseJsonData($data = null)\n {\n if ($data === null) {\n return;\n }\n\n if (is_array($data) || is_object($data)) {\n $data = app(Transformer::class)($data);\n }\n\n if ($data instanceof Jsonable) {\n return json_decode($data->toJson(), true);\n }\n\n if ($data instanceof JsonSerializable) {\n return json_decode(json_encode($data), true);\n }\n\n if ($data instanceof Arrayable) {\n return $data->toArray();\n }\n\n if (is_array($data)) {\n return $data;\n }\n\n $decoded = rescue(fn () => json_decode($data, true), null, false);\n\n if ($decoded) {\n return $decoded;\n }\n\n return null;\n }", "function decode($json) {\n\t\t// Use the native function if possible\n\t\tif (function_exists('json_decode')) return json_decode($json);\n\n\t\t// Otherwise fall back on the JSON services library\n\t\t$jsonServices = $this->_getJsonServices();\n\t\treturn $jsonServices->decode($json);\n\t}", "public function getResponseData()\n {\n return json_decode($this->responseData);\n }", "public function decode() \n\t{\n\t\treturn json_decode(file_get_contents(self::BOOKCASE), true, self::DEPTH, JSON_BIGINT_AS_STRING);\n\t}", "public function asJSON(){\n $data = json_decode($this->asString());\n\n $errno = json_last_error();\n if($errno != JSON_ERROR_NONE){\n throw new Exception(\"Error encountered decoding JSON: \" . json_last_error_msg());\n }\n\n return $data;\n }", "private function decodeJson( $content ) {\n\n\t\t$content = preg_replace( '/[\\x00-\\x1F\\x80-\\xFF]/', '', $content );\n\n\t\treturn json_decode( $content, true );\n\t}", "function to_json($data) {\n\t// To debug the data of the request.\n\t// error_log($data, 4);\n\t$url_decoded = urldecode($data);\n\t$json_data = json_decode($url_decoded);\n\n\treturn $json_data;\n}", "public static function jsonDecode($json) {\n $data = json_decode($json);\n self::checkJsonError();\n return $data;\n }", "public function json_decode($obj) {\r\n // Try to use native PHP 5.2+ json_encode\r\n // Switch back to JSON library included with Tiny MCE\r\n if(function_exists('json_decode')){\r\n return @json_decode($obj);\r\n } else {\r\n require_once(ABSPATH.\"/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php\");\r\n $json_obj = new Moxiecode_JSON();\r\n $json = $json_obj->decode($obj);\r\n return $json;\r\n }\r\n }", "public function deserialize($json);", "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "private function convertFromJson() {\n if ($this->value == null) {\n $this->data = null;\n return;\n }\n\n // array\n $data = trim($this->value);\n if ($data == '[]') {\n $this->data = [];\n return;\n }\n\n // null value (as string)\n if (mb_strtolower($data) == 'null') {\n $this->data = null;\n return;\n }\n\n // is object\n $json = json_decode($data);\n if ($json != null) {\n $this->data = $json;\n return;\n }\n\n // simple type: numberic or string\n $this->data = $data;\n $data = mb_strtolower($data);\n if ($data == 'false') $this->data = false;\n else if ($data == 'true') $this->data = true;\n else if (is_int($data)) $this->data = (int)$data;\n else if (is_float($data)) $this->data = (float)$data;\n else if (is_double($data)) $this->data = (double)$data;\n }", "public function getJsonData() {\n return $this->jsonData;\n }", "public function getJsonData() {\n return $this->jsonData;\n }", "public function getJsonData()\n {\n return null;\n }", "private function convertirJson($data){\n\t\treturn json_encode($data);\n\t}", "public function jsonToArray($data, $flag = false)\n {\n return $flag ? json_decode($data, true) : json_decode($data);\n }", "private function getJsonResponse($data) {\r\n $response = json_encode($data);\r\n return $response;\r\n }", "public function getJsonData()\n {\n $code = ApiReturnCode::SUCCESS;\n return $this->Api->response($code, [\n 'foo' => 'bar',\n 'baz' => 'buff'\n ]);\n }", "protected static function data_to_array($data)\n {\n return json_decode(json_encode($data), true);\n }", "public function getJsonData() {\n\n return $this->jsonData;\n }", "private function getJsonData() {\n if (empty($this->fields)) {\n return json_encode($this->fields, JSON_FORCE_OBJECT);\n } else {\n return json_encode($this->fields);\n }\n \n // Example of returned string:\n // $jsonData = '{\"name\":\"foo.antox.intra\",\"ipv4addr\":\"192.168.1.2\"}'; \n //$obj = json_decode($jsonData);\n //echo $obj->{'name'};\n //it works, it print \"foo.antox.intra\"\n }", "protected function _getJson()\n {\n if ($this->_json) {\n return $this->_json;\n }\n\n return $this->_json = json_decode($this->_getBody(), true);\n }", "public function decodeData($event)\n {\n $this->owner->{$this->dataAttribute} = Json::decode($this->owner->{$this->dataAttribute});\n }", "protected function decode($value) {\n\t\tif (defined('JSON_PARSER_NOTSTRICT')) {\n\t\t\treturn json_decode($value, false, 512, JSON_PARSER_NOTSTRICT);\n\t\t}\n\t\treturn json_decode($value);\n\t}", "protected function decodeResponse($response)\n {\n return json_decode($response);\n }", "function decodeResponse($method, $data) \n {\n return $data;\n }", "protected function _parseJson($data, $container)\n {\n $this->_parseFolders($data);\n return $this->_parseBookmarks($data);\n }", "public function deserialize($data, $type, $format, DeserializationContext $context = null)\n {\n $this->checkMediaType($format);\n return json_decode($data);\n }", "protected static function parse_response($data, array $options) {\n if ($options['json'] === true) {\n $json = json_decode($data, true);\n if (!is_null($json)) {\n return $json;\n }\n }\n return $data;\n }", "public function getData() {\n $cache_key = $this->getCacheKey();\n $cache_object = $this->cache->get($cache_key);\n\n if (is_object($cache_object)) {\n $data = $cache_object->data;\n }\n else {\n $data = $this->fetchData();\n $this->cache->set($cache_key, $data, $this->getCacheExpiry());\n }\n\n return json_decode($data, TRUE);\n }", "public static function EncodeJson (& $data);", "public function getData(){\n $data = json_encode($this->data);\n return $data;\n }", "private function json($data) {\n if (is_array($data)) {\n return json_encode($data);\n }\n }", "private function toArray($data)\n {\n \t\t$resultArray = json_decode(json_encode($data), true);\n\n \t\treturn $resultArray;\n \t}", "protected function getJsonDecodedFromPost(){\n // $this->app->response()->header(\"Content-Type\", \"application/json\");\n // obtain the JSON of the body of the request\n $post = json_decode($this->app->request()->getBody(), true); // make it a PHP associative array\n return $post;\n }", "public function decode(string $json): array;", "function decode_json($json) {\n\t$json = stripslashes($json);\n\n\tif(get_magic_quotes_gpc()) {\n\t}\n\treturn is_string($json) ? json_decode(str_replace('\\\"', '\"', $json), true) : $json;\n}", "function decode($x) {\n return NULL === ($obj = json_decode($x, FALSE)) ? $this->error('Parse error.', -32700) : $obj;\n }", "public static function json()\n {\n return json_decode(file_get_contents('php://input'), true);\n }", "public static function json()\n {\n return json_decode(file_get_contents('php://input'), true);\n }", "static public function convertToJson($data)\n\t{\n\t\treturn json_encode($data);\n\t}", "private function json($data) {\n if (is_array($data)) {\n return json_encode($data);\n }\n }", "private function retrieveJsonPostData()\n {\n $rawData = file_get_contents(\"php://input\");\n // this returns null if not valid json\n return json_decode($rawData);\n }", "function jsonDecode($json){\n return json_decode($json) ?? [];\n}", "public static function decode($value)\n {\n if ($value instanceof Encodable) {\n return $value->decode($value);\n }\n\n return json_decode($value);\n }", "public function getJSON()\n {\n if ($this->json) {\n return $this->json;\n }\n\n $this->json = @json_decode($this->rawBody);\n\n return $this->json;\n }", "public function decode($response);", "protected function asObject()\n\t{\n\t\treturn \\json_decode($this->response);\n\t}", "private function json($data){\r\n\t\t\tif(is_array($data)){\r\n\t\t\t\treturn json_encode($data);\r\n\t\t\t}\r\n\t\t}", "public function decode($key, $data);", "function getDecodedResponse () {\n if (function_exists('json_decode')) {\n return json_decode($this->responseBody, true);\n } else {\n return $this->responseBody;\n }\n }", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data)\n\t\t{\n\t\t\tif (is_array($data))\n\t\t\t{\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json()\n {\n return json_encode($this->data);\n }" ]
[ "0.79593325", "0.7648834", "0.7309458", "0.7107329", "0.7030947", "0.7030947", "0.7030947", "0.7030947", "0.7030947", "0.70048463", "0.700235", "0.6890588", "0.6737705", "0.67365205", "0.66814077", "0.6678059", "0.66742164", "0.6647703", "0.6641932", "0.6630736", "0.65989405", "0.65827954", "0.6574776", "0.6561218", "0.65539056", "0.65511733", "0.65464294", "0.65290797", "0.6516445", "0.65156823", "0.6448706", "0.6413865", "0.639245", "0.6382001", "0.636006", "0.62870675", "0.6231512", "0.6231512", "0.6231512", "0.6231512", "0.6220014", "0.62097365", "0.61744875", "0.61434674", "0.6124597", "0.60859215", "0.6082508", "0.6054726", "0.60493344", "0.59740436", "0.5944153", "0.5941865", "0.59313065", "0.59120387", "0.59120387", "0.5902122", "0.5862541", "0.58621955", "0.58593446", "0.5857749", "0.5844817", "0.5834236", "0.5832198", "0.5824812", "0.58076566", "0.57819057", "0.57811946", "0.57684106", "0.57462597", "0.5727661", "0.5716703", "0.5709315", "0.5692137", "0.56916416", "0.5690379", "0.5688255", "0.5684998", "0.56530046", "0.565173", "0.5651", "0.56483173", "0.56483173", "0.5647957", "0.56438875", "0.56282", "0.5625404", "0.5621885", "0.5616713", "0.56037486", "0.56017303", "0.5597699", "0.5591119", "0.558493", "0.5580046", "0.5580046", "0.5580046", "0.5580046", "0.5580046", "0.5580046", "0.5576794", "0.55738056" ]
0.0
-1
Sets whether to decode objects as associative arrays. Defaults to `false`.
public function decodeObjectAsArray(bool $bool) : void { $this->decodeObjectAsArray = $bool; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acf_is_associative_array($array)\n{\n}", "public function as_assoc();", "public function toAssociativeArray() {\n // TODO\n }", "public function toAssociativeArray() {\n // TODO\n }", "public function as_assoc()\n {\n $this->_as_object = false;\n\n return $this;\n }", "public function associativeArray() {\r\n\r\n if ($this->object->loadRule()) {\r\n $crud = $this->myCRUD();\r\n return $crud->associativeArrayFromEncapsuledObject($this->object);\r\n } else {\r\n return false;\r\n }\r\n }", "public function isAssociative() {\n\t\t\n\t\t// compare the keys of this array to their keys\n\t\t$keys = array_keys( $this->store );\n\n\t\treturn array_keys( $keys ) !== $keys;\n\t}", "function isAssoc () {\r\n\t\treturn Arr::is_assoc($this->data);\r\n }", "function is_associative(array $arr): bool\n {\n return $arr !== [] && array_keys($arr) !== range(0, count($arr) - 1);\n }", "private static function tinydb_is_assoc($array)\n {\n return (bool)count(array_filter(array_keys($array), 'is_string'));\n }", "abstract public function toAssoc(): array;", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "function array_is_associative(array $array) {\n if ($array == array()) {\n return true;\n }\n\n $keys = array_keys($array);\n\n if (array_keys($keys) !== $keys) {\n foreach ($keys as $key) {\n if ( ! is_numeric($key)) {\n return true;\n }\n }\n }\n\n return false;\n }", "public function v2AssociativeArrayUnpacker(&$obj)\n {\n if (is_object($obj)\n && property_exists($obj, 'key')\n && property_exists($obj, 'value')\n ) {\n if (count(array_keys(get_object_vars($obj))) == 2) {\n $obj = array($obj->key => $obj->value);\n return true;\n }\n } elseif (is_array($obj)) {\n $arr = array();\n $needReplacement = true;\n foreach ($obj as &$value) {\n $isAssoc = $this->v2AssociativeArrayUnpacker($value);\n if ($isAssoc) {\n foreach ($value as $aKey => $aVal) {\n $arr[$aKey] = $aVal;\n }\n } else {\n $needReplacement = false;\n }\n }\n if ($needReplacement) {\n $obj = $arr;\n }\n } elseif (is_object($obj)) {\n $objectKeys = array_keys(get_object_vars($obj));\n\n foreach ($objectKeys as $key) {\n $this->v2AssociativeArrayUnpacker($obj->$key);\n }\n }\n return false;\n }", "public function response($as_assoc = false);", "public function isAssoc()\n {\n return $this->keys()->filter('is_int')->length !== $this->length;\n }", "public static function isAssociative($array)\n {\n if (!\\is_array($array)) {\n return false;\n }\n\n return !self::isIndexed($array);\n }", "public function isAssociative( array &$array )\n {\n return count(array_filter(array_keys($array), 'is_string')) > 0;\n }", "public function testWhenCalledWithArrayParameterAndTrueWillOutputAssociativeArray()\n {\n $this->mock->expects($this->any())\n ->method('toArray')\n ->with(true)\n ->will(\n $this->returnValue(\n [\n 'key1' => 'value1',\n 'key2' => 'value2',\n 'key3' => 'value3'\n ]\n )\n );\n\n $output = $this->mock->toOutput('array', true);\n\n $this->assertInternalType(\n 'array',\n $output\n );\n\n foreach ($output as $key => $value) {\n $this->assertNotInternalType(\n 'int',\n $key\n );\n }\n }", "public function is_assoc($array){\n return array_keys($array) !== range(0, count($array) - 1);\n }", "public function isAssoc()\n {\n if ($this->isEmpty()) {\n return false;\n }\n\n foreach ($this->getKeys() as $key) {\n if (!is_string($key)) {\n return false;\n }\n }\n\n return true;\n }", "private function is_assoc($array) {\n return (bool)count(array_filter(array_keys($array), 'is_string'));\n}", "private function isAssocArray($array = array()){\n\t if(!is_numeric(array_shift(array_keys($array)))){\n\t return true;\n\t }\n \treturn false;\n\t}", "public function toArray() {\r\n return $this->associativeArray();\r\n }", "public static function arrayable($object): bool\n {\n if (!is_object($object)) {\n return false;\n }\n\n return method_exists($object, 'toArray');\n }", "public function setIsArray($flag = true)\n {\n $this->_isArray = (bool) $flag;\n }", "public static function is_assoc( $array ) {\n return (is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array)))));\n }", "public static function isAssociative($array)\n {\n \tif (is_array($array))\n \t{\n \t\tforeach (array_keys($array) as $k => $v)\n \t\t{\n \t\t\tif ($k !== $v)\n \t\t\t{\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \t}\n \n \treturn false;\n }", "function is_assoc($a){\n\t\tif(!is_array($a)) return false;\n\t\treturn !!count(array_diff(array_keys($a),range(0,count($a)-1)));\n\t}", "private function isAssociative(array $value): bool\n {\n return count(array_filter(array_keys($value), 'is_string')) > 0;\n }", "public static function isAssociative(array $array) : bool\n\t{\n\t\t$keys = array_keys($array);\n\n\t\treturn array_keys($keys) !== $keys;\n\t}", "public function as_assoc() {\r\n $this->fetch_mode = 'assoc';\r\n return $this;\r\n }", "private function _isAssociative(array $array) : bool\n {\n if([] === $array) {\n return false;\n }\n return array_keys($array) !== range(0, count($array) - 1);\n }", "function is_assoc(array $array)\n {\n // Check if the keys are a zero-based index\n return array() === $array ? false : array_keys($array) !== range(0, count($array) - 1);\n }", "public function testIsAssociativeArray() {\r\n $array = range(1,100);\r\n $this->assertFalse($this->_utils->isAssociativeArray($array));\r\n\r\n $array = array('1' => 11, 'a' => 'AA');\r\n $this->assertTrue($this->_utils->isAssociativeArray($array));\r\n\r\n $array = array(1 => 11, 2 => 'AA');\r\n $this->assertTrue($this->_utils->isAssociativeArray($array));\r\n\r\n $array = array();\r\n $this->assertFalse($this->_utils->isAssociativeArray($array));\r\n\r\n $array = array(1, 3, 5);\r\n $this->assertFalse($this->_utils->isAssociativeArray($array));\r\n }", "function is_assoc (&$arr) {\n try{\n return (is_array($arr) && (!count($arr) || count(array_filter(array_keys($arr),'is_string')) == count($arr)));\n }catch(Exception $e){\n return false;\n }\n }", "public function isArray(): bool\n {\n return $this->phpType === self::HASH;\n }", "function is_assoc($array)\n {\n return arr::isAssoc($array);\n }", "static public function IS_ASSOC(array $arr)\n {\n return SculpinUtil::IS_ASSOC($arr);\n }", "protected static function isAssociative(array $array, bool $allStrings = true): bool\n {\n if (! \\is_array($array) || empty($array)) {\n return false;\n }\n\n if ($allStrings) {\n foreach ($array as $key => $value) {\n if (! \\is_string($key)) {\n return false;\n }\n }\n\n return true;\n }\n\n foreach ($array as $key => $value) {\n if (\\is_string($key)) {\n return true;\n }\n }\n\n return false;\n }", "protected function isAssociativeArray(array $array)\n {\n return (bool) \\count(\\array_filter(\\array_keys($array), 'is_string'));\n }", "public static function isAssociative(array $items)\n {\n return array() === $items ? false : array_keys($items) !== range(0, count($items) - 1);\n }", "private function setSerializableOptionsArray()\n {\n $this->serializableOptions = [\n 'root' => $this->base()->lowercase()->singular(),\n 'collection_root' => $this->base()->lowercase()->plural(),\n 'include_root' => TRUE,\n 'additional_methods' => [],\n 'include_subclasses' => [],\n ];\n }", "public function testWhenCalledWithArrayParameterAndFalseWillOutputNonAssociativeArray()\n {\n $this->mock->expects($this->any())\n ->method('toArray')\n ->with(false)\n ->will(\n $this->returnValue(\n [\n 'value1',\n 'value2',\n 'value3'\n ]\n )\n );\n\n $output = $this->mock->toOutput('array', false);\n\n $this->assertInternalType(\n 'array',\n $output\n );\n\n $i = 0;\n foreach ($output as $key => $value) {\n $this->assertInternalType(\n 'int',\n $key\n );\n $this->assertEquals(\n $i++,\n $key\n );\n }\n }", "public function isAssociativeArray(array $array) {\r\n return !empty($array) && array_keys($array) !== range(0, count($array) - 1);\r\n }", "function is_associative_array($array){\n if (!is_array($array) || empty($array)) return false;\n $keys = array_keys($array);\n return array_keys($keys) !== $keys;\n}", "public function toArray($deep = false) {\n $res = $this->_data;\n if ($deep) {\n foreach($res as $key=>$value) {\n if ($value instanceof slModel || $value instanceof slModelCollection) {\n $res[$key] = $value->toArray(true);\n }\n }\n if ($this->_structure->get('abilities')) {\n foreach($this->_structure->get('abilities') as $ability=>$params) {\n $res[$ability] = $this->$ability;\n }\n }\n }\n\n return $res;\n }", "public function isAssociative(array $arr)\n {\n if (array() === $arr) {\n return false;\n }\n\n $result = array_keys($arr) !== range(0, count($arr) - 1);\n\n return $result;\n }", "public static function isAssociativeArray ($array)\r\n\t{\r\n\t\t# Return false if not an array\r\n\t\tif (!is_array ($array)) {return false;}\r\n\t\t\r\n\t\t# Loop through each and check each key\r\n\t\t$index = 0;\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\t\r\n\t\t\t# If the key does not exactly match the index (i.e. is not numeric type or is not in pure order of 0, 1, 2, ...), then it is associative\r\n\t\t\tif ($key !== $index) {return true;}\r\n\t\t\t$index++;\r\n\t\t}\r\n\t\t\r\n\t\t# Otherwise return false as all keys are integers in natural order\r\n\t\treturn false;\r\n\t}", "public function toArray()\n {\n $a = parent::toArray();\n if ($this->accounts) {\n $ab = array();\n foreach ($this->accounts as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['accounts'] = $ab;\n }\n if ($this->addresses) {\n $ab = array();\n foreach ($this->addresses as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['addresses'] = $ab;\n }\n if ($this->emails) {\n $ab = array();\n foreach ($this->emails as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['emails'] = $ab;\n }\n if ($this->homepage) {\n $a[\"homepage\"] = $this->homepage->toArray();\n }\n if ($this->identifiers) {\n $ab = array();\n foreach ($this->identifiers as $i => $x) {\n $ab[$i] = array();\n foreach ($x as $j => $y) {\n $ab[$i][$j] = $y->getValue();\n }\n }\n $a['identifiers'] = $ab;\n }\n if ($this->names) {\n $ab = array();\n foreach ($this->names as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['names'] = $ab;\n }\n if ($this->openid) {\n $a[\"openid\"] = $this->openid->toArray();\n }\n if ($this->phones) {\n $ab = array();\n foreach ($this->phones as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['phones'] = $ab;\n }\n return $a;\n }", "public function asArray($value = true)\n {\n $this->asArray = $value;\n return $this;\n }", "public function testSetAndRetrieveArray(): void\n {\n $obj = new \\stdClass;\n $obj->animal = \"Frog\";\n $obj->mineral = \"Quartz\";\n $obj->vegetable = \"Spinach\";\n $arr = array(\n \"testInt\" => 5,\n \"testFloat\" => 3.278,\n \"testString\" => \"WooHoo\",\n \"testBoolean\" => true,\n \"testNull\" => null,\n \"testArray\" => array(1, 2, 3, 4, 5),\n \"testObject\" => $obj\n );\n $key = \"TestArray\";\n $this->testNotStrict->set($key, $arr);\n $a = $this->testNotStrict->get($key);\n $bool = is_array($a);\n $this->assertTrue($bool);\n $this->assertEquals($arr['testInt'], $a['testInt']);\n $this->assertEquals($arr['testFloat'], $a['testFloat']);\n $this->assertEquals($arr['testString'], $a['testString']);\n $this->assertEquals($arr['testBoolean'], $a['testBoolean']);\n $this->assertNull($a['testNull']);\n $this->assertEquals($arr['testArray'], $a['testArray']);\n $this->assertEquals($arr['testObject'], $a['testObject']);\n }", "public static function isAssoc($array) {\n $return = true;\n foreach(array_keys($array) as $a) {\n $return = $return & is_string($a);\n }\n return (bool)$return;\n }", "public function noAssociationData()\n {\n return [\n 'array' => [\n $array = 'array',\n $array,\n Guess::HIGH_CONFIDENCE,\n ],\n 'simple_array' => [\n 'simple_array',\n $array,\n Guess::HIGH_CONFIDENCE,\n ],\n 'json_array' => [\n 'json_array',\n $array,\n Guess::HIGH_CONFIDENCE,\n ],\n 'json' => [\n 'json',\n $array,\n Guess::HIGH_CONFIDENCE,\n ],\n 'boolean' => [\n $boolean = 'boolean',\n $boolean,\n Guess::HIGH_CONFIDENCE,\n ],\n 'datetime' => [\n $datetime = 'datetime',\n $datetime,\n Guess::HIGH_CONFIDENCE,\n ],\n 'datetime_immutable' => [\n 'datetime_immutable',\n $datetime,\n Guess::HIGH_CONFIDENCE,\n ],\n 'vardatetime' => [\n 'vardatetime',\n $datetime,\n Guess::HIGH_CONFIDENCE,\n ],\n 'datetimetz' => [\n 'datetimetz',\n $datetime,\n Guess::HIGH_CONFIDENCE,\n ],\n 'datetimetz_immutable' => [\n 'datetimetz_immutable',\n $datetime,\n Guess::HIGH_CONFIDENCE,\n ],\n 'date' => [\n $date = 'date',\n $date,\n Guess::HIGH_CONFIDENCE,\n ],\n 'date_immutable' => [\n 'date_immutable',\n $date,\n Guess::HIGH_CONFIDENCE,\n ],\n 'decimal' => [\n 'decimal',\n $number = 'number',\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'float' => [\n 'float',\n $number,\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'integer' => [\n $integer = 'integer',\n $integer,\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'bigint' => [\n 'bigint',\n $integer,\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'smallint' => [\n 'smallint',\n $integer,\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'string' => [\n 'string',\n $text = 'text',\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'text' => [\n 'text',\n 'textarea',\n Guess::MEDIUM_CONFIDENCE,\n ],\n 'time' => [\n $time = 'time',\n $time,\n Guess::HIGH_CONFIDENCE,\n ],\n 'time_immutable' => [\n 'time_immutable',\n $time,\n Guess::HIGH_CONFIDENCE,\n ],\n 'somefake' => [\n 'somefake',\n $text,\n Guess::LOW_CONFIDENCE,\n ],\n ];\n }", "public static function is_assoc($var): bool {\n\t\t\treturn (is_array($var) && (array_values($var) !== $var));\n\t\t}", "function is_assoc($array) {\n //sometimes there is a single block, sometimes an array, this helps figure out which is which\n return (bool)count(array_filter(array_keys($array), 'is_string'));\n}", "public static function isAssociative(array $data): bool\n {\n return array_keys($data) !== range(0, count($data) - 1);\n }", "function is_assoc($array)\n{\n return array_keys($array) !== range(0, count($array) - 1);\n}", "public function toArray() {\n $output = array();\n foreach($this->_magicProperties as $key => $value) {\n if (in_array($key,$this->translation)) {\n $output[array_search($key,$this->translation)] = $value;\n }else{\n $output[$key] = $value;\n }\n }\n return $this->_postarray($output);\n }", "public function decode($config, $array = false)\n {\n return json_decode($config, $array);\n }", "public function is_user_object_data() {\n return false;\n }", "public function toArray()\n {\n $result = $this->convertItemsToArray();\n $this->removeItemWithDefaultValue($result, self::DISABLE_META_PROPERTIES);\n $this->removeItemWithDefaultValue($result, self::DISABLE_INCLUSION);\n $this->removeItemWithDefaultValue($result, self::DISABLE_FIELDSET);\n $this->removeItemWithDefaultValue($result, self::DISABLE_SORTING);\n\n $fields = ConfigUtil::convertObjectsToArray($this->fields, true);\n if (!empty($fields)) {\n $result[self::FIELDS] = $fields;\n }\n\n return $result;\n }", "protected function is_assoc( array $array ) {\n\n return array_keys( $array ) !== range( 0, count( $array ) - 1 );\n\n }", "public function retainObjectOrder()\n {\n return false;\n }", "public function toArray($preserveKeys = true): array;", "private static function _isDict($array)\n\t{\n\t\treturn (is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array)))));\n\t}", "public function isAssociative(array $stats)\n\t{\n\t\treturn array_keys($stats) !== range(0, count($stats) - 1);\n\t}", "public function toArray($forStorage = false, $cleanNames = true)\n {\n $return = array();\n $textLabels = $this->_getTextLabels();\n\n foreach ($this->_attr as $attr => $value) {\n if ($forStorage) {\n $value = $this->getForStorage($attr);\n }\n\n if (isset($cleanNames[$attr])) {\n $return[$cleanNames[$attr]] = $value;\n } elseif ($cleanNames == true && isset($textLabels[$attr])) {\n $return[$textLabels[$attr]] = $value;\n } else {\n $return[$attr] = $value;\n }\n }\n\n return $return;\n }", "function is_assoc(array $arr)\n {\n if (array() === $arr) return false;\n return array_keys($arr) !== range(0, count($arr) - 1);\n }", "function json_decode($data, $output_as_array) {\n\t\t\t$json_mode = $output_as_array ? SERVICES_JSON_LOOSE_TYPE : null;\n\t\t\t$json = new Services_JSON($json_mode);\n\t\t\treturn($json->decode($data));\n\t\t}", "public function setObjectEncoding($encoding);", "public function testIsAssociative()\n {\n $isAssociative = array(\n 'hello' => 'world',\n 'world' => 'hello'\n );\n\n $isTooAssociative = array(\n 'hello' => array(\n 'hello' => 'world',\n 'world' => array(\n 'hello' => 'world'\n )\n )\n );\n\n $isNotAssociative = array('hello', 'world');\n\n $this\n ->given($array = new classToTest())\n ->then\n ->boolean($array::isAssociative($isAssociative))\n ->isTrue()\n ->boolean($array::isAssociative($isTooAssociative))\n ->isTrue()\n ->boolean($array::isAssociative($isNotAssociative))\n ->isFalse()\n ;\n }", "function toObject($arr = false){\n \tif( !$arr )\n \t\treturn false;\n \treturn (object) $arr;\n }", "function allowserialize($propname)\r\n {\r\n return(true);\r\n }", "public static function forceArray($array) {\n return json_decode(json_encode($array), true);\n }", "public function toArray()\n {\n $return = array();\n\n foreach (get_object_vars($this) as $key => $value) {\n $key = ucfirst($key);\n if (is_object($value) && $value instanceof AbstractToArray) {\n $return[$key] = $value->toArray();\n } elseif (is_object($value) && $value instanceof \\DateTime) {\n $return[$key] = $value->format('YmdHis');\n } elseif (is_bool($value)) {\n $return[$key] = $value ? 'Y' : 'N';\n } elseif (is_array($value)) {\n if ($value !== array()) {\n $return[$key] = $value;\n }\n } elseif ($value !== NULL) {\n $return[$key] = (string)$value;\n }\n }\n return $return;\n }", "public abstract function toMap(): array;", "public function passOnEncodingAuto()\n {\n return false;\n }", "public function toArray($withEmbeddeds = true)\n {\n $array = array();\n\n if (null !== $this->data['fields']['rev']) {\n $array['rev'] = $this->data['fields']['rev'];\n }\n if (null !== $this->data['fields']['cover']) {\n $array['cover'] = $this->data['fields']['cover'];\n }\n if (null !== $this->data['fields']['wiki_id']) {\n $array['wiki_id'] = $this->data['fields']['wiki_id'];\n }\n if (null !== $this->data['fields']['title']) {\n $array['title'] = $this->data['fields']['title'];\n }\n if (null !== $this->data['fields']['html_cache']) {\n $array['html_cache'] = $this->data['fields']['html_cache'];\n }\n if (null !== $this->data['fields']['content']) {\n $array['content'] = $this->data['fields']['content'];\n }\n if (null !== $this->data['fields']['tags']) {\n $array['tags'] = $this->data['fields']['tags'];\n }\n if (null !== $this->data['fields']['comment_tags']) {\n $array['comment_tags'] = $this->data['fields']['comment_tags'];\n }\n if (null !== $this->data['fields']['model']) {\n $array['model'] = $this->data['fields']['model'];\n }\n if (null !== $this->data['fields']['has_video']) {\n $array['has_video'] = $this->data['fields']['has_video'];\n }\n if (null !== $this->data['fields']['like_num']) {\n $array['like_num'] = $this->data['fields']['like_num'];\n }\n if (null !== $this->data['fields']['dislike_num']) {\n $array['dislike_num'] = $this->data['fields']['dislike_num'];\n }\n if (null !== $this->data['fields']['watched_num']) {\n $array['watched_num'] = $this->data['fields']['watched_num'];\n }\n if (null !== $this->data['fields']['admin_id']) {\n $array['admin_id'] = $this->data['fields']['admin_id'];\n }\n if (null !== $this->data['fields']['do_date']) {\n $array['do_date'] = $this->data['fields']['do_date'];\n }\n if (null !== $this->data['fields']['source']) {\n $array['source'] = $this->data['fields']['source'];\n }\n if (null !== $this->data['fields']['tvsou_id']) {\n $array['tvsou_id'] = $this->data['fields']['tvsou_id'];\n }\n if (null !== $this->data['fields']['first_letter']) {\n $array['first_letter'] = $this->data['fields']['first_letter'];\n }\n if (null !== $this->data['fields']['douban_id']) {\n $array['douban_id'] = $this->data['fields']['douban_id'];\n }\n if (null !== $this->data['fields']['verify']) {\n $array['verify'] = $this->data['fields']['verify'];\n }\n if (null !== $this->data['fields']['created_at']) {\n $array['created_at'] = $this->data['fields']['created_at'];\n }\n if (null !== $this->data['fields']['updated_at']) {\n $array['updated_at'] = $this->data['fields']['updated_at'];\n }\n\n\n if ($withEmbeddeds) {\n\n }\n\n return $array;\n }", "public function toArray()\n {\n $a = parent::toArray();\n if ($this->descriptionRef) {\n $a[\"description\"] = $this->descriptionRef;\n }\n if ($this->attribution) {\n $a[\"attribution\"] = $this->attribution->toArray();\n }\n if ($this->qualifiers) {\n $ab = array();\n foreach ($this->qualifiers as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['qualifiers'] = $ab;\n }\n return $a;\n }", "protected function collateOnly() {\n\t\treturn false;\n\t}", "private function setFromArray($data, $jsondecode = false) {\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\tif ($jsondecode && in_array($key, static::$_json_fields)) {\n\t\t\t\t\t$value = json_decode($value, true);\n\t\t\t\t}\n\t\t\t\t$this->setData($key, $value);\n\t\t\t}\n\t\t}", "public function toArray()\n {\n if ($this->_checkRecordInstance()) {\n return $this->_entity->toArray();\n } else {\n return false;\n }\n }", "public function associativeArrayUnpack(&$mixed)\n {\n if (is_array($mixed)) {\n $tmpArr = array();\n foreach ($mixed as $key => $value) {\n if (is_object($value)) {\n $value = get_object_vars($value);\n if (count($value) == 2 && isset($value['key']) && isset($value['value'])) {\n $tmpArr[$value['key']] = $value['value'];\n }\n }\n }\n if (count($tmpArr)) {\n $mixed = $tmpArr;\n }\n }\n\n if (is_object($mixed)) {\n $numOfVals = count(get_object_vars($mixed));\n if ($numOfVals == 2 && isset($mixed->key) && isset($mixed->value)) {\n $mixed = get_object_vars($mixed);\n /*\n * Processing an associative arrays.\n * $mixed->key = '2'; $mixed->value = '3'; turns to array(2 => '3');\n */\n $mixed = array($mixed['key'] => $mixed['value']);\n }\n }\n }", "function array_is_indexed(array $array) {\n if ($array == array()) {\n return true;\n }\n\n return ! array_is_associative($array);\n }", "function seturlDecode($obj)\n{\n//\t\tforeach($obj as $name => $value)\n//\t\t{\n//\t\t\t $ret[$name] = urldecode($value);\n//\t\t}\n//\t\n//\t\treturn $ret;\n\n\treturn $obj;\n}", "#[ReturnTypeWillChange]\n public function __serialize()\n {\n return $this->toArray();\n }", "function is_assoc($arr) {\n return (is_array($arr) && count(array_filter(array_keys($arr),'is_string')) == count($arr));\n}", "public function as_array()\n {\n $this->return_as = 'array';\n return $this;\n }", "public static function is_assoc(array $array) {\n // Keys of the array\n $keys = array_keys($array);\n\n // If the array keys of the keys match the keys, then the array must\n // not be associative (e.g. the keys array looked like {0:0, 1:1...}).\n return array_keys($keys) !== $keys;\n }", "private static function isAssocArray($array) {\n return count(array_filter(array_keys($array), 'is_string')) > 0;\n }", "public function isJsonArrayReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tjson_encode(array('a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode('a,b:c'),\n\t\t\t\tFALSE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array('object' => 'a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array(array('title' => 'test2'), array('title' => 'test2'))),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'a,b:c',\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}", "public function isJsonArrayReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tjson_encode(array('a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode('a,b:c'),\n\t\t\t\tFALSE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array('object' => 'a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array(array('title' => 'test2'), array('title' => 'test2'))),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'a,b:c',\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}", "function is_array_assoc(array $arr)\n\t{\n\t\tif (array() === $arr) return false;\n\t\treturn array_keys($arr) !== range(0, count($arr) - 1);\n\t}", "function arrayIntoObject (&$object,$array) {\nwhile(list($key,$val)=@each($array)) {\n if (!is_numeric($key)) {\n if ($v2 = @unserialize($val)) { $val = $v2; }\n $object->$key = $val;\n }\n}\n}" ]
[ "0.597825", "0.58638114", "0.5831661", "0.5831661", "0.57627255", "0.5746595", "0.5720349", "0.56909347", "0.5568703", "0.5500757", "0.5433403", "0.54312265", "0.54312265", "0.54312265", "0.54312265", "0.54312265", "0.54312265", "0.5429051", "0.539046", "0.5358684", "0.5346179", "0.53324795", "0.5292747", "0.5283345", "0.525307", "0.5209893", "0.5208701", "0.5200145", "0.5187723", "0.51790667", "0.5169655", "0.51635283", "0.51532984", "0.51295555", "0.51149464", "0.5092954", "0.5091526", "0.5087648", "0.5071925", "0.5071591", "0.5069734", "0.5065563", "0.50536925", "0.5015376", "0.50112784", "0.50072896", "0.50044644", "0.5000129", "0.49908602", "0.49901545", "0.4968787", "0.49210474", "0.49158704", "0.4897268", "0.48934907", "0.48849076", "0.48810482", "0.48702583", "0.4863512", "0.48589337", "0.48377016", "0.48365104", "0.48186117", "0.4810951", "0.4808344", "0.48057458", "0.48041314", "0.4800279", "0.47859353", "0.47777614", "0.47684222", "0.47567332", "0.47307232", "0.47218904", "0.47216275", "0.47161505", "0.47146094", "0.4704738", "0.4687322", "0.46711493", "0.46679866", "0.46648484", "0.46632725", "0.46490178", "0.464456", "0.4639038", "0.4635972", "0.4630568", "0.46301565", "0.46271515", "0.46222907", "0.4610292", "0.46089396", "0.4608275", "0.46081638", "0.4604813", "0.46026465", "0.46026465", "0.45911384", "0.4590677" ]
0.62783515
0
Sets whether to decode large integers as strings. Defaults to `false`. `true` decodes large integers as strings `false` decodes large integers as floats
public function decodeBigIntAsString(bool $bool) : void { $this->setOption(JSON_BIGINT_AS_STRING, $bool); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeInteger($integer);", "abstract public function decode(array $options = array());", "public function testDecodeIntegerOverflow()\n {\n $this->expectException(ParseException::class);\n $this->expectExceptionMessage('Invalid integer format or integer overflow');\n\n $value = PHP_INT_MAX . '0000'; // PHP_INT_MAX * 10000\n $encoded = \"i{$value}e\";\n\n Bencode::decode($encoded);\n }", "public static function bigint() {}", "public function setDecodeResult($val)\n\t{\n\t\t$this->_decodeResult = (bool)$val;\n\t}", "protected function getItoa64() {}", "protected function getItoa64() {}", "function decode($str)\n {\n $str = $this->reduce_string($str);\n\n switch (strtolower($str)) {\n case 'true':\n return true;\n\n case 'false':\n return false;\n\n case 'null':\n return null;\n\n default:\n $m = array();\n\n if (is_numeric($str)) {\n // Lookie-loo, it's a number\n\n // This would work on its own, but I'm trying to be\n // good about returning integers where appropriate:\n // return (float)$str;\n\n // Return float or int, as appropriate\n return ((float)$str == (integer)$str)\n ? (integer)$str\n : (float)$str;\n\n } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m) && $m[1] == $m[2]) {\n // STRINGS RETURNED IN UTF-8 FORMAT\n $delim = substr($str, 0, 1);\n $chrs = substr($str, 1, -1);\n $utf8 = '';\n $strlen_chrs = strlen($chrs);\n\n for ($c = 0; $c < $strlen_chrs; ++$c) {\n\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n $ord_chrs_c = ord($chrs{$c});\n\n switch (true) {\n case $substr_chrs_c_2 == '\\b':\n $utf8 .= chr(0x08);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\t':\n $utf8 .= chr(0x09);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\n':\n $utf8 .= chr(0x0A);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\f':\n $utf8 .= chr(0x0C);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\r':\n $utf8 .= chr(0x0D);\n ++$c;\n break;\n\n case $substr_chrs_c_2 == '\\\\\"':\n case $substr_chrs_c_2 == '\\\\\\'':\n case $substr_chrs_c_2 == '\\\\\\\\':\n case $substr_chrs_c_2 == '\\\\/':\n if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n $utf8 .= $chrs{++$c};\n }\n break;\n\n case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n // single, escaped unicode character\n $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n . chr(hexdec(substr($chrs, ($c + 4), 2)));\n $utf8 .= $this->utf162utf8($utf16);\n $c += 5;\n break;\n\n case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n $utf8 .= $chrs{$c};\n break;\n\n case ($ord_chrs_c & 0xE0) == 0xC0:\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 2);\n ++$c;\n break;\n\n case ($ord_chrs_c & 0xF0) == 0xE0:\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 3);\n $c += 2;\n break;\n\n case ($ord_chrs_c & 0xF8) == 0xF0:\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 4);\n $c += 3;\n break;\n\n case ($ord_chrs_c & 0xFC) == 0xF8:\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 5);\n $c += 4;\n break;\n\n case ($ord_chrs_c & 0xFE) == 0xFC:\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 6);\n $c += 5;\n break;\n\n }\n\n }\n\n return $utf8;\n\n } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n // array, or object notation\n\n if ($str{0} == '[') {\n $stk = array(SERVICES_JSON_IN_ARR);\n $arr = array();\n } else {\n if ($this->use & SERVICES_JSON_LOOSE_TYPE) {\n $stk = array(SERVICES_JSON_IN_OBJ);\n $obj = array();\n } else {\n $stk = array(SERVICES_JSON_IN_OBJ);\n $obj = new stdClass();\n }\n }\n\n array_push($stk, array('what' => SERVICES_JSON_SLICE,\n 'where' => 0,\n 'delim' => false));\n\n $chrs = substr($str, 1, -1);\n $chrs = $this->reduce_string($chrs);\n\n if ($chrs == '') {\n if (reset($stk) == SERVICES_JSON_IN_ARR) {\n return $arr;\n\n } else {\n return $obj;\n\n }\n }\n\n //print(\"\\nparsing {$chrs}\\n\");\n\n $strlen_chrs = strlen($chrs);\n\n for ($c = 0; $c <= $strlen_chrs; ++$c) {\n\n $top = end($stk);\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n\n if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {\n // found a comma that is not inside a string, array, etc.,\n // OR we've reached the end of the character list\n $slice = substr($chrs, $top['where'], ($c - $top['where']));\n array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));\n //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n if (reset($stk) == SERVICES_JSON_IN_ARR) {\n // we are in an array, so just push an element onto the stack\n array_push($arr, $this->decode($slice));\n\n } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {\n // we are in an object, so figure\n // out the property name and set an\n // element in an associative array,\n // for now\n $parts = array();\n \n if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"name\":value pair\n $key = $this->decode($parts[1]);\n $val = $this->decode($parts[2]);\n\n if ($this->use & SERVICES_JSON_LOOSE_TYPE) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // name:value pair, where name is unquoted\n $key = $parts[1];\n $val = $this->decode($parts[2]);\n\n if ($this->use & SERVICES_JSON_LOOSE_TYPE) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n }\n\n }\n\n } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != SERVICES_JSON_IN_STR)) {\n // found a quote, and we are not inside a string\n array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));\n //print(\"Found start of string at {$c}\\n\");\n\n } elseif (($chrs{$c} == $top['delim']) &&\n ($top['what'] == SERVICES_JSON_IN_STR) &&\n ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n // found a quote, we're in a string, and it's not escaped\n // we know that it's not escaped becase there is _not_ an\n // odd number of backslashes at the end of the string so far\n array_pop($stk);\n //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n\n } elseif (($chrs{$c} == '[') &&\n in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n // found a left-bracket, and we are in an array, object, or slice\n array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));\n //print(\"Found start of array at {$c}\\n\");\n\n } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {\n // found a right-bracket, and we're in an array\n array_pop($stk);\n //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n } elseif (($chrs{$c} == '{') &&\n in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n // found a left-brace, and we are in an array, object, or slice\n array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));\n //print(\"Found start of object at {$c}\\n\");\n\n } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {\n // found a right-brace, and we're in an object\n array_pop($stk);\n //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n } elseif (($substr_chrs_c_2 == '/*') &&\n in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {\n // found a comment start, and we are in an array, object, or slice\n array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));\n $c++;\n //print(\"Found start of comment at {$c}\\n\");\n\n } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {\n // found a comment end, and we're in one now\n array_pop($stk);\n $c++;\n\n for ($i = $top['where']; $i <= $c; ++$i)\n $chrs = substr_replace($chrs, ' ', $i, 1);\n\n //print(\"Found end of comment at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n }\n\n }\n\n if (reset($stk) == SERVICES_JSON_IN_ARR) {\n return $arr;\n\n } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {\n return $obj;\n\n }\n\n }\n }\n }", "function decodeUTF8InputOn()\n\t{\n\t\t$this->bDecodeUTF8Input = true;\n\t}", "public function bigInt($objectId)\n {\n return $this->_coder->decode($objectId);\n }", "public function decode($in) {}", "public function testDecodeIntegerFakeString()\n {\n $this->expectException(ParseException::class);\n $this->expectExceptionMessage('Invalid integer format or integer overflow');\n\n Bencode::decode('iffafwe');\n }", "function json_decode($str)\n {\n $use = 1;\n $str = reduce_string($str);\n\n switch (strtolower($str)) {\n case 'true':\n return true;\n\n case 'false':\n return false;\n\n case 'null':\n return null;\n\n default:\n $m = array();\n\n if (is_numeric($str)) {\n // Lookie-loo, it's a number\n\n // This would work on its own, but I'm trying to be\n // good about returning integers where appropriate:\n // return (float)$str;\n\n // Return float or int, as appropriate\n return ((float)$str == (integer)$str)\n ? (integer)$str\n : (float)$str;\n\n } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m) && $m[1] == $m[2]) {\n // STRINGS RETURNED IN UTF-8 FORMAT\n $delim = substr($str, 0, 1);\n $chrs = substr($str, 1, -1);\n $utf8 = '';\n $strlen_chrs = strlen($chrs);\n\n for ($c = 0; $c < $strlen_chrs; ++$c) {\n\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n $ord_chrs_c = ord($chrs{$c});\n\n switch (true) {\n case $substr_chrs_c_2 == '\\b':\n $utf8 .= chr(0x08);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\t':\n $utf8 .= chr(0x09);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\n':\n $utf8 .= chr(0x0A);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\f':\n $utf8 .= chr(0x0C);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\r':\n $utf8 .= chr(0x0D);\n ++$c;\n break;\n\n case $substr_chrs_c_2 == '\\\\\"':\n case $substr_chrs_c_2 == '\\\\\\'':\n case $substr_chrs_c_2 == '\\\\\\\\':\n case $substr_chrs_c_2 == '\\\\/':\n if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n $utf8 .= $chrs{++$c};\n }\n break;\n\n case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n // single, escaped unicode character\n $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n . chr(hexdec(substr($chrs, ($c + 4), 2)));\n $utf8 .= utf162utf8($utf16);\n $c += 5;\n break;\n\n case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n $utf8 .= $chrs{$c};\n break;\n\n case ($ord_chrs_c & 0xE0) == 0xC0:\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 2);\n ++$c;\n break;\n\n case ($ord_chrs_c & 0xF0) == 0xE0:\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 3);\n $c += 2;\n break;\n\n case ($ord_chrs_c & 0xF8) == 0xF0:\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 4);\n $c += 3;\n break;\n\n case ($ord_chrs_c & 0xFC) == 0xF8:\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 5);\n $c += 4;\n break;\n\n case ($ord_chrs_c & 0xFE) == 0xFC:\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 6);\n $c += 5;\n break;\n\n }\n\n }\n\n return $utf8;\n\n } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n // array, or object notation\n\n if ($str{0} == '[') {\n $stk = array(3);\n $arr = array();\n } else {\n if ($use & 16) {\n $stk = array(4);\n $obj = array();\n } else {\n $stk = array(4);\n $obj = new stdClass();\n }\n }\n\n array_push($stk, array('what' => 1,\n 'where' => 0,\n 'delim' => false));\n\n $chrs = substr($str, 1, -1);\n $chrs = reduce_string($chrs);\n\n if ($chrs == '') {\n if (reset($stk) == 3) {\n return $arr;\n\n } else {\n return $obj;\n\n }\n }\n\n $strlen_chrs = strlen($chrs);\n\n for ($c = 0; $c <= $strlen_chrs; ++$c) {\n\n $top = end($stk);\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n\n if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == 1))) {\n // found a comma that is not inside a string, array, etc.,\n // OR we've reached the end of the character list\n $slice = substr($chrs, $top['where'], ($c - $top['where']));\n array_push($stk, array('what' => 1, 'where' => ($c + 1), 'delim' => false));\n //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n if (reset($stk) == 3) {\n // we are in an array, so just push an element onto the stack\n array_push($arr, json_decode($slice));\n\n } elseif (reset($stk) == 4) {\n // we are in an object, so figure\n // out the property name and set an\n // element in an associative array,\n // for now\n $parts = array();\n\n if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"name\":value pair\n $key = json_decode($parts[1]);\n $val = json_decode($parts[2]);\n\n if ($use & 16) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // name:value pair, where name is unquoted\n $key = $parts[1];\n $val = json_decode($parts[2]);\n\n if ($use & 16) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n }\n\n }\n\n } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != 2)) {\n // found a quote, and we are not inside a string\n array_push($stk, array('what' => 2, 'where' => $c, 'delim' => $chrs{$c}));\n //print(\"Found start of string at {$c}\\n\");\n\n } elseif (($chrs{$c} == $top['delim']) &&\n ($top['what'] == 2) &&\n ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n // found a quote, we're in a string, and it's not escaped\n // we know that it's not escaped becase there is _not_ an\n // odd number of backslashes at the end of the string so far\n array_pop($stk);\n //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n\n } elseif (($chrs{$c} == '[') &&\n in_array($top['what'], array(1, 3, 4))) {\n // found a left-bracket, and we are in an array, object, or slice\n array_push($stk, array('what' => 3, 'where' => $c, 'delim' => false));\n //print(\"Found start of array at {$c}\\n\");\n\n } elseif (($chrs{$c} == ']') && ($top['what'] == 3)) {\n // found a right-bracket, and we're in an array\n array_pop($stk);\n //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n } elseif (($chrs{$c} == '{') &&\n in_array($top['what'], array(1, 3, 4))) {\n // found a left-brace, and we are in an array, object, or slice\n array_push($stk, array('what' => 4, 'where' => $c, 'delim' => false));\n //print(\"Found start of object at {$c}\\n\");\n\n } elseif (($chrs{$c} == '}') && ($top['what'] == 4)) {\n // found a right-brace, and we're in an object\n array_pop($stk);\n //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n\n } elseif (($substr_chrs_c_2 == '/*') &&\n in_array($top['what'], array(1, 3, 4))) {\n // found a comment start, and we are in an array, object, or slice\n array_push($stk, array('what' => 5, 'where' => $c, 'delim' => false));\n $c++;\n //print(\"Found start of comment at {$c}\\n\");\n\n } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == 5)) {\n // found a comment end, and we're in one now\n array_pop($stk);\n $c++;\n\n for ($i = $top['where']; $i <= $c; ++$i)\n $chrs = substr_replace($chrs, ' ', $i, 1);\n }\n\n }\n\n if (reset($stk) == 3) {\n return $arr;\n\n } elseif (reset($stk) == 4) {\n return $obj;\n\n }\n\n }\n }\n }", "public function getInt64Field()\n {\n $value = $this->get(self::INT64_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "static function is64bit()\n\t{\n\t\treturn intval(\"9223372036854775807\") === 9223372036854775807 ? true: false;\n\t}", "function decodeUTF8InputOff()\n\t{\n\t\t$this->bDecodeUTF8Input = false;\n\t}", "function BlobDecode($blob,$maxsize=false,$hastrans=true)\n\t{\n\t\tif (!$this->GuessOID($blob)) return $blob;\n\n\t\tif ($hastrans) pg_query($this->_connectionID,'begin');\n\t\t$fd = @pg_lo_open($this->_connectionID,$blob,'r');\n\t\tif ($fd === false) {\n\t\t\tif ($hastrans) pg_query($this->_connectionID,'commit');\n\t\t\treturn $blob;\n\t\t}\n\t\tif (!$maxsize) $maxsize = $this->maxblobsize;\n\t\t$realblob = @pg_lo_read($fd,$maxsize);\n\t\t@pg_loclose($fd);\n\t\tif ($hastrans) pg_query($this->_connectionID,'commit');\n\t\treturn $realblob;\n\t}", "abstract protected function getItoa64() ;", "public function setUTF()\n {\n return false;\n }", "function safe_unserialize( $str )\n{\n\t// ensure we use the byte count for strings even when strlen() is overloaded by mb_strlen()\n\tif (function_exists('mb_internal_encoding') &&\n\t\t(((int) ini_get('mbstring.func_overload')) & 2))\n\t{\n\t\t$mbIntEnc = mb_internal_encoding();\n\t\tmb_internal_encoding('ASCII');\n\t}\n\n\ttry {\n\t\t$out = _safe_unserialize($str);\n\t} catch(Exception $e) {\n\t\t$out = false;\n\t}\n\n\tif (isset($mbIntEnc))\n\t{\n\t\tmb_internal_encoding($mbIntEnc);\n\t}\n\treturn $out;\n}", "public static function decode($string);", "#[@test]\n public function stringCast() {\n $this->assertSourcecodeEquals(\n '$s= (string)$num;',\n $this->emit('$s= (string)$num;')\n );\n }", "function convertPHPSizeToBytes($sSize) \n{ \n if ( is_numeric( $sSize) ) {\n return $sSize;\n }\n $sSuffix = substr($sSize, -1); \n $iValue = substr($sSize, 0, -1); \n switch(strtoupper($sSuffix)){ \n case 'P':\n $iValue *= 1024;\n case 'T':\n $iValue *= 1024;\n case 'G':\n $iValue *= 1024;\n case 'M':\n $iValue *= 1024;\n case 'K':\n $iValue *= 1024;\n break;\n } \n return $iValue;\n}", "public static function decodeHtmlEntityNumeric($string, $quote_style = ENT_COMPAT, $charset = \"utf-8\") {\n $string = html_entity_decode($string, $quote_style, $charset);\n $string = preg_replace_callback('/&#x([0-9a-fA-F]+)/', '\\Drupal\\migration_tools\\StringTools::convertHexChrToUtf8Callback', $string);\n $string = preg_replace_callback('/&#([0-9]+)/', '\\Drupal\\migration_tools\\StringTools::convertChrToUtf8Callback', $string);\n return $string;\n }", "function setDoXmlUtf8Decoding($value)\n {\n $this->_props['DoXmlUtf8Decoding'] = $value;\n }", "function sNumber( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_SANITIZE_NUMBER_INT ); # int\r\n\t\t\t\r\n\t\t}", "public function decode( string $value ): string;", "function gmp_intval($gmpnumber)\n{\n}", "public function setInt64Field($value)\n {\n return $this->set(self::INT64_FIELD, $value);\n }", "public function getSfixed64Field()\n {\n $value = $this->get(self::SFIXED64_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "function decode($string);", "public function toNative()\n {\n $value = parent::toNative();\n\n return \\intval($value);\n }", "function convertPHPSizeToBytes($sSize)\n{\n\tif (is_numeric($sSize)) {\n\t\treturn $sSize;\n\t}\n\t$sSuffix = substr($sSize, -1);\n\t$iValue = substr($sSize, 0, -1);\n\tswitch (strtoupper($sSuffix)) {\n\t\tcase 'P':\n\t\t\t$iValue *= 1024;\n\t\tcase 'T':\n\t\t\t$iValue *= 1024;\n\t\tcase 'G':\n\t\t\t$iValue *= 1024;\n\t\tcase 'M':\n\t\t\t$iValue *= 1024;\n\t\tcase 'K':\n\t\t\t$iValue *= 1024;\n\t\t\tbreak;\n\t}\n\treturn $iValue;\n}", "protected function _json_decode($str, $asArray = false)\n {\n $str = $this->_reduce_string($str);\n \n switch (strtolower($str)) {\n case 'true':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(true) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return true;\n } else {\n return null;\n }\n break;\n \n case 'false':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(false) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return false;\n } else {\n return null;\n }\n break;\n \n case 'null':\n return null;\n \n default:\n $m = array();\n \n if (is_numeric($str) || ctype_digit($str) || ctype_xdigit($str)) {\n // Return float or int, or null as appropriate\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return ((float) $str == (integer) $str)\n ? (integer) $str\n : (float) $str;\n } else {\n return null;\n }\n break;\n \n } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m)\n && $m[1] == $m[2]) {\n // STRINGS RETURNED IN UTF-8 FORMAT\n $delim = substr($str, 0, 1);\n $chrs = substr($str, 1, -1);\n $utf8 = '';\n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c < $strlen_chrs; ++$c) {\n \n $substr_chrs_c_2 = substr($chrs, $c, 2);\n $ord_chrs_c = ord($chrs{$c});\n \n switch (true) {\n case $substr_chrs_c_2 == '\\b':\n $utf8 .= chr(0x08);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\t':\n $utf8 .= chr(0x09);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\n':\n $utf8 .= chr(0x0A);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\f':\n $utf8 .= chr(0x0C);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\r':\n $utf8 .= chr(0x0D);\n ++$c;\n break;\n \n case $substr_chrs_c_2 == '\\\\\"':\n case $substr_chrs_c_2 == '\\\\\\'':\n case $substr_chrs_c_2 == '\\\\\\\\':\n case $substr_chrs_c_2 == '\\\\/':\n if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n $utf8 .= $chrs{++$c};\n }\n break;\n \n case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n // single, escaped unicode character\n $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n . chr(hexdec(substr($chrs, ($c + 4), 2)));\n $utf8 .= $this->_utf162utf8($utf16);\n $c += 5;\n break;\n \n case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n $utf8 .= $chrs{$c};\n break;\n \n case ($ord_chrs_c & 0xE0) == 0xC0:\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 2);\n ++$c;\n break;\n \n case ($ord_chrs_c & 0xF0) == 0xE0:\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 3);\n $c += 2;\n break;\n \n case ($ord_chrs_c & 0xF8) == 0xF0:\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 4);\n $c += 3;\n break;\n \n case ($ord_chrs_c & 0xFC) == 0xF8:\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 5);\n $c += 4;\n break;\n \n case ($ord_chrs_c & 0xFE) == 0xFC:\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 6);\n $c += 5;\n break;\n \n }\n \n }\n \n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return $utf8;\n } else {\n return null;\n }\n \n } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n // array, or object notation\n \n if ($str{0} == '[') {\n $stk = array(self::IN_ARR);\n $this->_level = self::IN_ARR;\n $arr = array();\n } else {\n if ($asArray) {\n $stk = array(self::IN_OBJ);\n $obj = array();\n } else {\n $stk = array(self::IN_OBJ);\n $obj = new stdClass();\n }\n $this->_level = self::IN_OBJ;\n }\n \n array_push($stk, array('what' => self::SLICE,\n 'where' => 0,\n 'delim' => false));\n \n $chrs = substr($str, 1, -1);\n $chrs = $this->_reduce_string($chrs);\n \n if ($chrs == '') {\n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } else {\n return $obj;\n \n }\n }\n \n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c <= $strlen_chrs; ++$c) {\n \n $top = end($stk);\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n \n if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == self::SLICE))) {\n // found a comma that is not inside a string, array, etc.,\n // OR we've reached the end of the character list\n $slice = substr($chrs, $top['where'], ($c - $top['where']));\n array_push($stk, array('what' => self::SLICE, 'where' => ($c + 1), 'delim' => false));\n //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n if (reset($stk) == self::IN_ARR) {\n $this->_level = self::IN_ARR;\n // we are in an array, so just push an element onto the stack\n array_push($arr, $this->_json_decode($slice));\n \n } elseif (reset($stk) == self::IN_OBJ) {\n $this->_level = self::IN_OBJ;\n // we are in an object, so figure\n // out the property name and set an\n // element in an associative array,\n // for now\n $parts = array();\n \n if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"name\":value pair\n $key = $this->_json_decode($parts[1]);\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // name:value pair, where name is unquoted\n $key = $parts[1];\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*([\"\\'][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"\":value pair\n //$key = $this->_json_decode($parts[1]);\n // use string that matches ext/json\n $key = '_empty_';\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n }\n \n }\n \n } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != self::IN_STR)) {\n // found a quote, and we are not inside a string\n array_push($stk, array('what' => self::IN_STR, 'where' => $c, 'delim' => $chrs{$c}));\n //print(\"Found start of string at {$c}\\n\");\n \n } elseif (($chrs{$c} == $top['delim']) &&\n ($top['what'] == self::IN_STR) &&\n ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n // found a quote, we're in a string, and it's not escaped\n // we know that it's not escaped becase there is _not_ an\n // odd number of backslashes at the end of the string so far\n array_pop($stk);\n //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '[') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-bracket, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_ARR, 'where' => $c, 'delim' => false));\n //print(\"Found start of array at {$c}\\n\");\n \n } elseif (($chrs{$c} == ']') && ($top['what'] == self::IN_ARR)) {\n // found a right-bracket, and we're in an array\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '{') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-brace, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_OBJ, 'where' => $c, 'delim' => false));\n //print(\"Found start of object at {$c}\\n\");\n \n } elseif (($chrs{$c} == '}') && ($top['what'] == self::IN_OBJ)) {\n // found a right-brace, and we're in an object\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($substr_chrs_c_2 == '/*') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a comment start, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_CMT, 'where' => $c, 'delim' => false));\n $c++;\n //print(\"Found start of comment at {$c}\\n\");\n \n } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == self::IN_CMT)) {\n // found a comment end, and we're in one now\n array_pop($stk);\n $c++;\n \n for ($i = $top['where']; $i <= $c; ++$i)\n $chrs = substr_replace($chrs, ' ', $i, 1);\n \n //print(\"Found end of comment at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n }\n \n }\n \n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } elseif (reset($stk) == self::IN_OBJ) {\n return $obj;\n \n }\n \n }\n }\n }", "function bdec($s) {\n\tif (preg_match('/^(\\d+):/', $s, $m)) {\n\t\t$l = $m[1];\n\t\t$pl = strlen($l) + 1;\n\t\t$v = substr($s, $pl, $l);\n\t\t$ss = substr($s, 0, $pl + $l);\n\t\tif (strlen($v) != $l) return;\n\t\treturn array('type' => \"string\", 'value' => $v, 'strlen' => strlen($ss), 'string' => $ss);\n\t}\n\tif (preg_match('/^i(-?\\d+)e/', $s, $m)) {\n\t\t$v = $m[1];\n\t\t$ss = \"i\" . $v . \"e\";\n\t\tif ($v === \"-0\")\n\t\treturn;\n\t\tif ($v[0] == \"0\" && strlen($v) != 1)\n\t\treturn;\n\t\treturn array('type' => \"integer\", 'value' => $v, 'strlen' => strlen($ss), 'string' => $ss);\n\t}\n\tswitch ($s[0]) {\n\t\tcase \"l\":\n\t\t\treturn bdec_list($s);\n\t\tcase \"d\":\n\t\t\treturn bdec_dict($s);\n\t\tdefault:\n\t\t\treturn;\n\t}\n}", "function serendipity_ini_bytesize($val) {\n if ( $val == '' )\n return 0;\n\n switch(substr($val, -1)) {\n case 'k':\n case 'K':\n return (int) $val * 1024;\n break;\n case 'm':\n case 'M':\n return (int) $val * 1048576;\n break;\n default:\n return $val;\n }\n}", "public function hasInt64Field()\n {\n return $this->get(self::INT64_FIELD) !== null;\n }", "function recognize_data_type($string)\n{\n\t$string = mb_strtolower(trim($string), 'UTF-8');\n\n\t// if the data type is empty string or any of bool representations set it as bool\n\tif(empty($string) || is_bool(filter_var($string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)))\n\t\treturn \"BIT\";\n\tif(is_int(filter_var($string, FILTER_VALIDATE_INT))) // else if int set as int\n\t\treturn \"INT\";\n\tif(is_float(filter_var($string, FILTER_VALIDATE_FLOAT))) // or float\n\t\treturn \"FLOAT\";\n\n\treturn \"NTEXT\"; // if neither of them set it to NTEXT (doesn't mather if it is attribute or not, it will be decided later)\n}", "public static function decode_json( $json_string, $assoc = false ) {\n\t\t\t// will cause 502 issue when redirect.\n\t\t\treturn version_compare( phpversion(), '5.6.0' ) >= 0\n\t\t\t? json_decode( $json_string, $assoc, 512, JSON_BIGINT_AS_STRING )\n\t\t\t: json_decode( $json_string, $assoc, 512 );\n\t\t}", "public function testStringCoercion(): void {\n\t\tself::assertNull(Evaluator::stringConvert(null));\n\t\tself::assertNull(Evaluator::stringConvert([]));\n\t\tself::assertNull(Evaluator::stringConvert(new \\stdClass()));\n\n\t\t// Booleans coerced to literal values\n\t\tself::assertSame(\"true\", Evaluator::stringConvert(true));\n\t\tself::assertSame(\"false\", Evaluator::stringConvert(false));\n\n\t\t// Empty and regular strings are preserved\n\t\tself::assertSame(\"\", Evaluator::stringConvert(\"\"));\n\t\tself::assertSame(\"abc\", Evaluator::stringConvert(\"abc\"));\n\n\t\t// Numbers and changed to strings.\n\t\tself::assertSame(\"-1\", Evaluator::stringConvert(-1.0));\n\t\tself::assertSame(\"0\", Evaluator::stringConvert(0.0));\n\t\tself::assertSame(\"1\", Evaluator::stringConvert(1.0));\n\t\tself::assertSame(\"2\", Evaluator::stringConvert(2.0));\n\t\tself::assertSame(\"3\", Evaluator::stringConvert(3.0));\n\t\tself::assertSame(\"-2147483647\", Evaluator::stringConvert(-2147483647.0));\n\t\tself::assertSame(\"9007199254740991\", Evaluator::stringConvert(9007199254740991));\n\t\tself::assertSame(\"-9007199254740991\", Evaluator::stringConvert(-9007199254740991));\n\t\tself::assertSame(\"-1\", Evaluator::stringConvert(-1));\n\t\tself::assertSame(\"0\", Evaluator::stringConvert(0));\n\t\tself::assertSame(\"1\", Evaluator::stringConvert(1));\n\t\tself::assertSame(\"2\", Evaluator::stringConvert(2));\n\t\tself::assertSame(\"3\", Evaluator::stringConvert(3));\n\t\tself::assertSame(\"2147483647\", Evaluator::stringConvert(2147483647));\n\t\tself::assertSame(\"-2147483647\", Evaluator::stringConvert(-2147483647));\n\t\tself::assertSame(\"9007199254740991\", Evaluator::stringConvert(9007199254740991));\n\t\tself::assertSame(\"-9007199254740991\", Evaluator::stringConvert(-9007199254740991));\n\n\t\t// Handling when numbers lose precision.\n\t\tself::assertSame(number_format(0.9007199254740991, ini_get('precision') - 1), Evaluator::stringConvert(0.9007199254740991));\n\t\tself::assertSame(number_format(-0.9007199254740991, ini_get('precision') - 1), Evaluator::stringConvert(-0.9007199254740991));\n\t}", "public function value($string)\n {\n switch ($this->type) {\n case Type::BOOL:\n if ($string == 'Y' || $string == '1') {\n return true;\n } else {\n return false;\n }\n break;\n case Type::INT:\n return intval($string);\n break;\n case Type::FLOAT:\n return floatval($string);\n break;\n default:\n return strval($string);\n }\n }", "function safe_serialize( $value )\n{\n\t// ensure we use the byte count for strings even when strlen() is overloaded by mb_strlen()\n\tif (function_exists('mb_internal_encoding') &&\n\t\t(((int) ini_get('mbstring.func_overload')) & 2))\n\t{\n\t\t$mbIntEnc = mb_internal_encoding();\n\t\tmb_internal_encoding('ASCII');\n\t}\n\n\ttry {\n\t\t$out = _safe_serialize($value);\n\t} catch(Exception $e) {\n\t\t$out = false;\n\t}\n\n\tif (isset($mbIntEnc))\n\t{\n\t\tmb_internal_encoding($mbIntEnc);\n\t}\n\treturn $out;\n}", "public function setCompress($bool) {\n // If gzdecode() and gzencode() exists and $bool == true set output of the hash and encrypt function to be compressed (http://php.net/manual/en/function.gzencode.php)\n if(((function_exists('gzdecode')) && (function_exists('gzencode'))) && (is_bool($bool))) {\n $this->compress = $bool;\n }\n $this->compress = false;\n \n return $this->compress;\n }", "public function passOnEncodingAuto()\n {\n return false;\n }", "public function integer()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_NUMBER_INT);\n\t}", "protected function setDecvalue2Attribute($value) {\n return $value && ( in_array($this->ft_type, $this->IPTypes) ) ? sprintf(\"%u\", ip2long($value)) : $value;\n }", "function let_to_num($v){ //This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)\n $l = substr($v, -1);\n $ret = substr($v, 0, -1);\n switch(strtoupper($l)){\n case 'P': $ret *= 1024;\n case 'T': $ret *= 1024;\n case 'G': $ret *= 1024;\n case 'M': $ret *= 1024;\n case 'K': $ret *= 1024;\n break;\n }\n return $ret;\n}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "function NeedQuotesNumeric($type)\n{\n if($type == 203 || $type == 8 || $type == 129 || $type == 130 || \n\t\t$type == 7 || $type == 133 || $type == 134 || $type == 135 ||\n\t\t$type == 201 || $type == 205 || $type == 200 || $type == 202 || $type==72 || $type==13)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function get_string_number($num) {\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables();\n $meta = $this->ORIGINALS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "function json_encode2($arr){\r\n\tarray_walk_recursive($arr, function (&$item, $key) {\r\n\t\tif (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\r\n\t});\r\n\treturn mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\r\n}", "public function getInt64(bool $isNullable): IPrimitiveTypeReference\n {\n return new EdmPrimitiveTypeReference($this->getCoreModelPrimitiveType(PrimitiveTypeKind::Int64()), $isNullable);\n }", "public function numericLiteralUnsigned(){\n try {\n // Sparql11query.g:551:3: ( INTEGER | DECIMAL | DOUBLE ) \n // Sparql11query.g: \n {\n if ( $this->input->LA(1)==$this->getToken('INTEGER')||$this->input->LA(1)==$this->getToken('DECIMAL')||$this->input->LA(1)==$this->getToken('DOUBLE') ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function convertNumbersToFarsi($srting,$mode='html')\n\t{\n\t\tif ($mode=='html') {\n\t\t\t$num0=\"&#1776;\";\n\t\t\t$num1=\"&#1777;\";\n\t\t\t$num2=\"&#1778;\";\n\t\t\t$num3=\"&#1779;\";\n\t\t\t$num4=\"&#1780;\";\n\t\t\t$num5=\"&#1781;\";\n\t\t\t$num6=\"&#1782;\";\n\t\t\t$num7=\"&#1783;\";\n\t\t\t$num8=\"&#1784;\";\n\t\t\t$num9=\"&#1785;\";\n\t\t} elseif($mode=='plainText') {\n\t\t\t$num0=chr(hexdec('DB')).chr(hexdec('B0'));\n\t\t\t$num1=chr(hexdec('DB')).chr(hexdec('B1'));\n\t\t\t$num2=chr(hexdec('DB')).chr(hexdec('B2'));\n\t\t\t$num3=chr(hexdec('DB')).chr(hexdec('B3'));\n\t\t\t$num4=chr(hexdec('DB')).chr(hexdec('B4'));\n\t\t\t$num5=chr(hexdec('DB')).chr(hexdec('B5'));\n\t\t\t$num6=chr(hexdec('DB')).chr(hexdec('B6'));\n\t\t\t$num7=chr(hexdec('DB')).chr(hexdec('B7'));\n\t\t\t$num8=chr(hexdec('DB')).chr(hexdec('B8'));\n\t\t\t$num9=chr(hexdec('DB')).chr(hexdec('B9'));\n\t\t}\n\n\t\t$stringtemp=\"\";\n\t\t$len=strlen($srting);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif(substr($srting,$sub,1)==\"0\")$stringtemp.=$num0;\n\t\t\telseif(substr($srting,$sub,1)==\"1\")$stringtemp.=$num1;\n\t\t\telseif(substr($srting,$sub,1)==\"2\")$stringtemp.=$num2;\n\t\t\telseif(substr($srting,$sub,1)==\"3\")$stringtemp.=$num3;\n\t\t\telseif(substr($srting,$sub,1)==\"4\")$stringtemp.=$num4;\n\t\t\telseif(substr($srting,$sub,1)==\"5\")$stringtemp.=$num5;\n\t\t\telseif(substr($srting,$sub,1)==\"6\")$stringtemp.=$num6;\n\t\t\telseif(substr($srting,$sub,1)==\"7\")$stringtemp.=$num7;\n\t\t\telseif(substr($srting,$sub,1)==\"8\")$stringtemp.=$num8;\n\t\t\telseif(substr($srting,$sub,1)==\"9\")$stringtemp.=$num9;\n\t\t\telse $stringtemp.=substr($srting,$sub,1);\n\t\t}\n\t\treturn $stringtemp;\n\t}", "public function getSint64Field()\n {\n $value = $this->get(self::SINT64_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "function decode($string){\n $string = utf8_decode($string);\n // decod it again in case it is encoded twice\n $string = utf8_decode($string);\n // remove the charecters inserted while decoding\n $string = str_ireplace(\"?\", \"'\", $string);\n $string = addslashes(trim($string));\n return $string;\n}", "public function testDecodeIntegerFakeFloat()\n {\n $this->expectException(ParseException::class);\n $this->expectExceptionMessage('Invalid integer format or integer overflow');\n\n Bencode::decode('i2.71828e');\n }", "function decodeString($string);", "public function isNum(): bool\n {\n return \\wasm_valtype_is_num($this->inner);\n }", "function mbstring_binary_safe_encoding($reset = \\false)\n {\n }", "public static function phpize($value)\n {\n $value = (string) $value;\n $lowercaseValue = \\strtolower($value);\n\n if ('null' === $lowercaseValue) {\n return;\n }\n\n if (\\ctype_digit($value)) {\n return self::transformToNumber($value, 0);\n }\n\n if (isset($value[1]) && '-' === $value[0] && \\ctype_digit(\\substr($value, 1))) {\n return self::transformToNumber($value, 1);\n }\n\n if ($lowercaseValue === 'true') {\n return true;\n }\n\n if ('false' === $lowercaseValue) {\n return false;\n }\n\n if (isset($value[1]) && '0b' === $value[0] . $value[1]) {\n return \\bindec($value);\n }\n\n if (\\is_numeric($value)) {\n return '0x' === $value[0] . $value[1] ? \\hexdec($value) : (float) $value;\n }\n\n if (\\preg_match('/^0x[0-9a-f]++$/i', $value) === 1) {\n return \\hexdec($value);\n }\n\n if (\\preg_match('/^(-|\\+)?\\d+(\\.\\d+)?$/', $value) === 1) {\n return (float) $value;\n }\n\n return $value;\n }", "public function decode($data);", "abstract public function decode($data);", "function decode(String $data)\n\t{\n\n\t\treturn base64_decode($data) ?? false;\n\n\t}", "function decode($s) {\n if ($this->kod == 1) {\n $s = $this->win_utf8($s);\n }\n return $s;\n }", "public function decodeValue($value)\n {\n if ($value !== false) {\n if ($this->format == self::JSON) {\n $value = json_decode($value, true);\n } else if ($this->format == self::PHP) {\n $value = unserialize($value);\n }\n }\n\n return $value;\n }", "function pgtype_isnumber ($field_type) {\n\tswitch (strtolower(trim($field_type))) {\n\t\tcase 'bool': // a boolean from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'int2': // a small integer from a pg database\n\t\tcase 'int4': // an integer from a pg database\n\t\tcase 'int8': // a long integer from a pg database\n\t\t\t$output = true;\n\t\t\tbreak;\n\t\tcase 'numeric': // a \"numeric\" real number field from a pg database\n\t\tcase 'float4': // a single precision real number field from a pg database\n\t\tcase 'float8': // a double precision real number field from a pg database\n\t\t\t$output = true;\n\t\t\tbreak;\n\t\tcase 'date': // a date field from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'time': // a time field from a pg database\n\t\tcase 'timetz': // a time field with timezone from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'timestamp': // a timestamp field from a pg database\n\t\tcase 'timestamptz': // a timestamp field with timezone from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tcase 'text': // a text field from a pg database\n\t\tcase 'varchar': // a varchar field from a pg database\n\t\tcase 'bpchar': // a bpchar field from a pg database\n\t\t\t$output = false;\n\t\t\tbreak;\n\t\tdefault: // an unanticipated field type, put a text box or single selects, but may not work\n\t\t\t$output = false;\n\t}\n\treturn $output;\n}", "public function toInteger(&$value = false)\n {\n try{\n $value = (int)$value;\n }\n catch(\\Exception $e){\n $value = 0;\n }\n }", "public static function BigNumber($Number) {\n if (!is_numeric($Number))\n return $Number;\n\n if ($Number >= 1000000000) {\n $Number = $Number / 1000000000;\n $Suffix = \"B\";\n } elseif ($Number >= 1000000) {\n $Number = $Number / 1000000;\n $Suffix = \"M\";\n } elseif ($Number >= 1000) {\n $Number = $Number / 1000;\n $Suffix = \"K\";\n }\n\n if (isset($Suffix)) {\n return number_format($Number, 1).$Suffix;\n } else {\n return $Number;\n }\n }", "private function getByteTnc($int, $flg=true) {\n if(preg_match(\"/^[\\d]*?$/isx\",$int)){\n $keta = strlen($int);\n if($int == \"\" || $int == 0){\n $size = $int;\n $type = \"KB\";\n }elseif($keta < 4){\n $size = $int;\n $type = \"B\";\n }elseif($keta < 7){\n $size = ($flg)?ceil($int/1000) : round($int/1000,2);\n $type = \"KB\";\n }elseif($keta < 10){\n $size = ($flg)?ceil($int/1000000) : round($int/1000000,2);\n //$size = ceil($int/1000000);\n $type = \"MB\";\n }elseif($keta < 13){\n //$size = ($flg)?ceil($int/1000000000) : round($int/1000000000,2);\n $size = ($flg)?ceil($int/10000000) : round($int/10000000,2);\n $size = $size / 100;\n //$size = ceil($int/1000000000);\n $type = \"GB\";\n }\n }\n return \"$size$type\";\n }", "public function cast($value, bool $isSamplifying = true): string\n {\n if (is_null($value)) {\n return \"null\";\n }\n if (is_bool($value)) {\n return ($value ? \"true\" : \"false\");\n }\n if (is_numeric($value)) {\n return strval($value);\n }\n if (is_string($value)) {\n if ($this->customStringFormatterCollection && $this->customStringFormatterCollection->count()) {\n foreach ($this->customStringFormatterCollection as $stringFormatter) {\n $stringFormatter = $stringFormatter->withIsPrependingType(false);\n $stringFormatter = $stringFormatter->withIsSamplifying($isSamplifying);\n $return = $stringFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $stringFormatter = $this->defaultStringFormatter->withIsPrependingType(false);\n $stringFormatter = $stringFormatter->withIsSamplifying($isSamplifying);\n return $stringFormatter->formatEnsureString($value);\n }\n if (is_object($value)) {\n if ($this->customObjectFormatterCollection && $this->customObjectFormatterCollection->count()) {\n foreach ($this->customObjectFormatterCollection as $objectFormatter) {\n $objectFormatter = $objectFormatter->withIsPrependingType(false);\n $return = $objectFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $objectFormatter = $this->defaultObjectFormatter->withIsPrependingType(false);\n $objectFormatter = $objectFormatter->withIsSamplifying($isSamplifying);\n return $objectFormatter->formatEnsureString($value);\n }\n if (is_array($value)) {\n if ($this->customArrayFormatterCollection && $this->customArrayFormatterCollection->count()) {\n foreach ($this->customArrayFormatterCollection as $arrayFormatter) {\n $arrayFormatter = $arrayFormatter->withIsPrependingType(false);\n $arrayFormatter = $arrayFormatter->withIsSamplifying($isSamplifying);\n $return = $arrayFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $arrayFormatter = $this->defaultArrayFormatter->withIsPrependingType(false);\n $arrayFormatter = $arrayFormatter->withIsSamplifying($isSamplifying);\n return $arrayFormatter->formatEnsureString($value);\n }\n if (is_resource($value)) {\n if ($this->customResourceFormatterCollection && $this->customResourceFormatterCollection->count()) {\n foreach ($this->customResourceFormatterCollection as $resourceFormatter) {\n $resourceFormatter = $resourceFormatter->withIsPrependingType(false);\n $resourceFormatter = $resourceFormatter->withIsSamplifying($isSamplifying);\n $return = $resourceFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $resourceFormatter = $this->defaultResourceFormatter->withIsPrependingType(false);\n $resourceFormatter = $resourceFormatter->withIsSamplifying($isSamplifying);\n return $resourceFormatter->formatEnsureString($value);\n }\n return $this->maskString(@strval($value));\n }", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "public function getDefaultDecodeArray() {}", "static function decodeLarge(Decoder $etf, string $data, int &$pos): BaseObject {\n $length = \\unpack('N', $data[$pos++].$data[$pos++].$data[$pos++].$data[$pos])[1];\n \n $tuple = array();\n for(; $length > 0; $length--) {\n $tuple[] = $etf->parseAny($data[++$pos], $data, $pos);\n }\n \n return (new static($tuple));\n }", "public function toDec()\n {\n if (!$this->internalBin) return false;\n return bindec($this->internalBin);\n }", "function my_json_encode($arr) {\n array_walk_recursive($arr, function (&$item, $key) { if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); });\n return mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8');\n}", "public function convertToUserIntObject() {}", "private static function decode($string)\n {\n return base64_decode($string);\n }", "public function cleanint($string){\n return mysqli_real_escape_string($this->db, strip_tags(trim((int)$string)));\n }", "function convert_data_encodings($known_utf8 = false)\n{\n global $VALID_ENCODING, $CONVERTED_ENCODING;\n $VALID_ENCODING = true;\n\n if ($CONVERTED_ENCODING) {\n return; // Already done it\n }\n\n if (preg_match('#^[\\x00-\\x7F]*$#', serialize($_POST) . serialize($_GET) . serialize($_FILES)) != 0) { // Simple case, all is ASCII\n $CONVERTED_ENCODING = true;\n return;\n }\n\n require_code('character_sets');\n _convert_data_encodings($known_utf8);\n}", "public static function lookupDecimal($int)\n {\n $entity = '&#' . $int . ';';\n\n // UNTESTED: This may fail on some planes. Couldn't find full documentation\n // on the value of the mask array.\n return mb_decode_numericentity($entity, static::$numeric_mask, 'utf-8');\n }", "public function getter_numeric()\n\t{\n\t\treturn $this->numeric = strtolower($this->packet->numeric);\n\t}", "protected function cast($ini)\n {\n if (gettype($ini) === \"array\") {\n foreach ($ini as $key => $value) {\n $ini[$key] = $this->cast($value);\n }\n\n return $ini;\n }\n\n // Decode true\n $ini = (string) $ini;\n $lowerIni = strtolower($ini);\n\n switch ($lowerIni) {\n case \"true\":\n case \"yes\":\n case \"on\":\n return true;\n case \"false\":\n case \"no\":\n case \"off\":\n return false;\n case \"null\":\n return null;\n }\n\n // Decode float/int\n if (gettype($ini) === \"string\" && is_numeric($ini)) {\n if (preg_match(\"/[.]+/\", $ini)) {\n return (double) $ini;\n } else {\n return (int) $ini;\n }\n }\n\n return $ini;\n }", "public function set_typeNum()\n {\n // init the map\n $this->initVarTypeNum();\n }", "protected function castify($value)\n {\n if (preg_match('/^\\-?([0-9]+)$/', $value)) {\n return intval($value);\n }\n\n if (preg_match('/^\\-?\\d+(\\.\\d+)?$/', $value)) {\n // @todo fix json returning float values.\n // return floatval($value);\n\n return $value;\n }\n\n return $value;\n }", "function decode($string, $key = '')\n {\n $key = $this->getKey($key);\n\n if (preg_match('/[^a-zA-Z0-9\\/\\+=]/', $string)) {\n return false;\n }\n\n $dec = base64_decode($string);\n\n if (($dec = $this->mcryptDecode($dec, $key)) === false) {\n return false;\n }\n\n return $dec;\n }", "function parse_bytes($str)\n{\n if (is_numeric($str))\n return floatval($str);\n\n if (preg_match('/([0-9\\.]+)\\s*([a-z]*)/i', $str, $regs))\n {\n $bytes = floatval($regs[1]);\n switch (strtolower($regs[2]))\n {\n case 'g':\n case 'gb':\n $bytes *= 1073741824;\n break;\n case 'm':\n case 'mb':\n $bytes *= 1048576;\n break;\n case 'k':\n case 'kb':\n $bytes *= 1024;\n break;\n }\n }\n\n return floatval($bytes);\n}", "public function getValueNeedsEncoding()\n\t{\n\t\treturn $this->valueNeedsEncoding;\n\t}", "function isNum($s){return is_numeric($s) ? true : false;}", "function readLong();", "public function typeCast($value, bool $isSamplifying = true): string\n {\n if (is_null($value)) {\n return \"(null) null\";\n }\n if (is_bool($value)) {\n return \"(bool) \" . ($value ? \"true\" : \"false\");\n }\n if (is_int($value)) {\n return sprintf(\n \"(int) %d\",\n $value\n );\n }\n if (is_float($value)) {\n return sprintf(\n \"(float) %s\",\n strval($value)\n );\n }\n if (is_string($value)) {\n if ($this->customStringFormatterCollection && $this->customStringFormatterCollection->count()) {\n foreach ($this->customStringFormatterCollection as $stringFormatter) {\n $stringFormatter = $stringFormatter->withIsPrependingType(true);\n $stringFormatter = $stringFormatter->withIsSamplifying($isSamplifying);\n $return = $stringFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $stringFormatter = $this->defaultStringFormatter->withIsPrependingType(true);\n $stringFormatter = $stringFormatter->withIsSamplifying($isSamplifying);\n return $stringFormatter->formatEnsureString($value);\n }\n if (is_object($value)) {\n if ($this->customObjectFormatterCollection && $this->customObjectFormatterCollection->count()) {\n foreach ($this->customObjectFormatterCollection as $objectFormatter) {\n $objectFormatter = $objectFormatter->withIsPrependingType(true);\n $objectFormatter = $objectFormatter->withIsSamplifying($isSamplifying);\n $return = $objectFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $objectFormatter = $this->defaultObjectFormatter->withIsPrependingType(true);\n $objectFormatter = $objectFormatter->withIsSamplifying($isSamplifying);\n return $objectFormatter->formatEnsureString($value);\n }\n if (is_array($value)) {\n if ($this->customArrayFormatterCollection && $this->customArrayFormatterCollection->count()) {\n foreach ($this->customArrayFormatterCollection as $arrayFormatter) {\n $arrayFormatter = $arrayFormatter->withIsPrependingType(true);\n $arrayFormatter = $arrayFormatter->withIsSamplifying($isSamplifying);\n $return = $arrayFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $arrayFormatter = $this->defaultArrayFormatter->withIsPrependingType(true);\n $arrayFormatter = $arrayFormatter->withIsSamplifying($isSamplifying);\n return $arrayFormatter->formatEnsureString($value);\n }\n if (is_resource($value)) {\n if (is_resource($value)) {\n if ($this->customResourceFormatterCollection && $this->customResourceFormatterCollection->count()) {\n foreach ($this->customResourceFormatterCollection as $resourceFormatter) {\n $resourceFormatter = $resourceFormatter->withIsPrependingType(true);\n $resourceFormatter = $resourceFormatter->withIsSamplifying($isSamplifying);\n $return = $resourceFormatter->format($value);\n if (is_string($return)) {\n return $return;\n }\n }\n }\n $resourceFormatter = $this->defaultResourceFormatter->withIsPrependingType(true);\n $resourceFormatter = $resourceFormatter->withIsSamplifying($isSamplifying);\n return $resourceFormatter->formatEnsureString($value);\n }\n }\n return sprintf(\n \"(%s) %s\",\n gettype($value),\n @strval($value)\n );\n }", "public function numeri($stringa){\n\t\tif(is_numeric($stringa)){\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n\t}" ]
[ "0.52045685", "0.49257323", "0.48524478", "0.4785425", "0.47731543", "0.47625807", "0.47625807", "0.47390553", "0.47157404", "0.47094858", "0.4672091", "0.4671966", "0.46702823", "0.4654155", "0.4602843", "0.46012262", "0.4599378", "0.4571371", "0.4551129", "0.45414078", "0.4525128", "0.45054564", "0.44922844", "0.44914034", "0.4468655", "0.44490504", "0.44443363", "0.44326124", "0.44273707", "0.44151023", "0.4406115", "0.43842122", "0.43663517", "0.43403155", "0.4336109", "0.43230963", "0.43162313", "0.43109208", "0.43102652", "0.42993078", "0.42988658", "0.42701086", "0.4257474", "0.42548037", "0.42500022", "0.42478967", "0.4244444", "0.4238379", "0.4238379", "0.4238379", "0.4238379", "0.4238379", "0.42232108", "0.42133796", "0.42081136", "0.41966823", "0.41905528", "0.4171927", "0.41714495", "0.4169237", "0.41674495", "0.41644335", "0.41573483", "0.41434687", "0.41422766", "0.4131581", "0.41267252", "0.41156742", "0.41131753", "0.40981397", "0.40830252", "0.40810934", "0.40810704", "0.40786213", "0.40777767", "0.4077684", "0.4077684", "0.4077684", "0.4077684", "0.4077684", "0.4077684", "0.40686235", "0.40674713", "0.40601248", "0.40569675", "0.4046724", "0.4043768", "0.4041791", "0.40408802", "0.40407604", "0.40390152", "0.40388507", "0.40365607", "0.4028803", "0.4027475", "0.402296", "0.40220034", "0.40204263", "0.40186855", "0.40180755" ]
0.6933729
0
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'title' => 'required', 'description' => 'required', // 'image' => 'required', 'section_id' => 'required' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342797", "0.8013068", "0.79357624", "0.79257727", "0.7922943", "0.7903906", "0.7859204", "0.7789624", "0.7783409", "0.77624106", "0.773673", "0.7732383", "0.77094924", "0.7691624", "0.7684878", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.76753145", "0.76747704", "0.76653886", "0.7656984", "0.7641385", "0.7629662", "0.7629557", "0.7617277", "0.76092637", "0.7607173", "0.7602176", "0.7598716", "0.7597812", "0.7591812", "0.75902253", "0.7587347", "0.7579866", "0.75553906", "0.7555079", "0.75503534", "0.75459445", "0.7540463", "0.7536189", "0.75356364", "0.75300074", "0.75181943", "0.7514811", "0.75078565", "0.7506201", "0.75052506", "0.7498871", "0.7495198", "0.7494957", "0.7493081", "0.74902064", "0.7489407", "0.74890095", "0.7485984", "0.74858546", "0.7478957", "0.74781555", "0.74693084", "0.74632835", "0.7461654", "0.746117", "0.745908", "0.74546385", "0.7453331", "0.7452256", "0.7449815", "0.74481654", "0.7441297", "0.74408644", "0.7435215", "0.743476", "0.7432712", "0.74296844", "0.74289936", "0.7423239", "0.7418971", "0.74155754", "0.7413715", "0.7413531", "0.7412177", "0.7409704", "0.740534", "0.74039155", "0.7403364", "0.740084", "0.73900056", "0.73831314", "0.73729247", "0.7370593", "0.73688376", "0.73608065", "0.7355452", "0.7346383", "0.73441696", "0.73426807", "0.73349255" ]
0.0
-1