Source for file basic_model_update.php

Documentation is available at basic_model_update.php


1 <?php
2 /**
3 * @author Jan H. Andersen <jha@ipwsystems.dk>
4 * @author Martin R. Larsen <mrl@ipwsystems.dk>
5 * @copyright {@link http://www.ipwsystems.dk/ IPW Systems a.s}
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @package METAjour
8 * @subpackage model
9 * $Id: basic_model_update.php,v 1.7 2005/01/03 05:35:09 jan Exp $
10 */
11
12 require_once('basic_model.php');
13
14 class basic_model_update extends basic_model {
15
16 function model() {
17 foreach($this->objectid as $curid) {
18 $obj = owRead($curid);
19 $obj->updateObject($curid, $this->data);
20 if (!$obj->isVariant()) {
21
22 if (isset($this->data['__categories__'])) {
23 $obj->setCategory($this->data['__categories__']);
24 }
25
26 if (isset($this->data['__webaccess__']) || isset($this->data['__sysaccess__'])) {
27 $obj->setAccess($this->data['__webaccess__'],$this->data['__sysaccess__']);
28 }
29
30 $extra = owDatatypeExtraCols($this->otype);
31 if (!empty($extra)) {
32 $arr = packData($extra, $this->data);
33 $obj->setExtraData($arr);
34 }
35 } else {
36 $cols = owDatatypeCols($this->otype);
37 $varfields = array();
38 foreach ($cols as $cur) {
39 if (isset($this->data['__var__'.$cur['name']])) {
40 $varfields[] = $cur['name'];
41 }
42 }
43 if ($obj->getType() == 'documentsection') {
44 $varfields[] = 'content';
45 }
46 if (is_array($varfields)) {
47 $obj->setVariantFields($varfields);
48 }
49 /*
50 * @todo: take care of extra data for variants too
51 */
52 }
53 }
54 }
55
56 }
57
58 ?>

Documentation generated on Thu, 9 Jun 2005 06:51:10 +0200 by phpDocumentor 1.2.3