_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q255900
Analytics.getUrl
test
public function getUrl() { $prepareUrl = new PrepareUrl; return $prepareUrl->build( $this->getEndpoint(), $this->singleParameters, $this->compoundParametersCollections ); }
php
{ "resource": "" }
q255901
Analytics.hasMinimumRequiredParameters
test
protected function hasMinimumRequiredParameters() { $minimumRequiredParameters = [ 'v' => false, 'tid' => false, 'cid' => false, 'uid' => false, 't' => false, ]; foreach ($minimumRequiredParameters as $parameterName => $isParamPres...
php
{ "resource": "" }
q255902
Analytics.setParameterActionTo
test
protected function setParameterActionTo($parameter, $action) { $actionConstant = $this->getParameterClassConstant( 'TheIconic\Tracking\GoogleAnalytics\Parameters\EnhancedEcommerce\\' . $parameter . 'Action::ACTION_' . strtoupper($action), $parameter . ' action ' . $action...
php
{ "resource": "" }
q255903
Analytics.setParameter
test
protected function setParameter($methodName, array $methodArguments) { $parameterClass = substr($methodName, 3); $fullParameterClass = $this->getFullParameterClass($parameterClass, $methodName); $parameterIndex = $this->getIndexFromArguments($methodArguments); /** @var SingleParam...
php
{ "resource": "" }
q255904
Analytics.addItem
test
protected function addItem($methodName, array $methodArguments) { $parameterClass = substr($methodName, 3); $fullParameterClass = $this->getFullParameterClass($parameterClass, $methodName); if (!isset($methodArguments[0])) { throw new \InvalidArgumentException( ...
php
{ "resource": "" }
q255905
Analytics.getParameter
test
protected function getParameter($methodName, array $methodArguments) { $parameterClass = substr($methodName, 3); $fullParameterClass = $this->getFullParameterClass($parameterClass, $methodName); // Handle index arguments $parameterIndex = ''; if (isset($methodArguments[0]) ...
php
{ "resource": "" }
q255906
Analytics.getIndexFromArguments
test
protected function getIndexFromArguments($methodArguments) { $index = ''; if (isset($methodArguments[1]) && is_numeric($methodArguments[1])) { $index = $methodArguments[1]; } return $index; }
php
{ "resource": "" }
q255907
Analytics.getFullParameterClass
test
protected function getFullParameterClass($parameterClass, $methodName) { if (empty($this->availableParameters[$parameterClass])) { throw new \BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class'); } else { return '\\TheIconic\\Tracking\\GoogleAn...
php
{ "resource": "" }
q255908
HttpClient.post
test
public function post($url, array $options = []) { $request = new Request( 'GET', $url, ['User-Agent' => self::PHP_GA_MEASUREMENT_PROTOCOL_USER_AGENT] ); $opts = $this->parseOptions($options); $response = $this->getClient()->sendAsync($request, [ ...
php
{ "resource": "" }
q255909
HttpClient.parseOptions
test
private function parseOptions(array $options) { $defaultOptions = [ 'timeout' => static::REQUEST_TIMEOUT_SECONDS, 'async' => false, ]; $opts = []; foreach ($defaultOptions as $option => $value) { $opts[$option] = isset($options[$option]) ? $option...
php
{ "resource": "" }
q255910
CompoundParameterCollection.getReadableItems
test
public function getReadableItems() { $readablesItems = []; foreach ($this->items as $key => $item) { array_push($readablesItems, $item->getReadableParameters()); } return $readablesItems; }
php
{ "resource": "" }
q255911
CreditCard.addSupportedBrand
test
public function addSupportedBrand($name, $expression) { $known_brands = array_keys($this->supported_cards); if (in_array($name, $known_brands)) { return false; } $this->supported_cards[$name] = $expression; return true; }
php
{ "resource": "" }
q255912
CreditCard.setYearParameter
test
protected function setYearParameter($key, $value) { // normalize year to four digits if (null === $value || '' === $value) { $value = null; } else { $value = (int) gmdate('Y', gmmktime(0, 0, 0, 1, 1, (int) $value)); } return $this->setParameter($key, ...
php
{ "resource": "" }
q255913
CreditCard.validate
test
public function validate() { $requiredParameters = array( 'number' => 'credit card number', 'expiryMonth' => 'expiration month', 'expiryYear' => 'expiration year' ); foreach ($requiredParameters as $key => $val) { if (!$this->getParameter($key...
php
{ "resource": "" }
q255914
CreditCard.getNumberMasked
test
public function getNumberMasked($mask = 'X') { $maskLength = strlen($this->getNumber()) - 4; return str_repeat($mask, $maskLength) . $this->getNumberLastFour(); }
php
{ "resource": "" }
q255915
CreditCard.getBrand
test
public function getBrand() { foreach ($this->getSupportedBrands() as $brand => $val) { if (preg_match($val, $this->getNumber())) { return $brand; } } }
php
{ "resource": "" }
q255916
CreditCard.getTrackByPattern
test
protected function getTrackByPattern($pattern) { if ($tracks = $this->getTracks()) { if (preg_match($pattern, $tracks, $matches) === 1) { return $matches[0]; } } }
php
{ "resource": "" }
q255917
CreditCard.listFirstLastName
test
protected function listFirstLastName($fullName) { $names = explode(' ', $fullName, 2); return [$names[0], isset($names[1]) ? $names[1] : null]; }
php
{ "resource": "" }
q255918
CreditCard.setBillingName
test
public function setBillingName($value) { $names = $this->listFirstLastName($value); $this->setBillingFirstName($names[0]); $this->setBillingLastName($names[1]); return $this; }
php
{ "resource": "" }
q255919
CreditCard.setShippingName
test
public function setShippingName($value) { $names = $this->listFirstLastName($value); $this->setShippingFirstName($names[0]); $this->setShippingLastName($names[1]); return $this; }
php
{ "resource": "" }
q255920
CreditCard.getBirthday
test
public function getBirthday($format = 'Y-m-d') { $value = $this->getParameter('birthday'); return $value ? $value->format($format) : null; }
php
{ "resource": "" }
q255921
CreditCard.setBirthday
test
public function setBirthday($value) { if ($value) { $value = new DateTime($value, new DateTimeZone('UTC')); } else { $value = null; } return $this->setParameter('birthday', $value); }
php
{ "resource": "" }
q255922
AbstractRequest.initialize
test
public function initialize(array $parameters = array()) { if (null !== $this->response) { throw new RuntimeException('Request cannot be modified after it has been sent!'); } $this->parameters = new ParameterBag; Helper::initialize($this, $parameters); return $t...
php
{ "resource": "" }
q255923
AbstractRequest.setParameter
test
protected function setParameter($key, $value) { if (null !== $this->response) { throw new RuntimeException('Request cannot be modified after it has been sent!'); } return $this->traitSetParameter($key, $value); }
php
{ "resource": "" }
q255924
AbstractRequest.setCard
test
public function setCard($value) { if ($value && !$value instanceof CreditCard) { $value = new CreditCard($value); } return $this->setParameter('card', $value); }
php
{ "resource": "" }
q255925
AbstractRequest.getAmount
test
public function getAmount() { $money = $this->getMoney(); if ($money !== null) { $moneyFormatter = new DecimalMoneyFormatter($this->getCurrencies()); return $moneyFormatter->format($money); } }
php
{ "resource": "" }
q255926
AbstractRequest.setMoney
test
public function setMoney(Money $value) { $currency = $value->getCurrency()->getCode(); $this->setCurrency($currency); return $this->setParameter('amount', $value); }
php
{ "resource": "" }
q255927
AbstractRequest.setCurrency
test
public function setCurrency($value) { if ($value !== null) { $value = strtoupper($value); } return $this->setParameter('currency', $value); }
php
{ "resource": "" }
q255928
AbstractRequest.getCurrencyNumeric
test
public function getCurrencyNumeric() { if (! $this->getCurrency()) { return null; } $currency = new Currency($this->getCurrency()); if ($this->getCurrencies()->contains($currency)) { return (string) $this->getCurrencies()->numericCodeFor($currency); ...
php
{ "resource": "" }
q255929
AbstractRequest.getCurrencyDecimalPlaces
test
public function getCurrencyDecimalPlaces() { if ($this->getCurrency()) { $currency = new Currency($this->getCurrency()); if ($this->getCurrencies()->contains($currency)) { return $this->getCurrencies()->subunitFor($currency); } } return 2;...
php
{ "resource": "" }
q255930
AbstractRequest.formatCurrency
test
public function formatCurrency($amount) { $money = $this->getMoney((string) $amount); $formatter = new DecimalMoneyFormatter($this->getCurrencies()); return $formatter->format($money); }
php
{ "resource": "" }
q255931
ItemBag.replace
test
public function replace(array $items = array()) { $this->items = array(); foreach ($items as $item) { $this->add($item); } }
php
{ "resource": "" }
q255932
AbstractResponse.validateRedirect
test
protected function validateRedirect() { if (!$this instanceof RedirectResponseInterface || !$this->isRedirect()) { throw new RuntimeException('This response does not support redirection.'); } if (empty($this->getRedirectUrl())) { throw new RuntimeException('The given...
php
{ "resource": "" }
q255933
Helper.camelCase
test
public static function camelCase($str) { $str = self::convertToLowercase($str); return preg_replace_callback( '/_([a-z])/', function ($match) { return strtoupper($match[1]); }, $str ); }
php
{ "resource": "" }
q255934
Helper.validateLuhn
test
public static function validateLuhn($number) { $str = ''; foreach (array_reverse(str_split($number)) as $i => $c) { $str .= $i % 2 ? $c * 2 : $c; } return array_sum(str_split($str)) % 10 === 0; }
php
{ "resource": "" }
q255935
Helper.getGatewayShortName
test
public static function getGatewayShortName($className) { if (0 === strpos($className, '\\')) { $className = substr($className, 1); } if (0 === strpos($className, 'Omnipay\\')) { return trim(str_replace('\\', '_', substr($className, 8, -7)), '_'); } r...
php
{ "resource": "" }
q255936
Helper.getGatewayClassName
test
public static function getGatewayClassName($shortName) { if (0 === strpos($shortName, '\\')) { return $shortName; } // replace underscores with namespace marker, PSR-0 style $shortName = str_replace('_', '\\', $shortName); if (false === strpos($shortName, '\\')) ...
php
{ "resource": "" }
q255937
ProxyQuery.getFixedQueryBuilder
test
protected function getFixedQueryBuilder(QueryBuilder $queryBuilder) { $queryBuilderId = clone $queryBuilder; $rootAlias = current($queryBuilderId->getRootAliases()); // step 1 : retrieve the targeted class $from = $queryBuilderId->getDQLPart('from'); $class = $from[0]->getFr...
php
{ "resource": "" }
q255938
ModelManager.getParentMetadataForProperty
test
public function getParentMetadataForProperty($baseClass, $propertyFullName) { $nameElements = explode('.', $propertyFullName); $lastPropertyName = array_pop($nameElements); $class = $baseClass; $parentAssociationMappings = []; foreach ($nameElements as $nameElement) { ...
php
{ "resource": "" }
q255939
DatagridBuilder.getPager
test
protected function getPager($pagerType) { switch ($pagerType) { case Pager::TYPE_DEFAULT: return new Pager(); case Pager::TYPE_SIMPLE: return new SimplePager(); default: throw new \RuntimeException(sprintf('Unknown pager t...
php
{ "resource": "" }
q255940
ModelFilter.getParentAlias
test
private function getParentAlias(ProxyQueryInterface $queryBuilder, $alias) { $parentAlias = $rootAlias = current($queryBuilder->getRootAliases()); $joins = $queryBuilder->getDQLPart('join'); if (isset($joins[$rootAlias])) { foreach ($joins[$rootAlias] as $join) { ...
php
{ "resource": "" }
q255941
QuickBooks_IPP_Service._add
test
protected function _add($Context, $realmID, $resource, $Object) { $IPP = $Context->IPP(); switch ($IPP->version()) { case QuickBooks_IPP_IDS::VERSION_2: return $this->_add_v2($Context, $realmID, $resource, $Object); case QuickBooks_IPP_IDS::VERSION_3: return $this->_add_v3($Context, $realmID, $res...
php
{ "resource": "" }
q255942
QuickBooks_IPP_Service._findById
test
protected function _findById($Context, $realmID, $resource, $IDType, $xml_or_IDType = '', $query = null) { $IPP = $Context->IPP(); $flavor = $IPP->flavor(); if (!$xml_or_IDType) { if ($flavor == QuickBooks_IPP_IDS::FLAVOR_DESKTOP) { $parse = QuickBooks_IPP_IDS::parseIDType($IDType); $xml_or_ID...
php
{ "resource": "" }
q255943
QuickBooks_Adapter_Client_Php.authenticate
test
public function authenticate($user, $pass) { $req = new QuickBooks_Request_Authenticate($user, $pass); $resp = parent::__soapCall('authenticate', array( $req )); $tmp = current($resp); return current($tmp); }
php
{ "resource": "" }
q255944
QuickBooks_QBXML_Object_Customer.setParentApplicationID
test
public function setParentApplicationID($id) { return $this->set('ParentRef ' . QUICKBOOKS_API_APPLICATIONID, $this->encodeApplicationID(QUICKBOOKS_OBJECT_CUSTOMER, QUICKBOOKS_LISTID, $id)); }
php
{ "resource": "" }
q255945
QuickBooks_QBXML_Object_Customer.setCreditCardInfo
test
public function setCreditCardInfo($cardno, $expmonth, $expyear, $name, $address, $postalcode) { // should probably do better checking here for failed sets. $b = FALSE; $b = $this->set('CreditCardInfo CreditCardNumber', $cardno); $b = $this->set('CreditCardInfo ExpirationMonth', $expmonth); $b = $this->set('C...
php
{ "resource": "" }
q255946
QuickBooks_QBXML_Object_Customer.getCreditCardInfo
test
public function getCreditCardInfo($part = null, $defaults = array()) { if (!is_null($part)) { return $this->get('CreditCardInfo ' . $part); } return $this->getArray('CreditCardInfo *', $defaults); }
php
{ "resource": "" }
q255947
QuickBooks_IPP_Service_Class.add
test
public function add($Context, $realmID, $Object) { return parent::_add($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_CLASS, $Object); }
php
{ "resource": "" }
q255948
QuickBooks_IPP_Service_Employee.findById
test
public function findById($Context, $realmID, $ID) { $xml = null; return parent::_findById($Context, $realmID, QuickBooks_IPP_IDS::RESOURCE_EMPLOYEE, $ID, null, $xml); }
php
{ "resource": "" }
q255949
QuickBooks_IPP_OAuth.signature
test
public function signature($method, $keyfile = null) { $this->_signature = $method; $this->_keyfile = $keyfile; }
php
{ "resource": "" }
q255950
My_Class_Name.handleError500
test
public function handleError500($requestID, $user, $action, $ID, $extra, &$err, $xml, $errnum, $errmsg) { mail('your-email@your-domain.com', 'QuickBooks error occured!', 'The following error occured: ' . $errnum . ': ' . $errmsg); // return true; // If you return TRUE, it will continue to process reque...
php
{ "resource": "" }
q255951
My_Class_Name.hookLoginSuccess
test
public function hookLoginSuccess($requestID, $user, $hook, &$err, $hook_data, $callback_config) { if ($this->_dsn) { QuickBooks_Utilities::log($this->_dsn, 'This user logged in and the user login hook was called: ' . $user . ', params: ' . print_r($hook_data, true)); return true; } return false; }
php
{ "resource": "" }
q255952
QuickBooks_QBXML_Schema_Object.isRepeatable
test
public function isRepeatable($path) { /* static $paths = array( 'FirstName' => false, 'LastName' => false, ); */ $paths = $this->_isRepeatablePaths(); if (isset($paths[$path])) { return $paths[$path]; } return false; }
php
{ "resource": "" }
q255953
QuickBooks_QBXML_Schema_Object.exists
test
public function exists($path, $case_doesnt_matter = true, $is_end_element = false) { $ordered_paths = $this->_reorderPathsPaths(); if (in_array($path, $ordered_paths)) { return true; } else if ($case_doesnt_matter) { foreach ($ordered_paths as $ordered_path) { if (strtolower($path) == strto...
php
{ "resource": "" }
q255954
QuickBooks_QBXML_Schema_Object.reorderPaths
test
public function reorderPaths($unordered_paths, $allow_application_id = true, $allow_application_editsequence = true) { /* static $ordered_paths = array( 0 => 'Name', 1 => 'FirstName', 2 => 'LastName', ); */ $ordered_paths = $this->_reorderPathsPaths(); $tmp = array(); foreach ($order...
php
{ "resource": "" }
q255955
QuickBooks_Callbacks._callFunction
test
static protected function _callFunction($function, &$vars, &$err, $which = null) { if (!function_exists($function)) { $err = 'Callback does not exist: [function] ' . $function . '(...)'; return false; } $ret = call_user_func_array($function, $vars); if (!is_null($which)) { $err = $vars[$which]; ...
php
{ "resource": "" }
q255956
QuickBooks_Callbacks._callStaticMethod
test
static protected function _callStaticMethod($class_and_method, &$vars, &$err, $which = null) { $tmp = explode('::', $class_and_method); $class = current($tmp); $method = next($tmp); if (is_callable(array( $class, $method))) { $ret = call_user_func_array(array( $class, $method ), $vars); if (!is_null(...
php
{ "resource": "" }
q255957
QuickBooks_IPP_Service_Customer.findByName
test
public function findByName($Context, $realm, $name) { $xml = null; return parent::_findByName($Context, $realm, QuickBooks_IPP_IDS::RESOURCE_CUSTOMER, $name, $xml); }
php
{ "resource": "" }
q255958
QuickBooks_QBXML_Object_Invoice.setClassApplicationID
test
public function setClassApplicationID($value) { return $this->set('ClassRef ' . QUICKBOOKS_API_APPLICATIONID, $this->encodeApplicationID(QUICKBOOKS_OBJECT_CLASS, QUICKBOOKS_LISTID, $value)); }
php
{ "resource": "" }
q255959
QuickBooks_QBXML_Object_Invoice.getBillAddress
test
public function getBillAddress($part = null, $defaults = array()) { if (!is_null($part)) { return $this->get('BillAddress ' . $part); } return $this->getArray('BillAddress *', $defaults); }
php
{ "resource": "" }
q255960
QuickBooks_QBXML_Object_Invoice.setShipMethodApplicationID
test
public function setShipMethodApplicationID($value) { return $this->set('ShipMethodRef ' . QUICKBOOKS_API_APPLICATIONID, $this->encodeApplicationID(QUICKBOOKS_OBJECT_SHIPMETHOD, QUICKBOOKS_LISTID, $value)); }
php
{ "resource": "" }
q255961
QuickBooks_QBXML_Object_Invoice.setPaymentMethodApplicationID
test
public function setPaymentMethodApplicationID($value) { return $this->set('PaymentMethodRef ' . QUICKBOOKS_API_APPLICATIONID, $this->encodeApplicationID(QUICKBOOKS_OBJECT_PAYMENTMETHOD, QUICKBOOKS_LISTID, $value)); }
php
{ "resource": "" }
q255962
QuickBooks_Driver_Sql_Sqlite._generateFieldSchema
test
protected function _generateFieldSchema($name, $def) { switch ($def[0]) { case QUICKBOOKS_DRIVER_SQL_SERIAL: $sql = $name . ' INTEGER PRIMARY KEY '; // AUTO_INCREMENT return $sql; case QUICKBOOKS_DRIVER_SQL_TIMESTAMP: case QUICKBO...
php
{ "resource": "" }
q255963
QuickBooks_XML_Node._getChildAtHelper
test
protected function _getChildAtHelper($root, $path) { if (false !== strpos($path, ' ') and false === strpos($path, '/')) { $path = str_replace(' ', '/', $path); } $explode = explode('/', $path); //$explode = explode(' ', $path); $current = array_shift($explode); $next = current($explode); if ($path...
php
{ "resource": "" }
q255964
QuickBooks_XML_Node.addChildAt
test
public function addChildAt($path, $node, $create = false) { return $this->_addChildAtHelper($this, $path, $node, $create); }
php
{ "resource": "" }
q255965
QuickBooks_XML_Node.children
test
public function children($pattern = null) { if (!is_null($pattern)) { $list = array(); foreach ($this->_children as $Child) { if ($this->_fnmatch($pattern, $Child->name())) { $list[] = $Child; } } return $list; } return $this->_children; }
php
{ "resource": "" }
q255966
QuickBooks_XML_Node.removeAttribute
test
public function removeAttribute($attr) { if ($this->attributeExists($attr)) { unset($this->_attributes[$attr]); return true; } return false; }
php
{ "resource": "" }
q255967
QuickBooks_XML_Node._asXMLHelper
test
public function _asXMLHelper($node, $tabs, $empty, $indent) { $xml = ''; if ($node->childCount()) { $xml .= str_repeat($indent, $tabs) . '<' . $node->name(); foreach ($node->attributes() as $key => $value) { // Make sure double-encode is *off* //$xml .= ' ' . $key . '="' . QuickBooks_XML::enco...
php
{ "resource": "" }
q255968
QuickBooks_XML_Node.asArray
test
public function asArray($mode = QuickBooks_XML::ARRAY_NOATTRIBUTES) { switch ($mode) { case QuickBooks_XML::ARRAY_EXPANDATTRIBUTES: return $this->_asArrayExpandAttributesHelper($this); case QuickBooks_XML::ARRAY_BRANCHED: return $this->_asArrayBranchedHelper($this); case QuickBooks_XML::ARRAY_PATH...
php
{ "resource": "" }
q255969
QuickBooks_XML_Node._asArrayPathsHelper
test
protected function _asArrayPathsHelper($node, $current, &$paths) { if ($node->hasChildNodes()) { foreach ($node->children() as $child) { $this->_asArrayPathsHelper($child, $current . ' ' . $node->name(), $paths); } } else if ($node->hasData()) { $paths[trim($current . ' ' . $node->name())] = ...
php
{ "resource": "" }
q255970
QuickBooks_XML_Node.saveXML
test
public function saveXML($path_or_resource, $mode = 'wb', $todo_for_empty_elements = QuickBooks_XML::XML_COMPRESS) { $xml = $this->asXML($todo_for_empty_elements); if (is_resource($path_or_resource)) { return fwrite($path_or_resource, $xml); } $fp = fopen($path_or_resource, $mode); $bytes = fwrite($fp,...
php
{ "resource": "" }
q255971
QuickBooks_XML_Node.saveJSON
test
public function saveJSON($path_or_resource, $mode = 'wb') { $json = $this->_root->asJSON(); if (is_resource($path_or_resource)) { return fwrite($path_or_resource, $json); } $fp = fopen($path_or_resource, $mode); $bytes = fwrite($fp, $json); fclose($fp); return $bytes; }
php
{ "resource": "" }
q255972
QuickBooks_Cast._castTruncate
test
static protected function _castTruncate($value, $length, $with_abbrevs = true) { //$value = QuickBooks_Cast::_castCharset($value); if (strlen($value) > $length) { if ($with_abbrevs) { $value = QuickBooks_Cast::_castAbbreviations($value); } if (strlen($value) > $length) { $value = su...
php
{ "resource": "" }
q255973
QuickBooks_Cast._decodeUTF8
test
static protected function _decodeUTF8($string) { // don't do decoding when there are no 8bit symbols if (!QuickBooks_Cast::_is8Bit($string, 'utf-8')) { return $string; } // decode four byte unicode characters $string = preg_replace_callback("/([\360-\367])([\200-\277])([\200-\277])([\200-\277])/", ...
php
{ "resource": "" }
q255974
QuickBooks_Utilities.parseDSN
test
static public function parseDSN($dsn, $defaults = array(), $part = null) { // Some DSN strings look like this: filesystem:///path/to/file // parse_url() will not parse this *unless* we provide some sort of hostname (in this case, null) $dsn = str_replace(':///', '://null/', $dsn); $defaults = array_merge(...
php
{ "resource": "" }
q255975
QuickBooks_Utilities.extractRequestID
test
static public function extractRequestID($xml) { $look = array( ); if (false !== ($start = strpos($xml, ' requestID="')) and false !== ($end = strpos($xml, '"', $start + 12))) { return substr($xml, $start + 12, $end - $start - 12); } return false; }
php
{ "resource": "" }
q255976
QuickBooks_Utilities.parseRequestID
test
static public function parseRequestID($requestID, &$action, &$ident) { $tmp = explode('|', base64_decode($requestID)); if (count($tmp) == 2) { $action = $tmp[0]; $ident = $tmp[1]; return true; } $action = null; $ident = null; return false; }
php
{ "resource": "" }
q255977
QuickBooks_Utilities._checkCIDR
test
static protected function _checkCIDR($remoteaddr, $CIDR) { $remoteaddr_long = ip2long($remoteaddr); list ($net, $mask) = split('/', $CIDR); $ip_net = ip2long($net); $ip_mask = ~((1 << (32 - $mask)) - 1); $remoteaddr_net = $remoteaddr_long & $ip_mask; return $remoteaddr_net == $ip_net; }
php
{ "resource": "" }
q255978
QuickBooks_Utilities.createUser
test
static public function createUser($dsn, $username, $password, $company_file = null, $wait_before_next_update = null, $min_run_every_n_seconds = null) { $driver = QuickBooks_Utilities::driverFactory($dsn); return $driver->authCreate($username, $password, $company_file, $wait_before_next_update, $min_run_every_n_...
php
{ "resource": "" }
q255979
QuickBooks_Utilities.disableUser
test
static public function disableUser($dsn, $username) { $driver = QuickBooks_Utilities::driverFactory($dsn); return $driver->authDisable($username); }
php
{ "resource": "" }
q255980
QuickBooks_Utilities.generateUniqueHash
test
static public function generateUniqueHash($mixed1, $mixed2 = null, $mixed3 = null, $mixed4 = null, $mixed5 = null) { return md5(serialize($mixed1) . serialize($mixed2) . serialize($mixed3) . serialize($mixed4) . serialize($mixed5)); }
php
{ "resource": "" }
q255981
QuickBooks_Utilities.hasQuickBooksID
test
public static function hasQuickBooksID($dsn, $user, $object_type, $app_ID) { if (QuickBooks_Utilities::fetchQuickBooksID($dsn, $user, $object_type, $app_ID)) { return true; } return false; }
php
{ "resource": "" }
q255982
QuickBooks_Utilities.initialize
test
static public function initialize($dsn, $driver_options = array(), $init_options = array()) { $Driver = QuickBooks_Utilities::driverFactory($dsn, $driver_options); return $Driver->initialize($init_options); }
php
{ "resource": "" }
q255983
QuickBooks_Utilities.initialized
test
static public function initialized($dsn, $driver_options = array()) { $Driver = QuickBooks_Utilities::driverFactory($dsn, $driver_options); return $Driver->initialized(); }
php
{ "resource": "" }
q255984
QuickBooks_Utilities.listObjects
test
static public function listObjects($filter = null, $return_keys = false, $order_for_mapping = false) { static $cache = array(); $crunch = $filter . '[' . $return_keys . '[' . $order_for_mapping; if (isset($cache[$crunch])) { return $cache[$crunch]; } $constants = array(); foreach (get_def...
php
{ "resource": "" }
q255985
QuickBooks_Utilities.listActions
test
static public function listActions($filter = null, $return_keys = false) { $startswith = array( 'QUICKBOOKS_IMPORT_', 'QUICKBOOKS_QUERY_', 'QUICKBOOKS_ADD_', 'QUICKBOOKS_MOD_', 'QUICKBOOKS_DEL_', 'QUICKBOOKS_VOID_', ); $constants = array(); //$inter_key = 'QUICKBOOKS_INTERACTIVE...
php
{ "resource": "" }
q255986
QuickBooks_Driver_Sql_Mysqli._escape
test
protected function _escape($str) { if (is_array($str)) { error_log('Param passed to _escape($str) was an array: ' . print_r($str, true)); $str = ''; } return $this->_conn->real_escape_string($str); }
php
{ "resource": "" }
q255987
QuickBooks.config
test
public function config() { $name = 'CodeIgniter QuickBooks Demo'; // A name for your server (make it whatever you want) $descrip = 'CodeIgniter QuickBooks Demo'; // A description of your server $appurl = 'https://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/qbwc'; // This *must* be http...
php
{ "resource": "" }
q255988
QuickBooks.qbwc
test
public function qbwc() { $user = $this->config->item('quickbooks_user'); $pass = $this->config->item('quickbooks_pass'); // Memory limit ini_set('memory_limit', $this->config->item('quickbooks_memorylimit')); // We need to make sure the correct timezone is set, or some PHP installations will complain ...
php
{ "resource": "" }
q255989
QuickBooks._addCustomerRequest
test
public function _addCustomerRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale) { // Do something here to load data using your model //$data = $this->yourmodel->getCustomerData($ID); // Build the qbXML request from $data $xml = '<?xml version...
php
{ "resource": "" }
q255990
QuickBooks._addCustomerResponse
test
public function _addCustomerResponse($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents) { // Do something here to record that the data was added to QuickBooks successfully return true; }
php
{ "resource": "" }
q255991
QuickBooks._catchallErrors
test
public function _catchallErrors($requestID, $user, $action, $ID, $extra, &$err, $xml, $errnum, $errmsg) { return false; }
php
{ "resource": "" }
q255992
QuickBooks_Driver.queueProcessing
test
final public function queueProcessing($user) { $hookdata = array( 'username' => $user, ); $hookerr = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_QUEUEPROCESSING, null, $hookerr, $hookdata); return $this->_queueProcessing($user); }
php
{ "resource": "" }
q255993
QuickBooks_Driver.recurEnqueue
test
final public function recurEnqueue($user, $run_every, $action, $ident, $replace = true, $priority = 0, $extra = null, $qbxml = null) { $hookdata = array( 'username' => $user, 'interval' => $run_every, 'action' => $action, 'ident' => $ident, 'replace' => $replace, 'priority' => $priority, '...
php
{ "resource": "" }
q255994
QuickBooks_Driver.recurDequeue
test
final public function recurDequeue($user, $by_priority = false) { $hookdata = array( 'username' => $user, ); $hookerr = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_AUTHRESOLVE, null, $hookerr, $hookdata); return $this->_recurDequeue($user, $by_priority); }
php
{ "resource": "" }
q255995
QuickBooks_Driver.queueLeft
test
final public function queueLeft($user, $queued = true) { $hookdata = array( 'username' => $user, 'queued' => $queued, ); $hookerr = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_QUEUELEFT, null, $hookerr, $hookdata); return $this->_queueLeft($user, $queued); }
php
{ "resource": "" }
q255996
QuickBooks_Driver.queueReport
test
final public function queueReport($user, $date_from, $date_to, $offset = 0, $limit = null) { $offset = max(0, (int) $offset); $limit = min(999999999, (int) $limit); $hookdata = array( 'offset' => $offset, 'limit' => $limit, 'from' => $date_from, 'to' => $date_to, ); $hookerr = ''; $this...
php
{ "resource": "" }
q255997
QuickBooks_Driver.queueProcessed
test
final public function queueProcessed($ticket) { $hookdata = array(); $hookerr = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_QUEUEPROCESSED, $ticket, $hookerr, $hookdata); return $this->_queueProcessed($ticket); }
php
{ "resource": "" }
q255998
QuickBooks_Driver.errorLog
test
final public function errorLog($ticket, $errno, $errstr) { $hookdata = array( 'errno' => $errno, 'errstr' => $errstr, ); $hookerr = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_AUTHRESOLVE, $ticket, $hookerr, array()); return $this->_errorLog($ticket, $errno, $errstr); }
php
{ "resource": "" }
q255999
QuickBooks_Driver.errorLast
test
final public function errorLast($ticket) { $hookerr = ''; $this->_callHook(QUICKBOOKS_DRIVER_HOOK_AUTHRESOLVE, $ticket, $hookerr, array()); return $this->_errorLast($ticket); }
php
{ "resource": "" }