Skip to content

Instantly share code, notes, and snippets.

View justinpfister's full-sized avatar
💭
ecommerce development - nodejs scripts, php, magento 2, sql

Justin Pfister justinpfister

💭
ecommerce development - nodejs scripts, php, magento 2, sql
View GitHub Profile
<?php
public function prePersist($transaction)
{
$this->preUpdate($transaction);
}
public function preUpdate($transaction)
{
$transaction->setEntries($transaction->getEntry());
@justinpfister
justinpfister / gist:9621544
Last active August 29, 2015 13:57
Create Entities for Specific Tables in Symfony2
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"
@justinpfister
justinpfister / GenerateCreditCardUtility.php
Last active December 14, 2015 14:29
PHP Generate CreditCard numbers
<?php
// 1-number GenerateCreditCardUtility::credit_card_number('visa');
// many-numbers GenerateCreditCardUtility::credit_card_numbers('visa',15,10);
class GenerateCreditCardUtility{
private $PrefixList = [];