*/ public function select(Select $select): Collection; /** * Get a number of records in DB. */ public function count(Select $select): int; /** * Insert an entity into DB. */ public function insert(Entity $entity): void; /** * Insert a collection into DB. * * @phpstan-param Collection $collection */ public function massInsert(Collection $collection): void; /** * Update an entity in DB. */ public function update(Entity $entity): void; /** * Mark an entity as deleted in DB. */ public function delete(Entity $entity): void; /** * Select related entities from DB. * * @return Collection|Entity|null * @phpstan-return Collection|Entity|null */ public function selectRelated(Entity $entity, string $relationName, ?Select $select = null); /** * Get a number of related entities in DB. */ public function countRelated(Entity $entity, string $relationName, ?Select $select = null): int; /** * Insert an entity into DB, on duplicate key update specified attributes. * * @param string[] $onDuplicateUpdateAttributeList */ public function insertOnDuplicateUpdate(Entity $entity, array $onDuplicateUpdateAttributeList): void; }