for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* components
*
* @author Wolfy-J
*/
namespace Spiral\ODM\Schemas\Definitions;
* Aggregation definition (links one Document with another).
final class AggregationDefinition
{
* Aggregation type, see Document::ONE and Document::MANY.
* @var int
private $type;
* Linked class.
* @var string
private $class;
* Query template.
* @var array
private $query = [];
* @param int $type
* @param string $class
* @param array $query
public function __construct(int $type, string $class, array $query)
$this->type = $type;
$this->class = $class;
$this->query = $query;
}
* @return int
public function getType(): int
return $this->type;
* @return string
public function getClass(): string
return $this->class;
* @return array
public function getQuery(): array
return $this->query;
public function packSchema(): array
return [$this->type, $this->class, $this->query];