/** * Uninstall vehicles in the package from the sponsor {@link xPDO} instance. * * @param array $options Uninstall options to be applied to the process. * @return boolean true if the vehicles were successfully uninstalled. */ public function uninstall($options = array()) { $processed = array(); if (!is_array($options)) { $options = array(xPDOTransport::PACKAGE_ACTION => xPDOTransport::ACTION_UNINSTALL); } elseif (!isset($options[xPDOTransport::PACKAGE_ACTION])) { $options[xPDOTransport::PACKAGE_ACTION] = xPDOTransport::ACTION_UNINSTALL; } if (!empty($this->vehicles)) { $this->_preserved = $this->loadPreserved(); $vehicleArray = array_reverse($this->vehicles, true); foreach ($vehicleArray as $vIndex => $vehicleMeta) { $vOptions = array_merge($options, $vehicleMeta); if ($this->xpdo->getDebug() === true) { $this->xpdo->log(xPDO::LOG_LEVEL_DEBUG, "Removing Vehicle: " . print_r($vOptions, true)); } if ($vehicle = $this->get($vehicleMeta['filename'], $vOptions)) { $processed[$vehicleMeta['guid']] = $vehicle->uninstall($this, $vOptions); } else { $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'Could not load vehicle: ' . print_r($vOptions, true)); } } } else { $this->xpdo->log(xPDO::LOG_LEVEL_WARN, 'No vehicles are defined in the transport package (' . $this->signature . ') for removal'); } $uninstalled = array_search(false, $processed, true) === false; return $uninstalled; }
/** * Gets the php data type for the specified field. * * @access protected * @param string $key The field name to get the data type for. * @return string The PHP data type of the field. */ protected function _getPHPType($key) { $type= 'string'; if (isset ($this->_fieldMeta[$key]['phptype'])) { $type= strtolower($this->_fieldMeta[$key]['phptype']); } elseif ($this->xpdo->getDebug() === true) { $this->xpdo->log(xPDO::LOG_LEVEL_DEBUG, "xPDOObject::_getPHPType() -- No PHP type specified for field ({$key}), using `string`."); } return $type; }