Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions
Integration Class Reference
Inheritance diagram for Integration:
AbstractModel DataObject

Public Member Functions

 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 loadByConsumerId ($consumerId)
 
 loadActiveIntegrationByConsumerId ($consumerId)
 
 getStatus ()
 
- Public Member Functions inherited from AbstractModel
 __construct (\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
 
 __sleep ()
 
 __wakeup ()
 
 setIdFieldName ($name)
 
 getIdFieldName ()
 
 getId ()
 
 setId ($value)
 
 isDeleted ($isDeleted=null)
 
 hasDataChanges ()
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 setDataChanges ($value)
 
 getOrigData ($key=null)
 
 setOrigData ($key=null, $data=null)
 
 dataHasChangedFor ($field)
 
 getResourceName ()
 
 getResourceCollection ()
 
 getCollection ()
 
 load ($modelId, $field=null)
 
 beforeLoad ($identifier, $field=null)
 
 afterLoad ()
 
 isSaveAllowed ()
 
 setHasDataChanges ($flag)
 
 save ()
 
 afterCommitCallback ()
 
 isObjectNew ($flag=null)
 
 beforeSave ()
 
 validateBeforeSave ()
 
 getCacheTags ()
 
 cleanModelCache ()
 
 afterSave ()
 
 delete ()
 
 beforeDelete ()
 
 afterDelete ()
 
 afterDeleteCommit ()
 
 getResource ()
 
 getEntityId ()
 
 setEntityId ($entityId)
 
 clearInstance ()
 
 getStoredData ()
 
 getEventPrefix ()
 
- Public Member Functions inherited from DataObject
 __construct (array $data=[])
 
 addData (array $arr)
 
 setData ($key, $value=null)
 
 unsetData ($key=null)
 
 getData ($key='', $index=null)
 
 getDataByPath ($path)
 
 getDataByKey ($key)
 
 setDataUsingMethod ($key, $args=[])
 
 getDataUsingMethod ($key, $args=null)
 
 hasData ($key='')
 
 toArray (array $keys=[])
 
 convertToArray (array $keys=[])
 
 toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true)
 
 toJson (array $keys=[])
 
 convertToJson (array $keys=[])
 
 toString ($format='')
 
 __call ($method, $args)
 
 isEmpty ()
 
 serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"')
 
 debug ($data=null, &$objects=[])
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 offsetGet ($offset)
 

Data Fields

const STATUS_INACTIVE = 0
 
const STATUS_ACTIVE = 1
 
const STATUS_RECREATED = 2
 
const TYPE_MANUAL = 0
 
const TYPE_CONFIG = 1
 
const ID = 'integration_id'
 
const NAME = 'name'
 
const EMAIL = 'email'
 
const ENDPOINT = 'endpoint'
 
const IDENTITY_LINK_URL = 'identity_link_url'
 
const SETUP_TYPE = 'setup_type'
 
const CONSUMER_ID = 'consumer_id'
 
const STATUS = 'status'
 

Protected Member Functions

 _construct ()
 
- Protected Member Functions inherited from AbstractModel
 _construct ()
 
 _init ($resourceModel)
 
 _setResourceModel ($resourceName, $collectionName=null)
 
 _getResource ()
 
 _getEventData ()
 
 _beforeLoad ($modelId, $field=null)
 
 _afterLoad ()
 
 _hasModelChanged ()
 
 _getValidatorBeforeSave ()
 
 _createValidatorBeforeSave ()
 
 _getValidationRulesBeforeSave ()
 
 _clearReferences ()
 
 _clearData ()
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractModel
 $_eventPrefix = 'core_abstract'
 
 $_eventObject = 'object'
 
 $_idFieldName = 'id'
 
 $_hasDataChanges = false
 
 $_origData
 
 $_isDeleted = false
 
 $_resource
 
 $_resourceCollection
 
 $_resourceName
 
 $_collectionName
 
 $_cacheTag = false
 
 $_dataSaveAllowed = true
 
 $_isObjectNew = null
 
 $_validatorBeforeSave = null
 
 $_eventManager
 
 $_cacheManager
 
 $_registry
 
 $_logger
 
 $_appState
 
 $_actionValidator
 
 $storedData = []
 
- Protected Attributes inherited from DataObject
 $_data = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Integration model.

@method \string getName() @method Integration setName(\string $name) @method \string getEmail() @method Integration setEmail(\string $email) @method Integration setStatus(\int $value) @method \int getSetupType() @method Integration setSetupType(\int $value) @method Integration setConsumerId(\string $consumerId) @method \string getConsumerId() @method \string getEndpoint() @method Integration setEndpoint(\string $endpoint) @method \string getIdentityLinkUrl() @method Integration setIdentityLinkUrl(\string $identityLinkUrl) @method \string getCreatedAt() @method Integration setCreatedAt(\string $createdAt) @method \string getUpdatedAt() @method Integration setUpdatedAt(\string $createdAt) @api

Since
100.0.2

Definition at line 31 of file Integration.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Model\Context  $context,
\Magento\Framework\Registry  $registry,
\Magento\Framework\Model\ResourceModel\AbstractResource  $resource = null,
\Magento\Framework\Data\Collection\AbstractDb  $resourceCollection = null,
array  $data = [] 
)

#-

Parameters
\Magento\Framework\Model\Context$context
\Magento\Framework\Registry$registry
\Magento\Framework\Model\ResourceModel\AbstractResource$resource
\Magento\Framework\Data\Collection\AbstractDb$resourceCollection
array$data

Definition at line 81 of file Integration.php.

87  {
88  parent::__construct($context, $registry, $resource, $resourceCollection, $data);
89  }
$resource
Definition: bulk.php:12

Member Function Documentation

◆ _construct()

_construct ( )
protected

Initialize resource model

Returns
void

Definition at line 96 of file Integration.php.

97  {
98  parent::_construct();
99  $this->_init(\Magento\Integration\Model\ResourceModel\Integration::class);
100  }

◆ getStatus()

getStatus ( )

Get integration status. Cast to the type of STATUS_* constants in order to make strict comparison valid.

Returns
int @api

Definition at line 132 of file Integration.php.

133  {
134  return (int)$this->getData(self::STATUS);
135  }
getData($key='', $index=null)
Definition: DataObject.php:119

◆ loadActiveIntegrationByConsumerId()

loadActiveIntegrationByConsumerId (   $consumerId)

Load active integration by oAuth consumer ID.

Parameters
int$consumerId
Returns
$this

Definition at line 119 of file Integration.php.

120  {
121  $integrationData = $this->getResource()->selectActiveIntegrationByConsumerId($consumerId);
122  $this->setData($integrationData ? $integrationData : []);
123  return $this;
124  }

◆ loadByConsumerId()

loadByConsumerId (   $consumerId)

Load integration by oAuth consumer ID.

Parameters
int$consumerId
Returns
$this

Definition at line 108 of file Integration.php.

109  {
110  return $this->load($consumerId, self::CONSUMER_ID);
111  }

Field Documentation

◆ CONSUMER_ID

const CONSUMER_ID = 'consumer_id'

Definition at line 68 of file Integration.php.

◆ EMAIL

const EMAIL = 'email'

Definition at line 60 of file Integration.php.

◆ ENDPOINT

const ENDPOINT = 'endpoint'

Definition at line 62 of file Integration.php.

◆ ID

const ID = 'integration_id'

#- #+ Integration data key constants.

Definition at line 56 of file Integration.php.

◆ IDENTITY_LINK_URL

const IDENTITY_LINK_URL = 'identity_link_url'

Definition at line 64 of file Integration.php.

◆ NAME

const NAME = 'name'

Definition at line 58 of file Integration.php.

◆ SETUP_TYPE

const SETUP_TYPE = 'setup_type'

Definition at line 66 of file Integration.php.

◆ STATUS

const STATUS = 'status'

Definition at line 70 of file Integration.php.

◆ STATUS_ACTIVE

const STATUS_ACTIVE = 1

Definition at line 38 of file Integration.php.

◆ STATUS_INACTIVE

const STATUS_INACTIVE = 0

#+ Integration Status values

Definition at line 36 of file Integration.php.

◆ STATUS_RECREATED

const STATUS_RECREATED = 2

Definition at line 40 of file Integration.php.

◆ TYPE_CONFIG

const TYPE_CONFIG = 1

Definition at line 49 of file Integration.php.

◆ TYPE_MANUAL

const TYPE_MANUAL = 0

#- #+ Integration setup type

Definition at line 47 of file Integration.php.


The documentation for this class was generated from the following file: