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
var instance = new req.module.model(req.body); | |
if(typeof instance === "object" && !req.eventLogged) { | |
req.eventLogged = true; | |
socket.send('newActivity', {'instance' : instance, 'req': req, 'res' :res}); | |
} |
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 saveWithEmbededDocuments() { | |
$this->setContacts($this->makeCollection(self::$contactKeys, 'contacts', 'value')); | |
$this->setFinancials($this->makeCollection(self::$financialKeys, 'financials', 'floValue')); | |
if(!$this->save()) { | |
return false; | |
} | |
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
var account_controller = Object.create(global.Crud, | |
{ | |
/** | |
* Overload the create method | |
*/ | |
'create': function(req,res){ | |
Crud.create(req,res,function(instance) { | |
if(typeof instance == "object") | |
socket.send('newActivity', {'instance' : instance, 'req': req, 'res' :res}); | |
}); |
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 getContactByKey($key) { | |
$collection = null; | |
if($this->getContact()){ | |
$collection = $this->getContact()->filter(function($element) use($key) {return ($element->getKey() === $key) ? $element : null;}); | |
if($collection->current()) | |
return $collection->current()->getValue(); | |
} | |
return null; |
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
var should = require('should'), | |
symbleApi = require('./lib/symbleApi.js'); | |
var BaseTest = { | |
_error:null, | |
_response:null, | |
_body:null, | |
_json:null, |
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
<script> | |
var test = { | |
idAccount:121, | |
idTier:1, | |
update:function(req,res){ | |
if(typeof(this.idAccount) != 'undefined') { |
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
print_r($company); | |
Entity\Company Object | |
( | |
[attributes:protected] => Array | |
( | |
[_id] => 4ff2ae675211d54012000142 | |
[comments] => test | |
[createdAt] => DateTime Object |
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
"contact": { | |
"0": { | |
"createdAt": ISODate("2012-07-02T14: 42: 02.924Z"), | |
"updatedAt": ISODate("2012-07-02T14: 42: 02.924Z"), | |
"key": "directTelephoneNumber", | |
"value": "01252876850", | |
"_id": ObjectId("4ff1b33a37b48fac6b0001bb") | |
} | |
}, |
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
{ | |
"name": "Baring Asset Management", | |
"phone": "0987654321", | |
"quaterOneRevenue": "1000", | |
"yearToDateRevenue": "200000" | |
}, |
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 | |
//Define our bitmask | |
define("allowEverythingBitmask",1); //In binary 0001 | |
//Our user | |
class User { | |
private $permissionBitmask = 1; //In binary 0001 | |
public function setPermissionBitmask($bitmask) | |
{ | |
$this->permissionBitmask = $bitmask; |