aerisnet/fiesta-online-bundle
Symfony 4+ bundle for Fiesta Online web projects. Provides core Doctrine entities and service managers (accounts, characters, inventory checks) to build a basic Fiesta Online homepage, with example mappings for multi-connection setups.
Installation
composer require aerisnet/fiesta-online-bundle
Configure Doctrine
Update config/packages/doctrine.yaml with the provided dbal and orm configurations for the character connection (adjust CHARACTER_URL in .env).
Example:
dbal:
connections:
character:
url: '%env(resolve:CHARACTER_URL)%'
driver: 'pdo_sqlsrv'
charset: UTF-8
First Use Case
Inject AccountManager into a controller/service to fetch account data:
use Aeris\FiestaOnlineBundle\Manager\AccountManager;
public function showAccount(AccountManager $accountManager, int $accountId)
{
$account = $accountManager->getAccountById($accountId);
return response()->json($account);
}
vendor/aeris/fiesta-online-bundle/src/Entity/.AccountManager, CharacterManager (check src/Manager/ for others).character entity manager is properly mapped.Account Management
$accountManager->getAccountById($id).$accountManager->getAllAccounts().Illuminate\Support\Facades\Cache).Character Data
CharacterManager to interact with character data:
$character = $characterManager->getCharacterById($id);
$characters = $characterManager->getCharactersByAccount($accountId);
Database Connection Handling
character). Always prefix queries with the character entity manager:
$em = $this->getDoctrine()->getManager('character');
$character = $em->getRepository('Character')->find($id);
$accountManager = app('Aeris\FiestaOnlineBundle\Manager\AccountManager');
return new AccountResource($accountManager->getAccountById($id));
Connection Configuration
pdo_sqlsrv may not be installed by default.pecl install pdo_sqlsrv) and ensure .env has the correct CHARACTER_URL (e.g., sqlsrv://user:pass@host:port/database).doctrine:schema:validate for connection errors.Entity Manager Scope
character entity manager when querying.$this->getDoctrine()->getManager('character') or inject the manager explicitly.Outdated Dependencies
app/Extensions/ to patch incompatibilities.config/packages/dev/doctrine.yaml:
doctrine:
dbal:
logging: true
profiling: true
php bin/console doctrine:mapping:info --em=character
Custom Managers
Extend existing managers (e.g., AccountManager) to add business logic:
class CustomAccountManager extends AccountManager {
public function getActiveAccounts() {
return $this->createQueryBuilder('u')
->where('u.isActive = :active')
->setParameter('active', true)
->getQuery()
->getResult();
}
}
New Entities Add custom entities by extending the bundle’s structure:
app/Entity/FiestaOnline/ (or similar).config/packages/doctrine.yaml under the character entity manager.Event Subscribers
Listen for Doctrine lifecycle events (e.g., postLoad) to transform data:
use Doctrine\Common\EventSubscriber;
class CharacterSubscriber implements EventSubscriber {
public function getSubscribedEvents() {
return ['postLoad'];
}
public function postLoad(LifecycleEventArgs $args) {
$entity = $args->getObject();
if ($entity instanceof \Aeris\FiestaOnlineBundle\Entity\Character) {
// Transform data here
}
}
}
How can I help you explore Laravel packages today?