examples/ProjectRepository.php
protected function beforeCreate($project, $attributes)
    {
        // each project has an owner (a user). let's make sure that the project
        // owner is an active user - if not, add an error and return false. we
        // assume that project->owner is always populated.
        if (!$project->owner->is_active) {
            $this->errors->add('owner', 'Project owner must be an active user.');
            return false;
        }

        return true;
    }
protected function beforeCreate($project, $attributes)
    {
        // each project has an owner (a user). let's make sure that the project
        // owner is an active user - if not, add an error and return false. we
        // assume that project->owner is always populated.
        if (!$project->owner->is_active) {
            $this->errors->add('owner', 'Project owner must be an active user.');
            return false;
        }

        return true;
    }
Determines if a model can be stored to the database or not. Use it for
stuff that can't (easily) be done by the validator.

Changed from readyForCreate in 0.5