code/database/behavior/identifiable.php
protected function _afterSelect(DatabaseContext $context)
    {
        if($this->getMixer() instanceof DatabaseRowInterface && $this->_auto_generate && !$this->isNew())
        {
            if($this->hasProperty('uuid') && empty($this->uuid))
            {
                $hex = $this->getTable()->getColumn('uuid')->type == 'char' ? false : true;
                $this->uuid = $this->_uuid($hex);

                $this->save();
            }
        }
    }
protected function _afterSelect(DatabaseContext $context)
    {
        if($this->getMixer() instanceof DatabaseRowInterface && $this->_auto_generate && !$this->isNew())
        {
            if($this->hasProperty('uuid') && empty($this->uuid))
            {
                $hex = $this->getTable()->getColumn('uuid')->type == 'char' ? false : true;
                $this->uuid = $this->_uuid($hex);

                $this->save();
            }
        }
    }
protected function _afterSelect ( DatabaseContext $ context ) { if ( $ this -> getMixer ( ) instanceof DatabaseRowInterface && $ this -> _auto_generate && ! $ this -> isNew ( ) ) { if ( $ this -> hasProperty ( 'uuid' ) && empty ( $ this -> uuid ) ) { $ hex = $ this -> getTable ( ) -> getColumn ( 'uuid' ) -> type == 'char' ? false : true ; $ this -> uuid = $ this -> _uuid ( $ hex ) ; $ this -> save ( ) ; } } }
Auto generated the uuid

If the row exists and does not have a valid 'uuid' value auto generate it.

Requires an 'uuid' column, if the column type is char the uuid will be a string, if the column type is binary a
hex value will be returned.

@param DatabaseContext	$context A database context object
@return void
Auto generated the uuid