Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • AbstractModel
  • DCGE
  • DefaultCollection
  • DefaultConfig
  • DefaultDataProvider
  • DefaultLanguageInformation
  • DefaultLanguageInformationCollection
  • DefaultModel
  • MultiLanguageDataProvider
  • NoOpDataProvider
  • PropertyValueBag
  • TableRowsAsRecordsDataProvider

Interfaces

  • CollectionInterface
  • ConfigInterface
  • DataProviderInterface
  • LanguageInformationCollectionInterface
  • LanguageInformationInterface
  • ModelInterface
  • MultiLanguageDataProviderInterface
  • PropertyValueBagInterface
  • VersionModelInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Interface CollectionInterface

Interface InterfaceGeneralCollection

This represents an iterable collection of Model elements.

DcGeneral\Data\CollectionInterface implements IteratorAggregate

Direct known implementers

DcGeneral\Data\DefaultCollection
Namespace: DcGeneral\Data
Located at Data/CollectionInterface.php
Methods summary
public integer
# length( )

Get length of this collection.

Get length of this collection.

Returns

integer
public DcGeneral\Data\ModelInterface
# get( integer $intIndex )

Get the model at a specific index.

Get the model at a specific index.

Parameters

$intIndex
integer
$intIndex The index of the model to retrieve.

Returns

DcGeneral\Data\ModelInterface
public
# add( DcGeneral\Data\ModelInterface $objModel )

Alias for push - Append a model to the end of this collection.

Alias for push - Append a model to the end of this collection.

Deprecated

Use push.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel The model to append to the collection.

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no model has been passed.
public
# push( DcGeneral\Data\ModelInterface $objModel )

Append a model to the end of this collection.

Append a model to the end of this collection.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel The model to append to the collection.

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no model has been passed.
public DcGeneral\Data\ModelInterface
# pop( )

Remove the model at the end of the collection and return it.

Remove the model at the end of the collection and return it.

If the collection is empty, null will be returned.

Returns

DcGeneral\Data\ModelInterface
public
# unshift( DcGeneral\Data\ModelInterface $objModel )

Insert a model at the beginning of the collection.

Insert a model at the beginning of the collection.

Parameters

$objModel
DcGeneral\Data\ModelInterface
$objModel The model to insert into the collection.
public DcGeneral\Data\ModelInterface
# shift( )

Remove the model from the beginning of the collection and return it.

Remove the model from the beginning of the collection and return it.

If the collection is empty, null will be returned.

Returns

DcGeneral\Data\ModelInterface
public
# insert( integer $intIndex, DcGeneral\Data\ModelInterface $objModel )

Insert a record at the specific position.

Insert a record at the specific position.

Move all records at position >= $index one index up. If $index is out of bounds, just add at the end (does not fill with empty records!).

Parameters

$intIndex
integer
$intIndex The index where the model shall be placed.
$objModel
DcGeneral\Data\ModelInterface
$objModel The model to insert.
public
# remove( mixed $mixedValue )

Remove the given index or model from the collection and renew the index.

Remove the given index or model from the collection and renew the index.

ATTENTION: Don't use key to unset in foreach because of the new index.

Parameters

$mixedValue
mixed
$mixedValue The index (integer) or InterfaceGeneralModel instance to remove.
public DcGeneral\Data\ModelInterface
# reverse( )

Make a reverse sorted collection of this collection.

Make a reverse sorted collection of this collection.

Returns

DcGeneral\Data\ModelInterface
public DcGeneral\Data\ModelInterface
# sort( callable $callback )

Sort the records with the given callback and return the new sorted collection.

Sort the records with the given callback and return the new sorted collection.

Parameters

$callback
callable
$callback The callback function to use.

Returns

DcGeneral\Data\ModelInterface
Methods inherited from IteratorAggregate
getIterator()
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0