if ( ! $this->_errorStack) {
$this->_errorStack = new IPF_ORM_Validator_ErrorStack(get_class($this));
}
-
+
return $this->_errorStack;
}
if ($state == null) {
return $this->_state;
}
-
+
$err = false;
if (is_integer($state)) {
if ($state >= 1 && $state <= 6) {
if (isset($this->_values[$fieldName])) {
return $this->_values[$fieldName];
}
-
+
try {
if ( ! isset($this->_references[$fieldName]) && $load) {
$rel = $this->_table->getRelation($fieldName);
} else {
$old = $this->_data[$fieldName];
}
-
+
if ($this->_isValueModified($type, $old, $value)) {
if ($value === null) {
$value = self::$_null;
public function coreSetRelated($name, $value)
{
$rel = $this->_table->getRelation($name);
-
+
if ($value === null) {
$value = self::$_null;
}
-
+
// one-to-many or one-to-one relation
if ($rel instanceof IPF_ORM_Relation_ForeignKey || $rel instanceof IPF_ORM_Relation_LocalKey) {
if ( ! $rel->isOneToOne()) {
if ($this->_state == self::STATE_LOCKED) {
return false;
}
-
+
$stateBeforeLock = $this->_state;
$this->_state = self::STATE_LOCKED;
-
+
$a = array();
foreach ($this as $column => $value) {
$i = $this->_table->getIdentifier();
$a[$i] = $this->getIncremented();
}
-
+
if ($deep) {
foreach ($this->_references as $key => $relation) {
if (! $relation instanceof IPF_ORM_Null) {
$a[$key] = $value;
}
}
-
+
$this->_state = $stateBeforeLock;
return $a;
{
$this->getNode()->delete();
}
-
+
public function free($deep = false)
{
if ($this->_state != self::STATE_LOCKED) {
{
return (string) $this->_oid;
}
-
+
public function ModelAdmin(){
$cn = get_class($this);
if (isset(IPF_Admin_Model::$models[$cn]))
{
foreach ($cleaned_values as $key=>$val) {
$validators = $this->getTable()->getFieldValidators($key);
- if (array_key_exists('image',$validators) || array_key_exists('file',$validators)){
+ if (
+ array_key_exists('image',$validators) ||
+ array_key_exists('file',$validators) ||
+ array_key_exists('email',$validators)
+ ){
if (($val!==null) && ($val==''))
continue;
}