Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 529 Bytes

model-collections.md

File metadata and controls

18 lines (14 loc) · 529 Bytes

DataModel Collections

A model collection is a container class for models with methods to perform operations on those models or sort them.

Creating a model collection

When you create a new collection, you can optionally pass an array of models into the constructor. Or you can always set models later using the setModels method.

$collection = new \BuzzingPixel\DataModel\ModelCollection(array(
    new MyModel(array(
        'myInteger' => 2
    )),
    new MyModel(array(
        'myInteger' => 3
    ))
);