Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
ImportFilter.php
Go to the documentation of this file.
1 <?php
2 /*-------------------------------------------------------------------------------
3  * Xataface Web Application Framework
4  * Copyright (C) 2005-2008 Web Lite Solutions Corp (shannah@sfu.ca)
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *-------------------------------------------------------------------------------
20  */
34 require_once 'Dataface/Table.php';
35 
37 
42  var $_table;
43 
47  var $label;
48 
52  var $name;
53 
54 
62  $this->_table =& Dataface_Table::loadTable($tablename);
63  $this->label = $label;
64  $this->name = $name;
65  }
66 
67 
74  function import(&$data, $defaultValues=array()){
75 
76  $delegate =& $this->_table->getDelegate();
77  if ( $delegate !== null and method_exists($delegate, '__import__'.$this->name) ){
78  return call_user_func(array(&$delegate,'__import__'.$this->name), $data, $defaultValues);
79  }
80 
81  }
82 
83 
84 
85 
86 }
87 
88 
89 
90 ?>