Skip to content

Instantly share code, notes, and snippets.

@AstDerek
Created February 17, 2013 04:40
Show Gist options
  • Save AstDerek/4970210 to your computer and use it in GitHub Desktop.
Save AstDerek/4970210 to your computer and use it in GitHub Desktop.
<?php
// No model, but ORM
if ($assessment->startdate > $now || $assessment->enddate < $now)) {
// Assessment is expired
}
// Model and ORM, example
if ($assessment->expired_at_date($now)) {
// Assessment is expired
}
/**
* Example on how to insert new values into the DB using Active Record
*/
$new_assessment = new Assessment;
$new_assessment->some_property = 'some value';
$new_assessment->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment