civicrm_entity.inc in CiviCRM Entity 7.2
File
civicrm_entity.inc
View source
<?php
class CivicrmEntity extends Entity {
public function __construct(array $values = array(), $entityType = NULL) {
if (empty($entityType)) {
throw new Exception('Cannot create an instance of Entity without a specified entity type.');
}
$this->entityType = $entityType;
$this
->setUp();
foreach ($values as $key => $value) {
if (stristr($key, "\0")) {
continue;
}
$this->{$key} = $value;
}
}
protected function defaultLabel() {
return $this->title;
}
protected function defaultUri() {
return array(
'path' => 'task/' . $this
->identifier(),
);
}
}