public function __construct($entityClass, $entityCollection, $conditions, $order, $limit, $offset)
{
// Convert boolean strings to boolean
foreach ($conditions as &$condition) {
if (is_scalar($condition) && (strtolower($condition) === 'true' || strtolower($condition) === 'false')) {
$condition = StdObjectWrapper::toBool($condition);
}
}
$this->entityClass = $entityClass;
$this->collectionName = $entityCollection;
$this->conditions = $conditions;
$this->limit = $limit;
$this->offset = $offset;
$this->data = Entity::getInstance()->getDatabase()->find($entityCollection, $conditions, $order, $limit, $offset);
}