eZPublishCommunityProject  2013.9
eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage Class Reference

Url field type external storage gateway implementation using Zeta Database Component. More...

+ Inheritance diagram for eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage:
+ Collaboration diagram for eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage:

Public Member Functions

 deleteFieldData ($fieldId, $versionNo)
 Deletes external URL data for field with $fieldId in $versionNo. More...
 
 getFieldData (Field $field)
 
 setConnection ($dbHandler)
 Set database handler for this gateway. More...
 
 storeFieldData (VersionInfo $versionInfo, Field $field)
 
- Public Member Functions inherited from eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway
 deleteFieldData ($versionNo, $fieldId)
 Deletes external data for $fieldId in $versionNo. More...
 
 getFieldData (Field $field)
 Sets a loaded URL, if one is stored for the given field. More...
 
 storeFieldData (VersionInfo $versionInfo, Field $field)
 Stores a URL based on the given field data. More...
 
- Public Member Functions inherited from eZ\Publish\Core\FieldType\StorageGateway
 setConnection ($connection)
 Sets the data storage connection to use. More...
 

Public Attributes

const URL_LINK_TABLE = "ezurl_object_link"
 
const URL_TABLE = "ezurl"
 

Protected Member Functions

 deleteOrphanedUrls ()
 Deletes all orphaned URLs. More...
 
 getConnection ()
 Returns the active connection. More...
 
 linkUrl ($urlId, $fieldId, $versionNo)
 Creates link to URL with $urlId for field with $fieldId in $versionNo. More...
 
 unlinkUrl ($fieldId, $versionNo)
 Removes link to URL for $fieldId in $versionNo. More...
 

Protected Attributes

 $dbHandler
 

Private Member Functions

 fetchById ($id)
 Fetches a row in ezurl table referenced by its $id. More...
 
 fetchByLink ($link)
 Fetches a row in ezurl table referenced by $link. More...
 
 insert (Field $field)
 Inserts a new entry in ezurl table with $field value data. More...
 

Detailed Description

Url field type external storage gateway implementation using Zeta Database Component.

Member Function Documentation

eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::deleteFieldData (   $fieldId,
  $versionNo 
)

Deletes external URL data for field with $fieldId in $versionNo.

If URL unlinked is found to be orphaned, it will be deleted.

Parameters
mixed$fieldId
mixed$versionNo
Returns
void
eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::deleteOrphanedUrls ( )
protected

Deletes all orphaned URLs.

Todo:
using two queries because zeta Database does not support joins in delete query. That could be avoided if the feature is implemented there.

URL is orphaned if it is not linked to a content attribute through ezurl_object_link table.

Returns
void

Referenced by eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage\deleteFieldData().

eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::fetchById (   $id)
private

Fetches a row in ezurl table referenced by its $id.

Parameters
mixed$id
Returns
null|array Hash with columns as keys or null if no entry can be found

Referenced by eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage\getFieldData().

eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::fetchByLink (   $link)
private

Fetches a row in ezurl table referenced by $link.

Parameters
string$link
Returns
null|array Hash with columns as keys or null if no entry can be found

Referenced by eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage\storeFieldData().

eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::getFieldData ( Field  $field)
See Also
eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::insert ( Field  $field)
private

Inserts a new entry in ezurl table with $field value data.

Parameters
\eZ\Publish\SPI\Persistence\Content\Field$field
Returns
mixed

Referenced by eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage\storeFieldData().

eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::linkUrl (   $urlId,
  $fieldId,
  $versionNo 
)
protected

Creates link to URL with $urlId for field with $fieldId in $versionNo.

Parameters
mixed$urlId
mixed$fieldId
mixed$versionNo
Returns
void

Referenced by eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage\storeFieldData().

eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::setConnection (   $dbHandler)

Set database handler for this gateway.

Parameters
mixed$dbHandler
Returns
void
Exceptions
\RuntimeExceptionif $dbHandler is not an instance of eZ\Publish\Core\Persistence\Legacy\EzcDbHandler
eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::storeFieldData ( VersionInfo  $versionInfo,
Field  $field 
)
See Also
eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::unlinkUrl (   $fieldId,
  $versionNo 
)
protected

Removes link to URL for $fieldId in $versionNo.

Parameters
mixed$fieldId
mixed$versionNo
Returns
void

Referenced by eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage\deleteFieldData().

Member Data Documentation

const eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::URL_LINK_TABLE = "ezurl_object_link"
const eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::URL_TABLE = "ezurl"

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