You are here

public function AccessGrantEntityController::create in Access Control Kit 7

Constructs a new grant object without saving it.

Parameters

array $values: (optional) An array of values to set, keyed by property name.

Return value

object An access grant object.

File

./access_grant_entity_controller.inc, line 22
Contains the access grant entity controller.

Class

AccessGrantEntityController
Provides the entity controller for access grants.

Code

public function create(array $values = array()) {
  $grant = new stdClass();
  $grant->gid = NULL;
  $grant->uid = empty($values['uid']) ? NULL : $values['uid'];
  $grant->rid = empty($values['rid']) ? NULL : $values['rid'];
  $grant->scheme = empty($values['scheme']) ? '' : $values['scheme'];
  return $grant;
}