$db = MMDB::instance();

$countryCode = $options['country-code'];
$clusterIdentifier = $options['cluster-identifier'];
$appId = $options['appid'];
$dryRun = (isset( $options["dry-run"] )) ? true : false;

$clusterMapping = eZINI::instance( 'merck.ini' )->variable('ClusterSettings', 'CountryMapping');
if (!array_key_exists($countryCode, $clusterMapping))
{
    $cli->error('No cluster mapping is defined in merck.ini for country-code ' . $countryCode);
    $script->shutdown(1);
}
$clusterIdentifier = $clusterMapping[$countryCode];

$application = ApplicationObject::fetchObject(ApplicationObject::definition(), null, array('id' => $appId));
if ($application == null || $application instanceof ApplicationObject == false)
{
    $cli->error("Application with id {$appId} doesn't exist.");
    $script->shutdown(1);
}
$applicationIdentifier = $application->identifier;

$questionCli = new QuestionInteractiveCli();
$replies = array(
    'N' => 'N',
    'Y' => 'Y'
);
$response = $questionCli->askQuestion( "Are you sure you want to remove application {$application->identifier} for country {$countryCode}", $replies);
if ($response == 'N')
{
    public function buildApplication()
    {
        $conditions = array(
            'id' => $this->attribute('application_id'),
        );

        $this->applicationObject = ApplicationObject::fetchObject(
            ApplicationObject::definition(),
            null,
            $conditions
        );
    }