PHP Класс RedUNIT\Base\Cross

Tests self referential many-to-many relations, including the aggr feature.
Автор: Gabor de Mooij and the RedBeanPHP Community
Наследование: extends RedUNIT\Base
Показать файл Открыть проект

Открытые методы

Метод Описание
testAggrBasic ( ) : void Test aggr without the aliasing.
testAggrNullHandling ( ) : void Test how well aggr handles fields with no values.
testAggrWithOnlyAlias ( ) : void Test aggr with basic aliasing.
testAggregationInSelfRefNM ( ) : void Shared lists can only be formed using types.
testErrorHandlingAggr ( ) : void The aggr method can only be used with own-list.
testSelfReferential ( ) : void Test self referential N-M relations (page_page).
testSelfReferentialCRUD ( ) : void Test many different scenarios with self referential many-to-many relations.
testUnique ( ) : void Test the unique constraint.

Описание методов

testAggrBasic() публичный Метод

Test aggr without the aliasing.
public testAggrBasic ( ) : void
Результат void

testAggrNullHandling() публичный Метод

Test how well aggr handles fields with no values.
public testAggrNullHandling ( ) : void
Результат void

testAggrWithOnlyAlias() публичный Метод

Test aggr with basic aliasing.
public testAggrWithOnlyAlias ( ) : void
Результат void

testAggregationInSelfRefNM() публичный Метод

If you happen to have two beans of the same type you can still have a shared list but not with a sense of direction. I.e. quest->sharedQuest returns all the quests that follow the first one, but also the ones that are followed by the first one. If you want to have some sort of direction; i.e. one quest follows another one you'll have to use an alias: quest->target, but now you can't use the shared list anymore because it will start looking for a type named 'target' (which is just an alias) for quest, but it cant find that table and it's not possible to 'keep remembering' the alias throughout the system. The aggr() method solves this inconvenience. Aggr iterates through the list identified by its first argument ('target' -> ownQuestTargetList) and fetches every ID of the target (quest_target.target_id), loads these beans in batch for optimal performance, puts them back in the beans (questTarget->target) and returns the references.
public testAggregationInSelfRefNM ( ) : void
Результат void

testErrorHandlingAggr() публичный Метод

The aggr method can only be used with own-list.
public testErrorHandlingAggr ( ) : void
Результат void

testSelfReferential() публичный Метод

Test self referential N-M relations (page_page).
public testSelfReferential ( ) : void
Результат void

testSelfReferentialCRUD() публичный Метод

Test many different scenarios with self referential many-to-many relations.
public testSelfReferentialCRUD ( ) : void
Результат void

testUnique() публичный Метод

Just want to make sure it is not too limiting and functions properly for typical RedBeanPHP usage.
public testUnique ( ) : void
Результат void