当前位置: 首页>>代码示例>>PHP>>正文


PHP ca_sets::delete方法代码示例

本文整理汇总了PHP中ca_sets::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_sets::delete方法的具体用法?PHP ca_sets::delete怎么用?PHP ca_sets::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca_sets的用法示例。


在下文中一共展示了ca_sets::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCreateDeleteSet

 public function testCreateDeleteSet()
 {
     $o_db = new Db();
     $qr_objects = $o_db->query('select object_id from ca_objects where deleted=0');
     $va_object_ids = $qr_objects->getAllFieldValues('object_id');
     //$t = new Timer();
     $this->opt_set->addItems($va_object_ids);
     //var_dump($t->getTime());
     $this->assertSame(sizeof($va_object_ids), $this->opt_set->getItemCount());
     $this->opt_set->setMode(ACCESS_WRITE);
     //$t = new Timer();
     $this->opt_set->delete(true);
     //var_dump($t->getTime());
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:14,代码来源:SetDeleteTest.php

示例2: CreateNewOrderFromCommunication

 /**
  *
  */
 public function CreateNewOrderFromCommunication()
 {
     if ($pn_communication_id = $this->request->getParameter('communication_id', pInteger)) {
         $t_comm = new ca_commerce_communications($pn_communication_id);
         if (!$t_comm->getPrimaryKey()) {
             $this->notification->addNotification(_t('Invalid message'), __NOTIFICATION_TYPE_ERROR__);
             $this->CustomerInfo();
             return;
         }
         $t_trans = new ca_commerce_transactions($t_comm->get('transaction_id'));
         if (!$t_trans->getPrimaryKey()) {
             $this->notification->addNotification(_t('Message is not associated with a transaction'), __NOTIFICATION_TYPE_ERROR__);
             $this->CustomerInfo();
             return;
         }
         $t_user = new ca_users($t_trans->get('user_id'));
         $this->opt_order->setMode(ACCESS_WRITE);
         $this->opt_order->set('transaction_id', $t_trans->getPrimaryKey());
         if ($t_user->getPrimaryKey()) {
             $this->opt_order->set('billing_fname', $t_user->get('fname'));
             $this->opt_order->set('billing_lname', $t_user->get('lname'));
             $this->opt_order->set('billing_email', $t_user->get('email'));
             $this->opt_order->set('shipping_fname', $t_user->get('fname'));
             $this->opt_order->set('shipping_lname', $t_user->get('lname'));
             $this->opt_order->set('shipping_email', $t_user->get('email'));
             // Pre-populate order with user's profile address
             $va_mapping = array('billing_organization' => 'user_profile_organization', 'billing_address1' => 'user_profile_address1', 'billing_address2' => 'user_profile_address2', 'billing_city' => 'user_profile_city', 'billing_zone' => 'user_profile_state', 'billing_postal_code' => 'user_profile_postalcode', 'billing_country' => 'user_profile_country', 'billing_phone' => 'user_profile_phone', 'billing_fax' => 'user_profile_fax', 'shipping_organization' => 'user_profile_organization', 'shipping_address1' => 'user_profile_address1', 'shipping_address2' => 'user_profile_address2', 'shipping_city' => 'user_profile_city', 'shipping_zone' => 'user_profile_state', 'shipping_postal_code' => 'user_profile_postalcode', 'shipping_country' => 'user_profile_country', 'shipping_phone' => 'user_profile_phone', 'shipping_fax' => 'user_profile_fax');
             foreach ($va_mapping as $vs_field => $vs_pref) {
                 $this->opt_order->set($vs_field, $t_user->getPreference($vs_pref));
             }
         }
         $this->opt_order->set('order_type', 'L');
         // L=loan
         $this->opt_order->insert();
         $this->request->setParameter('order_id', $this->opt_order->getPrimaryKey());
         if (!$this->opt_order->numErrors()) {
             $this->notification->addNotification(_t('Saved changes'), __NOTIFICATION_TYPE_INFO__);
             // Add items
             $t_set = new ca_sets($t_trans->get('set_id'));
             if ($t_set->getPrimaryKey()) {
                 $va_items = $t_set->getItems();
                 foreach ($va_items as $va_item_list) {
                     foreach ($va_item_list as $vn_i => $va_item) {
                         if (!is_array($va_item['selected_services'])) {
                             //$va_item['selected_services'] = array('DIGITAL_COPY');	// TODO: make default configurable
                         }
                         foreach ($va_item['selected_services'] as $vs_service) {
                             if ($t_item = $this->opt_order->addItem($va_item['row_id'], array('service' => $vs_service), array('representations_ids' => is_array($va_item['selected_representations']) && sizeof($va_item['selected_representations']) ? $va_item['selected_representations'] : null))) {
                                 $t_item->updateFee();
                             }
                         }
                     }
                 }
                 // Delete originating set if configured to do so
                 if ($this->opo_client_services_config->get('set_disposal_policy') == 'DELETE_WHEN_ORDER_CREATED') {
                     $t_set->setMode(ACCESS_WRITE);
                     $t_set->delete(true);
                 }
             }
         } else {
             $va_errors['general'] = $this->opt_order->errors();
             $this->notification->addNotification(_t('Errors occurred: %1', join('; ', $this->opt_order->getErrors())), __NOTIFICATION_TYPE_ERROR__);
         }
         $this->view->setVar('errors', $va_errors);
     }
     $this->OrderOverview();
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:70,代码来源:OrderEditorController.php

示例3: tearDown

 public function tearDown()
 {
     // clean up test records
     $t_object = new ca_objects($this->opn_object_id);
     $t_object->setMode(ACCESS_WRITE);
     $vb_del = $t_object->delete(true, array('hard' => true));
     $this->assertTrue($vb_del, 'Deleting the test record shouldnt fail');
     $t_set = new ca_sets($this->opn_set_id);
     $t_set->setMode(ACCESS_WRITE);
     $vb_del = $t_set->delete(true, array('hard' => true));
     $this->assertTrue($vb_del, 'Deleting the test record shouldnt fail');
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:12,代码来源:ca_setsTest.php

示例4: update

 public function update($pa_options = null)
 {
     if (!$this->_preSaveActions()) {
         return false;
     }
     $vn_old_status = $this->getOriginalValue('order_status');
     $vn_old_ship_date = $this->getOriginalValue('shipping_date');
     $vn_old_shipped_on_date = $this->getOriginalValue('shipped_on_date');
     // Move order status automatically to reflect business logic
     switch ($this->get('order_status')) {
         case 'PROCESSED':
             if ($this->get('shipped_on_date') && $this->changed('shipped_on_date') && !$this->requiresDownload()) {
                 // If it shipped and there's nothing left to fulfill by download then ship status to "complete"
                 $this->set('order_status', 'COMPLETED');
             }
             break;
         case 'AWAITING_PAYMENT':
             if ($this->get('payment_received_on') && $this->changed('payment_received_on') || $this->getTotal() == 0) {
                 if ($this->get('order_type') == 'L') {
                     // LOANS
                     $this->set('order_status', 'PROCESSED');
                 } else {
                     // SALES ORDERS
                     // If it paid for then flip status to "PROCESSED" (if it's all ready to go) or "PROCESSED_AWAITING_DIGITIZATION" if stuff needs to be digitized
                     if (sizeof($va_items_with_no_media = $this->itemsWithNoDownloadableMedia()) > 0) {
                         $this->set('order_status', 'PROCESSED_AWAITING_DIGITIZATION');
                     } else {
                         // If "original" files are missing then mark as PROCESSED_AWAITING_MEDIA_ACCESS
                         if (sizeof($va_items_missing_media = $this->itemsMissingDownloadableMedia('original'))) {
                             $this->set('order_status', 'PROCESSED_AWAITING_MEDIA_ACCESS');
                         } else {
                             $this->set('order_status', 'PROCESSED');
                         }
                     }
                 }
             }
             break;
     }
     $vb_status_changed = $this->changed('order_status');
     $this->set('order_number', ca_commerce_orders::generateOrderNumber($this->getPrimaryKey(), $this->get('created_on', array('GET_DIRECT_DATE' => true))));
     if ($vn_rc = parent::update($pa_options)) {
         if ($vb_status_changed) {
             $this->sendStatusChangeEmailNotification($vn_old_status, $vn_old_ship_date, $vn_old_shipped_on_date);
         }
         if (in_array($this->get('order_status'), array('PROCESSED', 'PROCESSED_AWAITING_DIGITIZATION', 'PROCESSED_AWAITING_MEDIA_ACCESS', 'COMPLETED'))) {
             // Delete originating set if configured to do so
             if ($this->opo_client_services_config->get('set_disposal_policy') == 'DELETE_WHEN_ORDER_PROCESSED') {
                 $t_trans = new ca_commerce_transactions($this->get('transaction_id'));
                 if ($t_trans->getPrimaryKey()) {
                     $t_set = new ca_sets($t_trans->get('set_id'));
                     if ($t_set->getPrimaryKey()) {
                         $t_set->setMode(ACCESS_WRITE);
                         $t_set->delete(true);
                     }
                 }
             }
         }
     }
     return $vn_rc;
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:60,代码来源:ca_commerce_orders.php

示例5: removeSet

 /**
  * Removes specified set from database
  *
  * @param int $set_id
  * @return boolean
  * @throws SoapFault
  */
 public function removeSet($set_id)
 {
     $t_set = new ca_sets();
     if (!$t_set->load($set_id)) {
         throw new SoapFault("Server", "Invalid set_id");
     }
     $t_set->setMode(ACCESS_WRITE);
     $t_set->delete();
     if ($t_set->numErrors() == 0) {
         return true;
     } else {
         throw new SoapFault("Server", "There were errors while deleting the set: " . join(";", $t_set->getErrors()));
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:21,代码来源:UserContentService.php


注:本文中的ca_sets::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。