Last active
August 29, 2015 13:57
-
-
Save vasildakov-zz/9786091 to your computer and use it in GitHub Desktop.
add a conversion object to doctrine collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ConversionController extends Controller { | |
public function create() | |
{ | |
$dc = new Doctrine_Collection('Conversion'); | |
if ($dc instanceof Doctrine_Collection) { | |
for($i =0; $i < 10; $i++) { | |
$record = new Conversion(); | |
$record->setType(ConversionTable::TYPE_CPA); | |
$record->setSite($siteId); | |
$record->setCampaign($campaignId); | |
$record->setDate($date); | |
$record->setStatus(ConversionTable::STATUS_ONHOLD); | |
$dc->add($record); | |
} | |
} | |
$options = array('campaign' => $campaignId, 'site' => $siteId, 'type' => $type, 'date' => $date); | |
$builder = new ConversionCollectionBuilder($dc); | |
$builder->build($options); | |
$collection = $builder->getCollection(); | |
#$collection->save(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment