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 | |
public function prePersist($transaction) | |
{ | |
$this->preUpdate($transaction); | |
} | |
public function preUpdate($transaction) | |
{ | |
$transaction->setEntries($transaction->getEntry()); |
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
In this case, I want all table with the prefix 'acct'. This is for some accounting tables. I believe step 1 could use some optimizing but it works for me. | |
## Link to Stackoverflow question: | |
## http://stackoverflow.com/questions/22480849/symfony-generating-specific-entities-from-the-database/22481132#22481132 | |
Step 1 -- convert mapping from the database [notice the --filter command] : | |
php app/console doctrine:mapping:convert annotation src/App/MyBundle/Resources/config/doctrine --em=default --from-database --filter="table_name" |
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 | |
// 1-number GenerateCreditCardUtility::credit_card_number('visa'); | |
// many-numbers GenerateCreditCardUtility::credit_card_numbers('visa',15,10); | |
class GenerateCreditCardUtility{ | |
private $PrefixList = []; |