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

Parameters:
boolean $value

Definition at line 57 of file OwnedSecurableItem.php.

constructDerived ( bean,
setDefaults 
) [protected]
Parameters:
RedBean_OODBBean $bean
bool $setDefaults
Exceptions:
NoCurrentUserSecurityException 

Reimplemented from CustomFieldsModel.

Reimplemented in Task.

Definition at line 68 of file OwnedSecurableItem.php.

getActualPermissions ( permitable = null  ) 
Parameters:
null|Permitable $permitable
Returns:
array
Exceptions:
NoCurrentUserSecurityException 

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.

Parameters:
User $user

Definition at line 159 of file OwnedSecurableItem.php.

__set ( attributeName,
value 
)

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');
   $account->save();
Parameters:
$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.

Returns:
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.

Parameters:
string $tableName
RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter
null|int $offset
null|int $count
null|string $where
null|string $orderBy
bool $selectCount
bool $selectDistinct
array $quotedExtraSelectColumnNameAndAliases
Returns:
string
Exceptions:
NoCurrentUserSecurityException 

Reimplemented from RedBeanModel.

Definition at line 282 of file OwnedSecurableItem.php.

static resolveReadPermissionsOptimizationToSqlQuery ( User user,
RedBeanModelJoinTablesQueryAdapter joinTablesAdapter,
&$  where,
&$  selectDistinct 
) [static]
Parameters:
User $user
RedBeanModelJoinTablesQueryAdapter $joinTablesAdapter
$where 
$selectDistinct 
Exceptions:
NotSupportedException 

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

Returns:
bool

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 Sat Apr 29 07:10:27 2017