return null;
}
- function SetFromFormData($cleaned_values)
+ public function SetFromFormData($cleaned_values)
{
- //$relations = $this->getTable()->getRelations();
foreach ($cleaned_values as $key=>$val) {
- /*
- if (array_key_exists($key,$relations)){
-
-
- }else*/
- $this->$key = $val;
+ $validators = $this->getTable()->getFieldValidators($key);
+ if (array_key_exists('image',$validators) || array_key_exists('file',$validators)){
+ if ($val=='')
+ continue;
+ }
+ $this->$key = $val;
}
}
}
\ No newline at end of file
$columnName = $this->getColumnName($fieldName);
// this loop is a dirty workaround to get the validators filtered out of
// the options, since everything is squeezed together currently
+
+ if (!isset($this->_columns[$columnName]))
+ return array();
+
foreach ($this->_columns[$columnName] as $name => $args) {
if (empty($name)
|| $name == 'primary'
'unique',
'unsigned',
'usstate',
+ 'file',
+ 'image',
);
}
--- /dev/null
+<?php
+
+class IPF_ORM_Validator_File
+{
+ public function validate($value){
+ return true;
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+
+class IPF_ORM_Validator_Image
+{
+ public function validate($value){
+ return true;
+ }
+}
\ No newline at end of file