Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • EmailAccount
  • EmailDropboxSettings
  • GMailAccount
  • GoogleProject
  • JSONEmbeddedModel
  • MailgunAccount
  • MailjetAccount
  • MandrillAccount
  • OutlookEmailAccount
  • SendgridAccount
  • SESAccount
  • TwitterApp
  • WidgetLayout
  • YahooEmailAccount
  • Overview
  • Package
  • Class
  • Tree

Class JSONEmbeddedModel

A model class for dealing with "embedded" models, whose attributes are stored in a database column as a JSON-encoded string, when using JSONEmbeddedModelFieldsBehavior.

The methods for form inputs and rendering detail should be included in the models themselves, to keep each model self-contained.

CComponent
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by JSONEmbeddedModel

Direct known subclasses

EmailAccount, EmailDropboxSettings, GoogleProject, TwitterApp, WidgetLayout

Indirect known subclasses

GMailAccount, MailgunAccount, YahooEmailAccount, MailjetAccount, MandrillAccount, OutlookEmailAccount, ProfileWidgetLayout, RecordViewWidgetLayout, SendgridAccount, SESAccount, TopicsWidgetLayout
Abstract
Package: application\models\embedded
Author: Demitri Morgan <demitri@x2engine.com>
Located at x2engine/protected/models/embedded/JSONEmbeddedModel.php
Methods summary
public static
# getProtectedFieldPlaceholder( )
public
# getProtectedFields( )
public
# setAttributes( array $values, boolean $safeOnly = true )

Overridden to skip placeholder values

Overridden to skip placeholder values

Parameters

$values
array
$values attribute values (name=>value) to be set.
$safeOnly
boolean
$safeOnly whether the assignments should only be done to the safe attributes. A safe attribute is one that is associated with a validation rule in the current scenario.

Overrides

CModel::setAttributes()
public
# renderProtectedInput( mixed $field )
public
# renderInput( mixed $field )
public
# renderForm( )
public
# getMetaData( )

Values of properties of parent model to set when embedded model is created

Values of properties of parent model to set when embedded model is created

public array
# attributeNames( )

Returns the list of attribute names of the model.

Returns the list of attribute names of the model.

Returns

array
list of attribute names.
public
# detailView( )

Child classes implementing this should override this function to generate a detail view. The resulting markup should be echoed out, not returned.

Child classes implementing this should override this function to generate a detail view. The resulting markup should be echoed out, not returned.

public
# modelLabel( )

A UI-friendly name that the model should be called.

A UI-friendly name that the model should be called.

public
# renderInputs( )

Child classes implementing this should generate all necessary input form elements for modifying fields of the embedded model. The resulting markup should be echoed out, not returned.

Child classes implementing this should generate all necessary input form elements for modifying fields of the embedded model. The resulting markup should be echoed out, not returned.

public
# resolveName( string $attribute )

Generate form input name for an attribute so that the urlencoded post data comes in a form that can be properly interpreted by setAttributes in the container model JSONEmbeddedModelFieldsBehavior

Generate form input name for an attribute so that the urlencoded post data comes in a form that can be properly interpreted by setAttributes in the container model JSONEmbeddedModelFieldsBehavior

Parameters

$attribute
string
$attribute
public
# htmlOptions( type $name, mixed $options = array() )

Generate a list of options to send to methods within CHtml that take HTML element options/properties, so that it includes the proper name of the input.

Generate a list of options to send to methods within CHtml that take HTML element options/properties, so that it includes the proper name of the input.

Parameters

$name
type
$options
$options
Methods inherited from CModel
addError(), addErrors(), afterConstruct(), afterValidate(), attributeLabels(), beforeValidate(), behaviors(), clearErrors(), createValidators(), generateAttributeLabel(), getAttributeLabel(), getAttributes(), getError(), getErrors(), getIterator(), getSafeAttributeNames(), getScenario(), getValidatorList(), getValidators(), hasErrors(), isAttributeRequired(), isAttributeSafe(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), onAfterConstruct(), onAfterValidate(), onBeforeValidate(), onUnsafeAttribute(), rules(), setScenario(), unsetAttributes(), validate()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public boolean $requiresAdmin false
#

Whether or not admin rights are required to access this model

Whether or not admin rights are required to access this model

protected type $_attributeNames
#

Stores derived value returned by JSONEmbeddedModel::attributeNames()

Stores derived value returned by JSONEmbeddedModel::attributeNames()

public type $exoAttr
#

Name of the attribute in the containing model that contains this model

Name of the attribute in the containing model that contains this model

public type $exoFormName
#

Form field name prefix

Form field name prefix

public CActiveRecord $exoModel
#

The model to which this embedded model belongs

The model to which this embedded model belongs

Magic properties inherited from CModel
$attributes, $errors, $iterator, $safeAttributeNames, $scenario, $validatorList, $validators
X2CRM Documentation API documentation generated by ApiGen 2.8.0