ActiveRecord.php
public function duplicate() {
        $this->isNewRecord = true;

        foreach ($this->primaryKey() as $key) {
                    $this->$key = null;
        }

        if ($this->save()) {
            return $this;
        }
        return null;
    }
public function duplicate() {
        $this->isNewRecord = true;

        foreach ($this->primaryKey() as $key) {
                    $this->$key = null;
        }

        if ($this->save()) {
            return $this;
        }
        return null;
    }
public function duplicate ( ) { $ this -> isNewRecord = true ; foreach ( $ this -> primaryKey ( ) as $ key ) { $ this -> $ key = null ; } if ( $ this -> save ( ) ) { return $ this ; } return null ; }
Duplicate entries in the table.
@return $this|null
Duplicate entries in the table .