OwnedSecurableItem Class Reference

Inheritance diagram for OwnedSecurableItem:
SecurableItem Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent Account Activity ApiTestModelItem ApiTestModelItem2 ApiTestModelItem3 ApiTestModelItem4 Campaign ContactWebForm Conversation Dashboard EmailMessage EmailTemplate EmailTemplateModelTestItem ExportItem ExportTestModelItem ExportTestModelItem2 ExportTestModelItem3 ExportTestModelItem4 ExportTestModelItem5 GameReward ImportDedupeModelTestItem ImportModelTestItem ImportModelTestItem2 ImportModelTestItem3 ImportModelTestItem4 ImportModelTestItem5 MarketingList Mission ModelToArrayAdapterTestItem ModelToArrayAdapterTestItem2 ModelToArrayAdapterTestItem3 ModelToArrayAdapterTestItem4 Opportunity OwnedSecurableTestItem OwnedSecurableTestItem2 Person Product Project ReportModelTestItem ReportModelTestItem10 ReportModelTestItem2 ReportModelTestItem3 ReportModelTestItem4 ReportModelTestItem5 ReportModelTestItem6 ReportModelTestItem7 ReportModelTestItem8 ReportModelTestItem9 SavedCalendar SavedReport SavedSearch SocialItem WorkflowModelTestItem WorkflowModelTestItem2 WorkflowModelTestItem3 WorkflowModelTestItem4 WorkflowModelTestItem5 WorkflowModelTestItem6 WorkflowModelTestItem7 WorkflowModelTestItem8 WorkflowModelTestItem9

Public Member Functions

 setTreatCurrentUserAsOwnerForPermissions ($value)
 getEffectivePermissions ($permitable=null)
 getActualPermissions ($permitable=null)
 setOwnerUnrestricted (User $user)
 __set ($attributeName, $value)
 onBeforeOwnerChange (CEvent $event)
 onAfterOwnerChange (CEvent $event)
 onAfterOwnerChangeAfterSave (CEvent $event)

Static Public Member Functions

static getDefaultMetadata ()
static makeSubsetOrCountSqlQuery ($tableName, RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter=null, $offset=null, $count=null, $where=null, $orderBy=null, $selectCount=false, $selectDistinct=false, array $quotedExtraSelectColumnNameAndAliases=array())
static resolveReadPermissionsOptimizationToSqlQuery (User $user, RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter, &$where, &$selectDistinct)
static isTypeDeletable ()
static hasReadPermissionsSubscriptionOptimization ()
static supportsQueueing ()

Protected Member Functions

 constructDerived ($bean, $setDefaults)
 ownerChange ($newOwnerValue)
 afterSave ()
 beforeDelete ()

Static Protected Member Functions

static translatedAttributeLabels ($language)

Detailed Description

A securable item 'owned' by a user in the system.

Definition at line 40 of file OwnedSecurableItem.php.

Member Function Documentation

setTreatCurrentUserAsOwnerForPermissions ( value  ) 

Set when the current user needs to operate like the owner. This can be when a user is creating a new model that he/she does not own. The current user still needs to be able to set permissions for example

boolean $value

Definition at line 57 of file OwnedSecurableItem.php.

constructDerived ( bean,
) [protected]
RedBean_OODBBean $bean
bool $setDefaults

Reimplemented from CustomFieldsModel.

Reimplemented in Task.

Definition at line 68 of file OwnedSecurableItem.php.

getActualPermissions ( permitable = null  ) 
null|Permitable $permitable

Reimplemented from SecurableItem.

Definition at line 127 of file OwnedSecurableItem.php.

setOwnerUnrestricted ( User user  ) 

Used to set model's owner without all the checks and audit logs. Used in event handling code for queues.

User $user

Definition at line 159 of file OwnedSecurableItem.php.

__set ( attributeName,

Sets the members and relations of the model as if they were actual attributes of the model. For example, if Account extends RedBeanModel and its attributeNames() returns that one it has a member 'name' and a relation 'owner' they are simply accessed as:

   $account = new Account();
   $account->name = 'International Corp';
   $account->owner = User::getByUsername('bill');
$attributeName A non-empty string that is the name of a member or relation of the model.
$value A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from SecurableItem.

Reimplemented in EmailTemplate.

Definition at line 164 of file OwnedSecurableItem.php.

afterSave (  )  [protected]

Handle Permitable Attachment/Detachment after model has been saved.

Reimplemented from SecurableItem.

Reimplemented in Campaign, ExportItem, Mission, Project, and Task.

Definition at line 214 of file OwnedSecurableItem.php.

beforeDelete (  )  [protected]

This method is invoked before deleting a record. The default implementation raises the onBeforeDelete event. You may override this method to do any preparation work for record deletion. Make sure you call the parent implementation so that the event is raised properly.

boolean whether the record should be deleted. Defaults to true.

Reimplemented from RedBeanModel.

Reimplemented in Project.

Definition at line 237 of file OwnedSecurableItem.php.

static makeSubsetOrCountSqlQuery ( tableName,
RedBeanModelJoinTablesQueryAdapter joinTablesAdapter = null,
offset = null,
count = null,
where = null,
orderBy = null,
selectCount = false,
selectDistinct = false,
array $  quotedExtraSelectColumnNameAndAliases = array() 
) [static]

Override to add ReadPermissionOptimization query parts.

string $tableName
RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter
null|int $offset
null|int $count
null|string $where
null|string $orderBy
bool $selectCount
bool $selectDistinct
array $quotedExtraSelectColumnNameAndAliases

Reimplemented from RedBeanModel.

Definition at line 282 of file OwnedSecurableItem.php.

static resolveReadPermissionsOptimizationToSqlQuery ( User user,
RedBeanModelJoinTablesQueryAdapter joinTablesAdapter,
&$  where,
&$  selectDistinct 
) [static]
User $user
RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter

Definition at line 318 of file OwnedSecurableItem.php.

static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from SecurableItem.

Reimplemented in Account, Activity, ApiTestModelItem, ApiTestModelItem2, ApiTestModelItem3, ApiTestModelItem4, SavedCalendar, Campaign, Contact, ContactWebForm, Conversation, EmailMessage, EmailTemplate, EmailTemplateModelTestItem, ExportItem, ExportTestModelItem, ExportTestModelItem2, ExportTestModelItem3, ExportTestModelItem4, ExportTestModelItem5, GameReward, Dashboard, ImportDedupeModelTestItem, ImportModelTestItem, ImportModelTestItem2, ImportModelTestItem3, ImportModelTestItem4, ImportModelTestItem5, MarketingList, Meeting, Mission, Note, Opportunity, Product, Project, SavedReport, ReportModelTestItem, ReportModelTestItem10, ReportModelTestItem2, ReportModelTestItem3, ReportModelTestItem4, ReportModelTestItem5, ReportModelTestItem6, ReportModelTestItem7, ReportModelTestItem8, ReportModelTestItem9, SocialItem, Task, WorkflowModelTestItem, WorkflowModelTestItem2, WorkflowModelTestItem3, WorkflowModelTestItem4, WorkflowModelTestItem5, WorkflowModelTestItem6, WorkflowModelTestItem7, WorkflowModelTestItem8, WorkflowModelTestItem9, Person, SavedSearch, ModelToArrayAdapterTestItem, ModelToArrayAdapterTestItem2, ModelToArrayAdapterTestItem3, ModelToArrayAdapterTestItem4, and OwnedSecurableTestItem.

Definition at line 373 of file OwnedSecurableItem.php.

static hasReadPermissionsSubscriptionOptimization (  )  [static]

Should model have read permission subscription table or not. This feature is used to track of created/deleted models, so we can easily sync Zurmo with Google Apps or Outlook


Reimplemented in Account, Contact, Meeting, and Task.

Definition at line 392 of file OwnedSecurableItem.php.

static supportsQueueing (  )  [static]

Describes if the current model supports being routed through queues. This is for the Queues feature in commercial edition.

Reimplemented in Contact.

Definition at line 401 of file OwnedSecurableItem.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Fri Apr 20 07:10:25 2018