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 Product\Criteria; | |
use Doctrine\Common\Collections\Criteria; | |
/** | |
* Order the units by the last modified one | |
* | |
* @author Fábio Carneiro <[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
<script> | |
function retrieveUf(latitude,longitude){ | |
var request = new XMLHttpRequest(); | |
var method = 'GET'; | |
var url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='+latitude+','+longitude+'&sensor=true'; | |
var async = true; | |
request.open(method, url, async); | |
request.send(); |
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 | |
class Router { | |
protected $routes = array(); | |
protected $namedRoutes = array(); | |
protected $basePath = ''; | |
protected $matchTypes = array( | |
'i' => '[0-9]++', | |
'a' => '[0-9A-Za-z]++', |
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 extract() | |
{ | |
if ($this->object instanceof Traversable) { | |
$this->object = ArrayUtils::iteratorToArray($this->object, false); | |
} | |
if (!is_array($this->object)) { | |
return array(); | |
} |
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 | |
public function addAction() | |
{ | |
$album = new Album; | |
$form = new AlbumForm($this->getEntityManager()); | |
$form->setHydrator(new DoctrineEntity($this->getEntityManager(),'Admin\Entity\Album')); |
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
-- element -- | |
string 'Cart\Form\ProductFieldset' (length=25) | |
-- object -- | |
object(Product\Entity\Product)[539] | |
protected 'id' => int 31 | |
protected 'sku' => string 'PH043' (length=5) | |
protected 'name' => string 'FONE COM MICROFONE USB DIGITAL PC / PLAYSTATION 3' (length=49) | |
protected 'slug' => string 'fone-com-microfone-usb-digital-pc-playstation-3' (length=47) | |
-- hydrator target class -- | |
string 'Product\Entity\Product' (length=22) |
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 | |
use Zend\Form\Fieldset; | |
use Zend\Form\Form; | |
use Zend\Form\View\Helper\Form as FormHelper; | |
use Zend\Form\View\HelperConfig; | |
use Zend\Stdlib\ArrayUtils; | |
use Zend\Stdlib\Hydrator\ObjectProperty; | |
use Zend\View\Renderer\PhpRenderer; |
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 Cart; | |
use Zend\Mvc\ModuleRouteListener; | |
use Zend\Mvc\MvcEvent; | |
class Module | |
{ | |
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
class cart { | |
public $item; | |
public function getItem() { | |
return $this->item; | |
} | |
public function setItem(&$item) { | |
$this->item = $item; | |
} |
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 getFreightForm() { | |
$form = new Form(); | |
$items = $this->session->offsetGet('list'); | |
foreach ($items as $i => $consumer) { | |
$fieldset = new Fieldset($i); | |
foreach ($consumer->getItems() as $token => $item) { | |
$fieldset->add(array( | |
'type' => 'text', |