Overview

Packages

  • Components
  • Internals
    • AR
  • RestApi
    • Objects
    • Services

Classes

  • CBHttpRequest
  • CBJson
  • CBJsonController
  • CBJsonInlineAction
  • CBJsonModel
  • Overview
  • Package
  • Class
  • Tree
  • Todo

Class CBJsonModel

Base class for JSON models.

CFormModel
Extended by CBJsonModel

Direct known subclasses

ManufacturerJson, ProductCategoryJson, ProductJson, ProductQueryJson
Package: Components
Author: Konstantinos Filios <konfilios@gmail.com>
Since: 1.0
Located at components/CBJsonModel.php
Methods summary
public boolean
# validate( array $attributes = null, boolean $clearErrors = true )

Throw exception if validation fails.

Throw exception if validation fails.

Parameters

$attributes
array
$attributes
$clearErrors
boolean
$clearErrors

Returns

boolean

Throws

CException
public string[]
# getAttributeTypes( )

Types of non-scalar members.

Types of non-scalar members.

Returns

string[]
public CBJsonModel
# copyFrom( array|object $source )

Initialize from source object/array.

Initialize from source object/array.

Parameters

$source
array|object
$source

Returns

CBJsonModel
public mixed
# toArray( )

Model attributes as array.

Model attributes as array.

Returns

mixed
public static CBJsonModel
# createFromOne( array|object $source )

Clones a source into a json model.

Clones a source into a json model.

Parameters

$source
array|object
$source Source to clone attributes from.

Returns

CBJsonModel
Cloned CBJsonModel subtype.
public static CBJsonModel[]
# createFromMany( array $sources )

Clones an array of sources into an array of json models.

Clones an array of sources into an array of json models.

Original model array keys are preserved in final array.

Parameters

$sources
array
$sources Sources to clone attributes from.

Returns

CBJsonModel[]
Cloned CBJsonModel subtypes.
public static mixed
# resolveObjectRecursively( mixed $inputObject, boolean $doSuppressNulls = false )

Resolve an object to its proper JSON representation.

Resolve an object to its proper JSON representation.

Parameters

$inputObject
mixed
$inputObject
$doSuppressNulls
boolean
$doSuppressNulls If true, null properties are suppressed from result.

Returns

mixed
Bogo Yii Json Service API documentation generated by ApiGen 2.8.0