PHP code example of sibset / aop-feature-bundle

1. Go to this page and download the library: Download sibset/aop-feature-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sibset / aop-feature-bundle example snippets




use SibSet\Bundle\AopFeatureBundle\Annotation as Aspect;

/**
 * @Aspect\Logging("log.message.writer.user.create")
 */
public function createUser(User $user)
{
    // ...
}



use SibSet\Bundle\AopFeatureBundle\Annotation as Aspect;

/**
 * @Aspect\Transactional
 */
public function createUser(User $user)
{
    $this->getManager()->persist($user);
    $this->getManager()->flush($user);
}



use SibSet\Bundle\AopFeatureBundle\Annotation as Aspect;

/**
 * @Aspect\SuppressException
 */
public function createUser(User $user)
{
    throw new \Exception("All is dust!");
}


public function registerBundles()
{
    $bundles = array(
        // ...
        new JMS\AopBundle\JMSAopBundle(),
        new SibSet\Bundle\SibSetAopBundle(),
    );

    // ...

    return $bundles;
}