src/Dca/DcaUtil.php
public function setDateAdded(DataContainer $dc)
    {
        $modelUtil = $this->container->get('huh.utils.model');

        if (null === $dc || null === ($model = $modelUtil->findModelInstanceByPk($dc->table, $dc->id)) || $model->dateAdded > 0) {
            return null;
        }

        $this->framework->createInstance(Database::class)->prepare("UPDATE $dc->table SET dateAdded=? WHERE id=? AND dateAdded = 0")->execute(time(), $dc->id);
    }
public function setDateAdded(DataContainer $dc)
    {
        $modelUtil = $this->container->get('huh.utils.model');

        if (null === $dc || null === ($model = $modelUtil->findModelInstanceByPk($dc->table, $dc->id)) || $model->dateAdded > 0) {
            return null;
        }

        $this->framework->createInstance(Database::class)->prepare("UPDATE $dc->table SET dateAdded=? WHERE id=? AND dateAdded = 0")->execute(time(), $dc->id);
    }
public function setDateAdded ( DataContainer $ dc ) { $ modelUtil = $ this -> container -> get ( 'huh.utils.model' ) ; if ( null === $ dc || null === ( $ model = $ modelUtil -> findModelInstanceByPk ( $ dc -> table , $ dc -> id ) ) || $ model -> dateAdded > 0 ) { return null ; } $ this -> framework -> createInstance ( Database :: class ) -> prepare ( "UPDATE $dc->table SET dateAdded=? WHERE id=? AND dateAdded = 0" ) -> execute ( time ( ) , $ dc -> id ) ; }
Sets the current date as the date added -> usually used on submit.

@param DataContainer $dc
Sets the current date as the date added - > usually used on submit .