示例#1
0
 protected function innerDelete($ID, &$errors)
 {
     $entity = CCrmProductRow::GetByID($ID);
     if (!is_array($entity)) {
         $errors[] = "Product Row not found";
         return false;
     }
     if (!CCrmAuthorizationHelper::CheckDeletePermission(CCrmProductRow::ResolveOwnerTypeName($entity['OWNER_TYPE']), $entity['OWNER_ID'])) {
         $errors[] = 'Access denied.';
         return false;
     }
     $result = CCrmProductRow::Delete($ID, true, true);
     if ($result !== true) {
         $errors[] = CCrmProductRow::GetLastError();
     }
     return $result;
 }