This file contains hidden or 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 | |
namespace Hautelook\ApiBundle\Entity; | |
/** | |
* Hautelook\MainBundle\Entity\HalResource | |
* This interface should be implemented by all entities that are used in a Hal enabled JSON response. | |
* It standardizes the way to specify the resource rel and the links that should be added to the entities. | |
* | |
* @author Baldur Rensch <[email protected]> |
This file contains hidden or 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 | |
namespace Acme\DV2Bundle\Model; | |
use Acme\DV2Bundle\Exception\UnsupportedCreditCardTypeException; | |
use Acme\DV2Bundle\Exception\UnknownCreditCardTypeException; | |
/** | |
* Acme\DV2Bundle\Entity\CreditCard | |
*/ |
This file contains hidden or 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 | |
namespace Acme\DV2Bundle\Tests\Model; | |
use Acme\DV2Bundle\Model\CreditCard; | |
class CreditCardTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testMod10() | |
{ |
This file contains hidden or 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
Acme\DV2Bundle\Model\CreditCard: | |
properties: | |
creditCardNumber: | |
- NotBlank: { groups: [flow_checkoutForm_step2]} | |
- MinLength: {limit: 15, groups: [flow_checkoutForm_step2]} | |
- MaxLength: {limit: 16, groups: [flow_checkoutForm_step2]} | |
creditCardCVV: | |
- NotBlank: { groups: [flow_checkoutForm_step2]} | |
- Regex: { pattern: "/^\d{3,4}$/", message: "Invalid CVV code", groups: [flow_checkoutForm_step2] } | |
getters: |
This file contains hidden or 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
{% form_theme form 'AcmeBundle:Default:designFormDesignOptionsTemplate.html.twig' %} | |
<fieldset> | |
<legend>Options</legend> | |
{{ form_errors(form.designOptions) }} | |
{{ form_widget(form.designOptions) }} | |
</fieldset> |
This file contains hidden or 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
{% block choice_widget %} | |
{% spaceless %} | |
<div class="control-group"> | |
{% for child in form %} | |
{{ form_label(child) }} | |
{{ form_widget(child) }}</label> | |
{% endfor %} | |
</div> |
This file contains hidden or 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
public function set(array $params) | |
{ | |
foreach ($params as $key => $value) { | |
$this->$key = $value; | |
} | |
} |
This file contains hidden or 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 | |
// Of course you also need your Doctrine Annotations | |
class Example | |
{ | |
protected $firstName; | |
protected $lastName; | |
protected $username; | |
public function setFirstName($firstName) |
This file contains hidden or 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 | |
/** | |
* This function computes a hash of an integer. This can be used to not expose values to a customer, such as | |
* not giving them the id value for passing them to URLs. This algorithm is a bidirectional encryption (Feistel cipher) that maps | |
* the integer space onto itself. | |
* | |
* @link http://wiki.postgresql.org/wiki/Pseudo_encrypt Algorithm used | |
* @link http://en.wikipedia.org/wiki/Feistel_cipher Wikipedia page about Feistel ciphers | |
* @param int $value |
This file contains hidden or 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 | |
require_once dirname(__DIR__).'/../../../../app/AppKernel.php'; | |
/** | |
* Test case class helpful with Entity tests requiring the database interaction. | |
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead. | |
*/ | |
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase | |
{ |
OlderNewer