src/Syncer/AbstractSyncer.php
protected function getLocalCustomer($stripeCustomerId)
    {
        // First try to get the customer from the database
        $localCustomer = $this->getEntityManager()->getRepository('SHQStripeBundle:StripeLocalCustomer')->findOneByStripeId($stripeCustomerId);

        // If we found it, return it
        if (null !== $localCustomer) {
            return $localCustomer;
        }

        // Try to find the customer in the newly created one that are not already persisted
        return $this->getEntityManager()->getUnitOfWork()->tryGetById($stripeCustomerId, StripeLocalCustomer::class);
    }
protected function getLocalCustomer($stripeCustomerId)
    {
        // First try to get the customer from the database
        $localCustomer = $this->getEntityManager()->getRepository('SHQStripeBundle:StripeLocalCustomer')->findOneByStripeId($stripeCustomerId);

        // If we found it, return it
        if (null !== $localCustomer) {
            return $localCustomer;
        }

        // Try to find the customer in the newly created one that are not already persisted
        return $this->getEntityManager()->getUnitOfWork()->tryGetById($stripeCustomerId, StripeLocalCustomer::class);
    }
protected function getLocalCustomer ( $ stripeCustomerId ) { // First try to get the customer from the database $ localCustomer = $ this -> getEntityManager ( ) -> getRepository ( 'SHQStripeBundle:StripeLocalCustomer' ) -> findOneByStripeId ( $ stripeCustomerId ) ; // If we found it, return it if ( null !== $ localCustomer ) { return $ localCustomer ; } // Try to find the customer in the newly created one that are not already persisted return $ this -> getEntityManager ( ) -> getUnitOfWork ( ) -> tryGetById ( $ stripeCustomerId , StripeLocalCustomer :: class ) ; }
Gets the local customer object searching for it in the database or in the newly created entities persisted but
not yet flushed.

@param $stripeCustomerId

@return bool|StripeLocalCustomer false if the StripeLocalCustomer was not found
Gets the local customer object searching for it in the database or in the newly created entities persisted but not yet flushed .