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

Class DefaultCollection

Class DefaultCollection.

This is the default implementation of a model collection in DcGeneral. Internally it simply holds an array.

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

Get length of this collection.

Get length of this collection.

Returns

integer

Implementation of

DcGeneral\Data\CollectionInterface::length()
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

Implementation of

DcGeneral\Data\CollectionInterface::get()
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.

Implementation of

DcGeneral\Data\CollectionInterface::add()
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.

Implementation of

DcGeneral\Data\CollectionInterface::push()
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

Implementation of

DcGeneral\Data\CollectionInterface::pop()
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.

Implementation of

DcGeneral\Data\CollectionInterface::unshift()
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

Implementation of

DcGeneral\Data\CollectionInterface::shift()
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.

Implementation of

DcGeneral\Data\CollectionInterface::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.

Implementation of

DcGeneral\Data\CollectionInterface::remove()
public DcGeneral\Data\CollectionInterface
# reverse( )

Make a reverse sorted collection of this collection.

Make a reverse sorted collection of this collection.

Returns

DcGeneral\Data\CollectionInterface

Implementation of

DcGeneral\Data\CollectionInterface::reverse()
public DcGeneral\Data\CollectionInterface
# 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\CollectionInterface

Implementation of

DcGeneral\Data\CollectionInterface::sort()
public IteratorAggregate
# getIterator( )

Get a iterator for this collection.

Get a iterator for this collection.

Returns

IteratorAggregate
Properties summary
protected DcGeneral\Data\ModelInterface[] $arrCollection array()
#

The list of contained models.

The list of contained models.

contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0