This file contains 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 | |
$shipmentPackagesResponses = $verifyShipment->getPackages(); | |
$shipmentPackages = $shipment->shipment_packages; | |
foreach($shipmentPackages as $key => &$shipmentPackage){ | |
$shipmentPackage = $shipmentPackage->toArray(); | |
$shipmentPackage['tracking_code'] = $shipmentPackagesResponses[$key]->getTrackingCode(); | |
} | |
$shipment = $this->Shipments->patchEntity($shipment, ['shipment_packages' => $shipmentPackages], [ | |
'associated' => ['ShipmentPackages'] |
This file contains 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 beforeMarshal(Event $event, \ArrayObject $data, \ArrayObject $options) | |
{ | |
$entityClass = $this->getEntityClass(); | |
$propertyMap = (new $entityClass())->_map; | |
foreach($propertyMap as $new => $old){ | |
if($data->offsetExists($new)){ | |
$data->offsetSet($old, $data->offsetGet($new)); | |
$data->offsetUnset($new); |
This file contains 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 PeriodIterator implements \Iterator | |
{ | |
private $current; | |
private $period = []; | |
public function __construct(\DatePeriod $period) { | |
$this->period = $period; | |
$this->current = $this->period->getStartDate(); |
This file contains 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 BusinessDayPeriodIterator implements \Iterator | |
{ | |
private $current; | |
private $period = []; | |
public function __construct(\DatePeriod $period) { | |
$this->period = $period; | |
$this->current = $this->period->getStartDate(); | |
if(!$period->include_start_date){ |
This file contains 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 | |
$pusher = new \Pusher( | |
env('PUSHER_AUTH_KEY', null), | |
env('PUSHER_APP_SECRET', null), | |
env('PUSHER_APP_ID', null), | |
$options | |
); | |
$data['message'] = 'Order ' . $order->id . ' was updated'; | |
$pusher->trigger('order', 'updated', $data); |
This file contains 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
FROM httpd:2.4-alpine | |
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf |
This file contains 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 | |
// Calling this model OtherItem | |
// in your model initialize function for your OtherItem | |
$this->addBehavior('CounterCache', [ | |
'PrimaryItems' => [ | |
'other_items_count' | |
] | |
]); | |
$this->hasMany('OtherItems', [ |
This file contains 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
<div className="d-flex w-100 justify-content-between"> | |
<span>{order.id} - {order.size_description}</span> | |
<small>{order.total_qty} labels</small> | |
<small>{order.design_qty} designs</small> | |
{((order) => { | |
if(order.is_shipping_blind){ | |
return ( | |
<span className="badge badge-warning">Shipping Blind</span> | |
) | |
} |
This file contains 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
<IfModule mod_fastcgi.c> | |
AddType application/x-httpd-fastphp5 .php | |
Action application/x-httpd-fastphp5 /php5-fcgi | |
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi | |
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization | |
<Directory /usr/lib/cgi-bin> | |
Require all granted | |
</Directory> | |
</IfModule> |
This file contains 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
ready(function(){ | |
/** | |
* Discover any fancy slideshows that exist on the page | |
*/ | |
function fancySlideshows () { | |
this.discover = function () { | |
var slideshows = document.querySelectorAll('.fancy-slideshow'); | |
if (slideshows.length > 0 ){ | |
slideshows.forEach(function(s){ |