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
object Calculator extends App { | |
def multiply(a:Int, b:Int) = a * b | |
def minus(a:Int, b:Int) = a - b | |
def add(a:Int, b:Int) = a + b | |
def divide(a:Int, b:Int) = a / b |
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 | |
/* -- Meta Methods -- | |
NewIndex - When a new index is added | |
Modify - When an element is changed | |
Isset - When isset() is ran on a value | |
Unset - When unset() is ran | |
Index - When an element is requested that does not exist | |
Count - When count() is ran. This will exclude MetaMethods when counting elements | |
*/ |
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 Group { | |
public static function create($name, $permissions = array()){ | |
//Creates a permissions group | |
if(strlen($name) > 0){ | |
$insert = DB::getInstance()->table("groups")->insert(array( | |
'name' => $name, | |
'permissions' => json_encode($permissions) | |
)); | |
if($insert){ |