public function saveDistancejobList($con = null) { if (!$this->isValid()) { throw $this->getErrorSchema(); } if (!isset($this->widgetSchema['distancejob_list'])) { // somebody has unset this widget return; } if (null === $con) { $con = $this->getConnection(); } $c = new Criteria(); $c->add(DistancejobPeer::DISTANCETYPE_ID, $this->object->getPrimaryKey()); DistancejobPeer::doDelete($c, $con); $values = $this->getValue('distancejob_list'); if (is_array($values)) { foreach ($values as $value) { $obj = new Distancejob(); $obj->setDistancetypeId($this->object->getPrimaryKey()); $obj->setTrackId($value); $obj->save(); } } }