You are here

function properties_category_save in Dynamic properties 7

Save an category object.

Parameters

$category: Category object.

5 calls to properties_category_save()
properties_admin_categories_add in ./properties.admin.inc
Form builder; Submit callback to save a category and redirect to list.
properties_admin_categories_add_another in ./properties.admin.inc
Form builder; Submit callback to save a category and stay on form.
properties_admin_categories_save in ./properties.admin.inc
Form builder; Submit callback to save a category and redirect to list.
properties_generate_generate in properties_generate/properties_generate.module
Generate properties.
properties_template_save in properties_template/properties_template.module
Save a template object.

File

./properties.module, line 875
This module provides a dynamic property field that can contain an unlimited number of attribute value pairs.

Code

function properties_category_save($category) {
  foreach ($category->attributes as $delta => $attribute) {

    // New attribute, save it first.
    if (!empty($attribute->new)) {
      properties_attribute_save($attribute);
    }

    // Empty attribute, remove from array.
    if (empty($attribute->name)) {
      unset($category->attributes[$delta]);
    }
  }
  $function_name = _properties_get_call('category', 'save');
  return $function_name($category);
}