Commit 5d2b98843e4de949df4e40dc25993f36de5be6ff

Authored by nbm
1 parent e0b8b9bc

KTFolderTransaction represents transactions on a folder (currently

create, move, permissions change, and role allocations change).


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5233 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/foldermanagement/foldertransaction.inc.php 0 → 100644
  1 +<?php
  2 +
  3 +/**
  4 + * $Id$
  5 + *
  6 + * Copyright (c) 2006 Jam Warehouse http://www.jamwarehouse.com
  7 + *
  8 + * This program is free software; you can redistribute it and/or modify
  9 + * it under the terms of the GNU General Public License as published by
  10 + * the Free Software Foundation; using version 2 of the License.
  11 + *
  12 + * This program is distributed in the hope that it will be useful,
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15 + * GNU General Public License for more details.
  16 + *
  17 + * You should have received a copy of the GNU General Public License
  18 + * along with this program; if not, write to the Free Software
  19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20 + *
  21 + * -------------------------------------------------------------------------
  22 + *
  23 + * You can contact the copyright owner regarding licensing via the contact
  24 + * details that can be found on the KnowledgeTree web site:
  25 + *
  26 + * http://www.ktdms.com/
  27 + */
  28 +
  29 +require_once(KT_LIB_DIR . "/ktentity.inc");
  30 +
  31 +class KTFolderTransaction extends KTEntity {
  32 + var $_aFieldToSelect = array(
  33 + 'iId' => 'id',
  34 + 'iFolderId' => 'folder_id',
  35 + 'iUserId' => 'user_id',
  36 + 'dDateTime' => 'datetime',
  37 + 'sIp' => 'ip',
  38 + 'sComment' => 'comment',
  39 + 'sTransactionNS' => 'transaction_namespace',
  40 + );
  41 +
  42 + var $_bUsePearError = true;
  43 +
  44 + function _table () {
  45 + return KTUtil::getTableName('folder_transactions');
  46 + }
  47 +
  48 + // STATIC
  49 + function &get($iId) {
  50 + return KTEntityUtil::get('KTFolderTransaction', $iId);
  51 + }
  52 +
  53 + // STATIC
  54 + function &createFromArray($aOptions) {
  55 + return KTEntityUtil::createFromArray('KTFolderTransaction', $aOptions);
  56 + }
  57 +
  58 + // STATIC
  59 + function &getList($sWhereClause = null) {
  60 + return KTEntityUtil::getList2('KTFolderTransaction', $sWhereClause);
  61 + }
  62 +
  63 + function &getByFolder($oFolder, $aOptions = null) {
  64 + $aOptions = KTUtil::meldOptions(array(
  65 + 'multi' => true,
  66 + ), $aOptions);
  67 + $iFolderId = KTUtil::getId($oFolder);
  68 + return KTEntityUtil::getByDict('KTFolderTransaction', array(
  69 + 'folder_id' => $iFolderId,
  70 + ), $aOptions);
  71 + }
  72 +
  73 + function &getByUser($oFolder, $aOptions = null) {
  74 + $aOptions = KTUtil::meldOptions(array(
  75 + 'multi' => true,
  76 + ), $aOptions);
  77 + $iFolderId = KTUtil::getId($oFolder);
  78 + return KTEntityUtil::getByDict('KTFolderTransaction', array(
  79 + 'folder_id' => $iFolderId,
  80 + ), $aOptions);
  81 + }
  82 +}
  83 +
  84 +?>
... ...