Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZModuleLink Class Reference

## Public Member Functions
| __construct ( $module, $type, $id)
& | sections ( $as_object=true)
| sectionCount ()
| addSection ( $section)
| removeSection ( $section)

## Public Attributes
| $Module
| $Type
| $ID

## Detailed Description

! eZCommon The class eZModuleLink handles remote linkage of sections.

It can link sections from a remote modules to a specific module and sub type. Each link can have zero or more link items, this makes it possible to create a list of related articles etc..

The module linkage system assumes that some sql tables has been created for each module/type. The tables are: {Module}_{Type}SectionDict {Module}_LinkSection {Module}_Link where {Module} is the module name and {Type} is the type name which are sent to the constructor.

The best thing is to use the linklist.php, linkselect.php and linkmove.php found in classes/admin, it has everything setup for simple usage and is properly generalized for simple reuse.

// Sets a module link for eZTrade using Products and with product id 1
$link = new eZModuleLink( "eZTrade", "Product", 1 );
$sections =& $link->sections();
foreach( $sections as $section )
{
// Do something with section
}
$section = new eZLinkSection( false, "eZTrade" );
$section->setName( "Related links" );
$section->store();
$link->addSection( $section );
eZLinkSection
Definition: ezlinksection.php:43
eZModuleLink
Definition: ezmodulelink.php:65
$sections
$sections
Definition: classes/admin/linklist.php:227
$section
$section
Definition: ezimagecatalogue/user/categoryedit.php:393
$link
$link
Definition: ezlink/admin/attributeedit.php:49

Definition at line 64 of file ezmodulelink.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZModuleLink::__construct | ( |  | $module,
|  |  | $type,
|  |  | $id
| ) |  |

Initializes the object with the module name, the sub type and the id of the item.

Definition at line 69 of file ezmodulelink.php.

References $id, $module, and $type.

## Member Function Documentation

## ◆ addSection()

eZModuleLink::addSection | ( |  | $section | ) |

Adds a new section to the current item. $section must be a properly initialized eZLinkSection object.

Definition at line 119 of file ezmodulelink.php.

References $db, $res, $section, and eZDB\globalDatabase().

## ◆ removeSection()

eZModuleLink::removeSection | ( |  | $section | ) |

Adds a new section to the current item. $section must be a properly initialized eZLinkSection object and belong to the current item.

Definition at line 149 of file ezmodulelink.php.

References $db, $id, $res, $section, and eZDB\globalDatabase().

## ◆ sectionCount()

eZModuleLink::sectionCount | ( |  | ) |

Returns the number of sections the current item has.

Definition at line 103 of file ezmodulelink.php.

References $db, $row, and eZDB\globalDatabase().

## ◆ sections()

& eZModuleLink::sections | ( |  | $as_object = `true` | ) |

Returns an array of sections belonging the current item. If $as_object is true it is returned with eZLinkSection objects as items, otherwise it is returned with the ID as item.

Definition at line 81 of file ezmodulelink.php.

References $db, $id, $row, and eZDB\globalDatabase().

## Member Data Documentation

## ◆ $ID

eZModuleLink::$ID

Definition at line 168 of file ezmodulelink.php.

## ◆ $Module

eZModuleLink::$Module

Definition at line 166 of file ezmodulelink.php.

## ◆ $Type

eZModuleLink::$Type

Definition at line 167 of file ezmodulelink.php.

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

- ezmodulelink.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.