protected function execute($arguments = array(), $options = array()) { // initialize the database connection $databaseManager = new sfDatabaseManager($this->configuration); $connection = $databaseManager->getDatabase($options['connection'])->getConnection(); // add your code here // instantiate a parser object $parse = new Contact_Vcard_Parse(); // parse it $data = $parse->fromFile(sfConfig::get('sf_upload_dir') . DIRECTORY_SEPARATOR . 'contacts.vcf'); // output results $contact_collection = new Doctrine_Collection('contact'); $company_collection = new Doctrine_Collection('company'); foreach ($data as $contact) { print_r($contact); $vcard = new vcard($contact); if ($vcard->isCompany()) { // it's a company // $db_contact = new Company(); // $db_contact->merge($vcard->getCompanyData()); // $company_collection->add($db_contact); print_r($vcard->getCompanyData()); } else { // it's a contact // $db_contact = new Contact(); // $db_contact->merge($vcard->getContactData()); // $contact_collection->add($db_contact); print_r($vcard->getContactData()); } } // $company_collection->save(); // $contact_collection->save(); }