\Ceo\Core\TraitsPushable

The Pushable provides a simple mechanic for pushing an item into the web socket server's pusher.

Summary

Methods
Properties
Constants
setPushableOptions()
pushToSocket()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

setPushableOptions()

setPushableOptions(array  $opts = array()) 

Set default pushable options for model, uses an array with the keys

  • category - string socket category user is subscribed to
  • related - array of related properties to include when serializing

Example:

class Content extends BaseModel
{
   use Pushable;
   ...
   $this->setPushableOptions([
      'category' => 'contentupdate',
      'related' => [
          'export',
          'authors',
          'tags',
          'assignment',
          'attachment',
          'audit',
          'export',
          'dominantAttachment'
      ]
  ]
}

Parameters

array $opts

pushToSocket()

pushToSocket(array  $kwargs = array()) 

Push the model to the web socket server via the queue service Options are set as keyword arguments in the form of <ul> <li>category - (string) supplemental category</li> <li>options - (array) override options, see setPushableOptions for more info</li> </ul>

Parameters

array $kwargs