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
// Baseline Settings | |
$baseline: 7px; | |
$baseline-x2: $baseline * 2; | |
$baseline-x3: $baseline * 3; | |
$baseline-x4: $baseline * 4; | |
$baseline-x5: $baseline * 5; | |
$baseline-x6: $baseline * 6; | |
$baseline-x7: $baseline * 7; | |
$baseline-x8: $baseline * 8; |
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 | |
... | |
$download = $request->getVar("download") ? true : false; | |
if ($download) { | |
// Get the the product file path,name,type, and size | |
$productFile = $product->FullUpload()->getAbsoluteURL(); | |
$productFileName = $product->FullUpload()->getFilename(); | |
$productFileType = $product->FullUpload()->getMimeType(); | |
$productFileSize = $product->FullUpload()->getAbsoluteSize(); | |
// Update the HTTPResponse object with the proper download headers |
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 static function generateUniqueID($uniqueID) | |
{ | |
// Get the products ID and ID length and store them | |
$prefix = $uniqueID."-"; | |
$prefixLength = strlen($prefix); | |
// Generate a unique identifier approximatly 23 characters long | |
// and remove any periods | |
$identifier = uniqid("", true); |
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 Person { | |
protected $name; | |
protected $age; | |
public function __construct($name, $age){ | |
$this->name = $name; | |
$this->age = $age; |
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 | |
namespace Sitelease\PaypalAutoSeller\Extensions; | |
use SilverStripe\ORM\DataExtension; | |
use SilverStripe\ORM\ArrayList; | |
use SilverStripe\View\ArrayData; | |
use Sitelease\PaypalAutoSeller\Model\PrivateProduct; |
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 | |
// ... | |
/** | |
* Save handler | |
* | |
* @param array $data | |
* @param Form $form | |
* @return HTTPResponse |
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 | |
/** | |
* Description | |
* | |
* @package silverstripe | |
* @subpackage mysite | |
*/ | |
class MealCategory extends DataObject | |
{ | |
/** |
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
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing "snip" and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |
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 CustomDataObject extends DataObject implements PermissionProvider | |
{ | |
static $api_access = true; | |
static $permissionsSuffix = "CUSTOMDATAOBJECT"; // Permission code will be ACTION_SUFFIX | |
static $permissionsDescriptor = "Custom"; | |
static $permissionsCategory = 'Custom Object'; | |
static $permissionsActionsArray = array('view','edit','delete','create'); |