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

  • Media
  • Overview
  • Package
  • Class
  • Tree

Class Media

This is the model class for table "x2_media".

CComponent
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CActiveRecord
Extended by X2ActiveRecord
Extended by X2Model
Extended by Media
Package: application\modules\media\models
Located at x2engine/protected/modules/media/models/Media.php
Methods summary
public static Media
# model( string $className = __CLASS__ )

Returns the static model of the specified AR class.

Returns the static model of the specified AR class.

Parameters

$className
string
$className active record class name.

Returns

Media
the static model class

Overrides

X2Model::model()
public static
# getMenuLogo( )
public string
# tableName( )

Returns

string
the associated database table name

Overrides

CActiveRecord::tableName()
public
# afterDelete( )

Runs when a model is deleted. Clears any entries in x2_phone_numbers. Fires onAfterDelete event.

Runs when a model is deleted. Clears any entries in x2_phone_numbers. Fires onAfterDelete event.

Overrides

X2Model::afterDelete()
public
# resolveNameConflicts( )
public boolean
# beforeSave( )

Remembers if this was a new record before saving.

Remembers if this was a new record before saving.

Returns

boolean
whether the saving should be executed. Defaults to true.

Returns

the answer from CActiveRecord::beforeSave()

Overrides

X2Model::beforeSave()
public array
# behaviors( )

Returns a list of behaviors that this model should behave as.

Returns a list of behaviors that this model should behave as.

Returns

array
the behavior configurations (behavior name=>behavior configuration)

Overrides

X2Model::behaviors()
public array
# rules( )

Returns

array
validation rules for model attributes.

Overrides

X2Model::rules()
public array
# relations( )

Returns

array
relational rules.

Overrides

X2Model::relations()
public CActiveDataProvider
# search( )

Retrieves a list of models based on the current search/filter conditions.

Retrieves a list of models based on the current search/filter conditions.

Returns

CActiveDataProvider
the data provider that can return the models based on the search/filter conditions.
public
# isImage( )
public static true
# isImageExt( mixed $filename )

Return true if $filename has an image extension. Image extensions include: jpg, gif, png, bmp, jpeg, jpe

Return true if $filename has an image extension. Image extensions include: jpg, gif, png, bmp, jpeg, jpe

Parameters

$filename
mixed
$filename the file name that has the extension

Returns

true
if $filename has an image extension, false otherwise
public
# getImage( mixed $link = false, array $htmlOptions = array () )
public
# getGooglePreview( )
public string
# renderAttribute( string $fieldName, boolean $makeLinks = true, boolean $textOnly = true, mixed $encode = true )

Renders an attribute of the model based on its field type

Renders an attribute of the model based on its field type

Parameters

$fieldName
string
$fieldName the name of the attribute to be rendered
$makeLinks
boolean
$makeLinks whether to create HTML links for certain field types
$textOnly
boolean
$textOnly whether to generate HTML or plain text
$encode

Returns

string
the HTML or text for the formatted attribute

Overrides

X2ActiveRecord::renderAttribute()
public String|null
# getPath( )

Magic path getter

Magic path getter

Obtains the full, absolute path to a file.

Returns

String|null
Returns a path to the file or NULL if the file does not exist.
public type
# resolveSize( )

Gets file size

Gets file size

Obtains and returns the file size. If it hasn't been saved in the database, this method does so.

Returns

type
public type
# resolveDimensions( )

Gets dimensions of the file, if it is an image.

Gets dimensions of the file, if it is an image.

Returns

type
public type
# getFmtSize( )

Magic getter for human-readable file size.

Magic getter for human-readable file size.

Returns

type
public
# getFmtDimensions( )
public type
# resolveType( )

Gets file type info

Gets file type info

Examines the file and gets MIME info; saves it in the record if it's not there already.

Returns

type
public static
# getFilePath( mixed $uploadedBy, mixed $fileName )
public type
# getUrl( )

Magic uploaded file URL getter method

Magic uploaded file URL getter method

Returns

type
public static
# getFileUrl( mixed $path )
public
# getFullUrl( )
public static
# getFullFileUrl( mixed $path )
public
# getMediaLink( )
public
# fileExists( )
public static
# getServerMaxUploadSize( )
public static
# forbiddenFileTypes( )
public static string
# attachmentSocialText( string $str, boolean $makeLink = false, boolean $makeImage = false )

Parameters

$str
string
$str
$makeLink
boolean
$makeLink
$makeImage
boolean
$makeImage

Returns

string
public
# getDownloadLink( mixed $text = null, mixed $htmlOptions = array() )
public
# renderFile( )
public
# getAccessKey( )
public
# getPublicUrl( mixed $key = true )
public static string
# attachmentActionText( string $actionDescription, boolean $makeLink = false, boolean $makeImage = false )

Generates a description message with a link and optional preview image for media items.

Generates a description message with a link and optional preview image for media items.

Parameters

$actionDescription
string
$actionDescription
$makeLink
boolean
$makeLink
$makeImage
boolean
$makeImage

Returns

string
Methods inherited from X2Model
__construct(), afterCreate(), afterFind(), afterSave(), afterUpdate(), attributeChanged(), attributeLabels(), checkThrowAttrError(), compareAssignment(), compareAttribute(), compareAttributes(), compareBoolean(), compareDropdown(), duplicateFields(), findAll(), findByAttributes(), findByEmail(), findByNameId(), findByPkInArray(), getAllRecordNames(), getAssignmentOptions(), getAssociationModel(), getAssociationType(), getAssociationTypeOptions(), getAttribute(), getAttributeLabel(), getAttributeLabels(), getDefaultAssignment(), getDefaultFormLayout(), getDisplayName(), getEditableAttributeNames(), getEditableFieldNames(), getField(), getFieldComparisonOptions(), getFieldPermissions(), getFields(), getFieldsForDropdown(), getInsertableAttributeTokens(), getIsExemptFromFieldLevelPermissions(), getLinkedAttribute(), getLinkedModel(), getLinkedModelMock(), getModelLink(), getModelLinkMock(), getModelName(), getModelNames(), getModelOfTypeWithId(), getModelOfTypeWithName(), getModelTitle(), getModelTypes(), getModelTypesWhichSupportRelationships(), getModelTypesWhichSupportWorkflow(), getModelsFromNames(), getModuleModel(), getModuleModelName(), getModuleModelNames(), getModuleModelsByName(), getModuleName(), getModules(), getMyModelName(), getOldAttributes(), getPhoneNumber(), getReadableAttributeNames(), getRecordName(), getSort(), getStaticLinkedModels(), getSummaryFields(), getTableNames(), getTranslatedModelTitles(), getVisibleAttributes(), hide(), insert(), isModuleModelName(), massUpdateNameId(), model2(), modelRules(), onAfterCreate(), onAfterInsert(), onAfterUpdate(), query(), queryFields(), renderErroneousField(), renderInput(), renderLinkedAttribute(), renderMergeInput(), renderModelAutocomplete(), renderModelInput(), resetFieldsPropertyCache(), runWithoutBehavior(), save(), searchBase(), setX2Fields(), translatedAttributeLabel(), unshiftOperator(), updateNameId(), updateNameIdRefs(), updateTimerTotals()
Methods inherited from X2ActiveRecord
getAllErrorMessages(), getBehaviorRules(), getFormatter(), getInputRenderer(), getName(), setFormatter(), setInputRenderer()
Methods inherited from CActiveRecord
__call(), __get(), __isset(), __set(), __sleep(), __unset(), addRelatedRecord(), afterFindInternal(), applyScopes(), attributeNames(), beforeCount(), beforeDelete(), beforeFind(), beforeFindInternal(), cache(), count(), countByAttributes(), countBySql(), defaultScope(), delete(), deleteAll(), deleteAllByAttributes(), deleteByPk(), equals(), exists(), find(), findAllByAttributes(), findAllByPk(), findAllBySql(), findByPk(), findBySql(), getActiveFinder(), getActiveRelation(), getAttributes(), getCommandBuilder(), getDbConnection(), getDbCriteria(), getIsNewRecord(), getMetaData(), getOldPrimaryKey(), getPrimaryKey(), getRelated(), getTableAlias(), getTableSchema(), hasAttribute(), hasRelated(), init(), instantiate(), offsetExists(), onAfterDelete(), onAfterFind(), onAfterSave(), onBeforeCount(), onBeforeDelete(), onBeforeFind(), onBeforeSave(), populateRecord(), populateRecords(), primaryKey(), refresh(), refreshMetaData(), resetScope(), saveAttributes(), saveCounters(), scopes(), setAttribute(), setDbCriteria(), setIsNewRecord(), setOldPrimaryKey(), setPrimaryKey(), setTableAlias(), together(), update(), updateAll(), updateByPk(), updateCounters(), with()
Methods inherited from CModel
addError(), addErrors(), afterConstruct(), afterValidate(), beforeValidate(), clearErrors(), createValidators(), generateAttributeLabel(), getError(), getErrors(), getIterator(), getSafeAttributeNames(), getScenario(), getValidatorList(), getValidators(), hasErrors(), isAttributeRequired(), isAttributeSafe(), offsetGet(), offsetSet(), offsetUnset(), onAfterConstruct(), onAfterValidate(), onBeforeValidate(), onUnsafeAttribute(), setAttributes(), setScenario(), unsetAttributes(), validate()
Methods inherited from CComponent
asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants inherited from CActiveRecord
BELONGS_TO, HAS_MANY, HAS_ONE, MANY_MANY, STAT
Properties summary
public true $supportsWorkflow false
#

if this model can have workflows associated with it, false otherwise

if this model can have workflows associated with it, false otherwise

public mixed $_path
#
public mixed $_url
#
protected string $fieldFormatterClass 'MediaFieldFormatter'
#
Properties inherited from X2Model
$_editableFieldNames, $_fieldPermissions, $_fields, $_linkedModels, $_nameIdRefs, $_oldAttributes, $_runAfterCreate, $associationModels, $autoPopulateFields, $dbPersistentGridSettings, $disablePersistentGridSettings, $modelNameToModuleName, $subScenario, $supportsFieldLevelPermissions, $translatedModelTitles, $uid
Properties inherited from X2ActiveRecord
$fieldInputRendererClass
Properties inherited from CActiveRecord
$db
Magic properties summary
public integer $id
#
public string $associationType
#
public integer $associationId
#
public string $fileName
#
public string $uploadedBy
#
public string $createDate
#
Magic properties inherited from X2Model
$fieldPermissions, $isExemptFromFieldLevelPermissions, $myModelName, $readableAttributeNames, $relatedX2Models
Magic properties inherited from CActiveRecord
$attributes, $commandBuilder, $dbConnection, $dbCriteria, $isNewRecord, $metaData, $oldPrimaryKey, $primaryKey, $tableAlias, $tableSchema
Magic properties inherited from CModel
$errors, $iterator, $safeAttributeNames, $scenario, $validatorList, $validators
X2CRM Documentation API documentation generated by ApiGen 2.8.0