public function delete() { self::$deleted = TRUE; }
/** * Test self-referential associations. * * @return void */ public function testCrossAssociation() { $ghost = R::dispense('ghost'); $ghost2 = R::dispense('ghost'); R::getRedBean()->getAssociationManager()->associate($ghost, $ghost2); \Model_Ghost_Ghost::$deleted = FALSE; R::getRedBean()->getAssociationManager()->unassociate($ghost, $ghost2); // No fast-track, assoc bean got trashed asrt(\Model_Ghost_Ghost::$deleted, TRUE); \Model_Ghost_Ghost::$deleted = FALSE; R::getRedBean()->getAssociationManager()->unassociate($ghost, $ghost2, TRUE); // Fast-track, assoc bean got deleted right away asrt(\Model_Ghost_Ghost::$deleted, FALSE); }