示例#1
0
 protected function renderFieldCategory(ConfigFieldCategory $fieldCategory)
 {
     $str = "";
     $fields = $fieldCategory->getConfigFields();
     foreach ($fields as $field) {
         $str .= "<fieldset>";
         $str .= "<legend>" . $field->getName() . "</legend>";
         $fieldId = $field->getId();
         $cField = new Criteria();
         $cField->add(FieldValuePeer::FIELD_ID, $fieldId);
         /*$c1 = $cField->getNewCriterion(FieldValuePeer::VALUE, $query.'%', Criteria::LIKE);
           $c2 = $cField->getNewCriterion(FieldValuePeer::VALUE, "", Criteria::NOT_EQUAL);
           $c1->addAnd($c2);        
           $cField->addAnd($c1);*/
         $cField->add(FieldValuePeer::VALUE, "", Criteria::NOT_EQUAL);
         $cField->addGroupByColumn(FieldValuePeer::VALUE);
         $cField->addAscendingOrderByColumn(FieldValuePeer::VALUE);
         $cField->setLimit(15);
         $values = FieldValuePeer::doSelect($cField);
         $valueIndex = 0;
         foreach ($values as $value) {
             $str .= "<label>" . $value->getValue() . "</label>";
             $str .= "<input type=\"checkbox\" name=\"fields[" . $field->getId() . "][{$valueIndex}]\"  id=\"fields_" . $field->getId() . "_{$valueIndex}\" value=\"" . $value->getValue() . "\" /><br>";
             $valueIndex++;
         }
         $str .= "</fieldset>";
     }
     return $str;
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      ConfigFieldCategory $value A ConfigFieldCategory object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(ConfigFieldCategory $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
示例#3
0
 /**
  * Declares an association between this object and a ConfigFieldCategory object.
  *
  * @param      ConfigFieldCategory $v
  * @return     ConfigField The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setConfigFieldCategory(ConfigFieldCategory $v = null)
 {
     if ($v === null) {
         $this->setCategoryId(NULL);
     } else {
         $this->setCategoryId($v->getId());
     }
     $this->aConfigFieldCategory = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ConfigFieldCategory object, it will not be re-added.
     if ($v !== null) {
         $v->addConfigField($this);
     }
     return $this;
 }