public function onBeforeWrite()
    {
        if (!$this->Sort) {
            $this->Sort = DB::query('SELECT MAX("Sort") + 1 FROM "WorkflowDefinition"')->value();
        }
        if (!$this->ID && !$this->Title) {
            $this->Title = $this->getDefaultWorkflowTitle();
        }

        parent::onBeforeWrite();
    }
public function onBeforeWrite()
    {
        if (!$this->Sort) {
            $this->Sort = DB::query('SELECT MAX("Sort") + 1 FROM "WorkflowDefinition"')->value();
        }
        if (!$this->ID && !$this->Title) {
            $this->Title = $this->getDefaultWorkflowTitle();
        }

        parent::onBeforeWrite();
    }
public function onBeforeWrite ( ) { if ( ! $ this -> Sort ) { $ this -> Sort = DB :: query ( 'SELECT MAX("Sort") + 1 FROM "WorkflowDefinition"' ) -> value ( ) ; } if ( ! $ this -> ID && ! $ this -> Title ) { $ this -> Title = $ this -> getDefaultWorkflowTitle ( ) ; } parent :: onBeforeWrite ( ) ; }
Ensure a sort value is set and we get a useable initial workflow title.
Ensure a sort value is set and we get a useable initial workflow title .