コード例 #1
0
ファイル: Config.php プロジェクト: df-arif/df-core
 public function __construct($settings = [])
 {
     $verbAliases = [Verbs::PUT => Verbs::POST, Verbs::MERGE => Verbs::POST, Verbs::PATCH => Verbs::POST];
     ArrayUtils::set($settings, "verbAliases", $verbAliases);
     parent::__construct($settings);
     $this->model = \DreamFactory\Core\Models\Config::class;
 }
コード例 #2
0
ファイル: EmailTemplate.php プロジェクト: df-arif/df-core
 public function getApiDocInfo()
 {
     $base = parent::getApiDocInfo();
     $name = Inflector::camelize($this->name);
     $lower = Inflector::camelize($this->name, null, false, true);
     $commonProperties = ['id' => ['type' => 'integer', 'format' => 'int32', 'description' => 'Identifier of this ' . $lower . '.'], 'name' => ['type' => 'string', 'description' => 'Displayable name of this ' . $lower . '.'], 'description' => ['type' => 'string', 'description' => 'Description of this ' . $lower . '.'], 'to' => ['type' => 'array', 'description' => 'Single or multiple receiver addresses.', 'items' => ['$ref' => 'EmailAddress']], 'cc' => ['type' => 'array', 'description' => 'Optional CC receiver addresses.', 'items' => ['$ref' => 'EmailAddress']], 'bcc' => ['type' => 'array', 'description' => 'Optional BCC receiver addresses.', 'items' => ['$ref' => 'EmailAddress']], 'subject' => ['type' => 'string', 'description' => 'Text only subject line.'], 'body_text' => ['type' => 'string', 'description' => 'Text only version of the body.'], 'body_html' => ['type' => 'string', 'description' => 'Escaped HTML version of the body.'], 'from' => ['type' => 'EmailAddress', 'description' => 'Required sender name and email.'], 'reply_to' => ['type' => 'EmailAddress', 'description' => 'Optional reply to name and email.'], 'defaults' => ['type' => 'array', 'description' => 'Array of default name value pairs for template replacement.', 'items' => ['type' => 'string']]];
     $stampProperties = ['created_date' => ['type' => 'string', 'description' => 'Date this record was created.', 'readOnly' => true], 'last_modified_date' => ['type' => 'string', 'description' => 'Date this record was last modified.', 'readOnly' => true]];
     $models = [$name . 'Request' => ['id' => $name . 'Request', 'properties' => $commonProperties], $name . 'Response' => ['id' => $name . 'Response', 'properties' => array_merge($commonProperties, $stampProperties)], 'EmailAddress' => ['id' => 'EmailAddress', 'properties' => ['name' => ['type' => 'string', 'description' => 'Optional name displayed along with the email address.'], 'email' => ['type' => 'string', 'description' => 'Required email address.']]]];
     $base['models'] = array_merge($base['models'], $models);
     return $base;
 }
コード例 #3
0
ファイル: Admin.php プロジェクト: df-arif/df-core
 /**
  * {@inheritdoc}
  */
 protected function getSelectionCriteria()
 {
     $criteria = parent::getSelectionCriteria();
     $condition = ArrayUtils::get($criteria, 'condition');
     if (!empty($condition)) {
         $condition .= " AND is_sys_admin = '1' ";
     } else {
         $condition = " is_sys_admin = '1'";
     }
     ArrayUtils::set($criteria, 'condition', $condition);
     return $criteria;
 }
コード例 #4
0
ファイル: App.php プロジェクト: df-arif/df-core
 /**
  * Handles DELETE action
  *
  * @return \DreamFactory\Core\Utility\ServiceResponse
  * @throws BadRequestException
  * @throws \Exception
  */
 protected function handleDELETE()
 {
     $deleteStorage = $this->request->getParameterAsBool('delete_storage');
     $fields = $this->request->getParameter('fields');
     if ($deleteStorage) {
         if (empty($fields)) {
             $fields = 'id,storage_service_id,storage_container';
         } else {
             if ($fields !== '*') {
                 $fields = explode(',', $fields);
                 if (!in_array('id', $fields)) {
                     $fields[] = 'id';
                 }
                 if (!in_array('storage_service_id', $fields)) {
                     $fields[] = 'storage_service_id';
                 }
                 if (!in_array('storage_container', $fields)) {
                     $fields[] = 'storage_container';
                 }
                 $fields = implode(',', $fields);
             }
         }
         $this->request->setParameter('fields', $fields);
     }
     $result = parent::handleDELETE();
     if ($deleteStorage) {
         $temp = $result;
         $wrapper = ResourcesWrapper::getWrapper();
         if (isset($result[$wrapper])) {
             $temp = ResourcesWrapper::unwrapResources($temp);
         }
         if (ArrayUtils::isArrayNumeric($temp)) {
             foreach ($temp as $app) {
                 static::deleteHostedAppStorage($app['id'], $app['storage_service_id'], $app['storage_container']);
             }
         } else {
             static::deleteHostedAppStorage($temp['id'], $temp['storage_service_id'], $temp['storage_container']);
         }
     }
     return $result;
 }
コード例 #5
0
ファイル: User.php プロジェクト: df-arif/df-user
 /**
  * {@inheritdoc}
  */
 protected function handlePUT()
 {
     return $this->handleInvitation(parent::handlePUT());
 }