CommonDBTM::canCreateItem PHP Method

canCreateItem() public method

Default is true and check entity if the objet is entity assign May be overloaded if needed
public canCreateItem ( ) : booleen
return booleen
    function canCreateItem()
    {
        if (!$this->checkEntity()) {
            return false;
        }
        return true;
    }

Usage Example

Exemplo n.º 1
0
 function canCreateItem()
 {
     // From Ticket Document Tab => check right to add followup.
     if (isset($this->fields['tickets_id']) && $this->fields['tickets_id'] > 0) {
         $ticket = new Ticket();
         if ($ticket->getFromDB($this->fields['tickets_id'])) {
             return $ticket->canAddFollowups();
         }
     }
     if (Session::haveRight('document', 'w')) {
         return parent::canCreateItem();
     }
     return false;
 }
All Usage Examples Of CommonDBTM::canCreateItem
CommonDBTM