Ejemplo n.º 1
0
	public function execRequest()
	{
		if (is_array($this->spool["children"]) && !empty($this->spool["children"])) {
			$lastKid = end($this->spool["children"]);

			switch (isc_strtolower($lastKid["service"])) {
				case "query":

					/**
					 * If we have an error here then that would mean that adding created a duplicate error
					 * but querying for it return nothing. Bad news
					 */
					if ($lastKid["errNo"] > 0) {
						throw new QBException("Caught a QBJD error when adding a prerequisite record", $lastKid);
					}

					/**
					 * Our query kid was successfully so we need to create the reference data from the
					 * response. If we can't create the reference then we need to error out
					 */
					$queryResponse = $lastKid["response"];
					$queryResponse += $lastKid["nodeData"];

					if (!$this->setReferenceData($queryResponse, '*')) {
						throw new QBException("Cannot create reference data from prerequisite query response", $queryResponse);
					}

					return $this->execNextService();
					break;
			}
		}

		return parent::execRequest();
	}
Ejemplo n.º 2
0
	public function execRequest()
	{
		if (array_key_exists("modifiedDate", $this->spool["nodeData"])) {
			$entity = $this->entityObjectFactory();
			return $entity->buildQuerySyncXML();
		} else {
			return parent::execRequest();
		}
	}
Ejemplo n.º 3
0
	public function execRequest()
	{
		if (is_array($this->spool["children"]) && !empty($this->spool["children"])) {
			$lastKid = end($this->spool["children"]);

			switch (isc_strtolower($lastKid["service"])) {
				case "query":

					/**
					 * If we have an error here then that would mean that adding created a duplicate error
					 * but querying for it return nothing. Bad news
					 */
					if ($lastKid["errNo"] > 0) {
						throw new QBException("Caught a QBJD error when adding a customer record", $lastKid);
					}

					/**
					 * Our query kid was successfully so we need to create the reference data from the
					 * response. If we can't create the reference then we need to error out
					 */
					if (!$this->setReferenceData($lastKid["response"])) {
						throw new QBException("Cannot create reference data from customer query response", $queryResponse);
					}

					return $this->execChildService("customer", "edit", $this->spool["nodeData"]);
					break;

				case "edit":

					/**
					 * If we have an error here then that would mean that adding created a duplicate error,
					 * querying for it return a record but editing that record returned an error. Bad news
					 */
					if ($lastKid["errNo"] > 0) {
						throw new QBException("Caught a QBJD error when editing a customer record (from customeradd)", $lastKid);
					}

					/**
					 * OK, the account was added (edited) successfully, so mark this as successful and esacpe this service
					 */
					return $this->execNextService();
					break;
			}
		}

		return parent::execRequest();
	}
	public function execRequest()
	{
		if (is_array($this->spool["children"]) && !empty($this->spool["children"])) {
			$lastKid = end($this->spool["children"]);

			switch (isc_strtolower($lastKid["service"])) {
				case "add":

					/**
					 * Adding will handle both adding a new product OR editing an existing product with a
					 * bad reference, so either way just escape it here
					 */
					return $this->execNextService();
					break;
			}
		}

		return parent::execRequest();
	}