create() public method

Create a new object in the backend with $fields as initial values.
public create ( array $fields ) : Horde_Rdo_Base
$fields array Array of field names => initial values.
return Horde_Rdo_Base The newly created object.
Example #1
0
 /**
  * Creates a property definition in the backend.
  * This wraps folding of the 'parameters' structure 
  *
  * @param array $property  An array with the property definition.
  *                         Keys may be
  *                          property_id Integer (autogenerated)
  *                          property    string The property name
  *                          datatype    string The property type
  *                          parameters  mixed Type definition parameters will be serialized
  *                          unit        string The unit to display
  *                          description string
  *                          priority    integer
  *
  * @return Sesha_Entity_Property  The property created.
  */
 public function create(array $property)
 {
     if (!is_string($property['parameters'])) {
         $property['parameters'] = serialize($property['parameters']);
     }
     if (array_key_exists('property_id', $property) && $property['property_id'] == null) {
         unset($property['property_id']);
     }
     return parent::create($property);
 }