Skip to content

Instantly share code, notes, and snippets.

View oojacoboo's full-sized avatar

Jacob Thomason oojacoboo

View GitHub Profile
this.parseUnits = function() {
if(this.jsonResultsReady === false) return;
if(this.currentResult && this.nResults)
if(this.currentResult >= this.nResults) return;
//for pager:
var showStart = this.currentResult + 1,
showEnd = this.currentResult + itemsPerResponse;
/**
* Returns back true/false for a given permission or the raw value if not 1/0 bool
* @param string $name
* @return mixed
*/
public function getPermission($name) {
$companyId = $this->getId();
$planId = $this->getPlan()->getId();
$con = Propel::getConnection();
SELECT (
(
SELECT cp.value
FROM company_permission cp
LEFT JOIN default_permission dp
ON cp.default_permission_id = dp.id
WHERE cp.company_id = :companyId
AND dp.name = :permissionName
AND cp.value IS NOT NULL
)
/**
* Returns back true/false for a given permission or the raw value if not 1/0 bool
* @param string $name
* @return mixed
*/
public function getPermission($name) {
$companyId = $this->getId();
$planId = $this->getPlan()->getId();
$con = Propel::getConnection();
/**
* Returns back the value for the setting name passed
* @param string $name
* @return mixed
*/
public function getSetting($name) {
$companyId = $this->getId();
$planId = $this->getPlanId();
$con = Propel::getConnection();
/**
* Builds the SELECT part of a SQL statement based on a Criteria
* taking into account select columns and 'as' columns (i.e. columns aliases)
* Move from BasePeer to DBAdapter and turn from static to non static
*
* @param Criteria $criteria
* @param array $fromClause
* @param boolean $aliasAll
*
* @return string
##################
# Function: is_faq
# Inputs:
# page - optional english file name
# Returns: boolean
# Note:
# This function returns true if the current page or the page argument is a faq page
# false otherwise
private function is_faq($page = FALSE){
# return early if we know we are on a faq page
/**
* Global function for returning back an array from a function with possible error string
* @param string $error
* @return array
*/
function returnError($error = "Error performing this operation") {
return array("success" => false, "error" => $error);
}
/**
* Convert date/time to user's timezone
*
* @access public
* @param mixed $dateTime
* @param string $format
* @return string
*/
public function toUserTimezone($dateTime, $format) {
//validate date/time value
[xdebug]
zend_extension="/usr/local/Cellar/php54-xdebug/2.2.1/xdebug.so"
xdebug.idekey = "macgdbp"
xdebug.remote_enable = 0
;xdebug.file_link_format="txmt://open?url=file://%f&line=%1"
;xdebug.remote_autostart = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.cli_color = 1