<commit_before><?php
/**
 * This file is part of Vegas package
 *
 * @author <NAME> <<EMAIL>>
 * @copyright Amsterdam Standard Sp. Z o.o.
 * @homepage http://vegas-cmf.github.io
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
 
namespace Vegas\Db\Decorator;

use Vegas\Db\Decorator\Helper\MappingHelperTrait;
use Vegas\Db\Decorator\Helper\SlugTrait;
use Vegas\Db\Decorator\Helper\WriteAttributesTrait;
use Vegas\Db\MappingResolverTrait;

/**
 * Class ModelAbstract
 * @package Vegas\Db\Decorator
 */
abstract class ModelAbstract extends \Phalcon\Mvc\Model
{
    use MappingResolverTrait;
    use MappingHelperTrait;
    use SlugTrait;
    use WriteAttributesTrait;

    /**
     *
     */
    public function beforeCreate()
    {
        $this->created_at = time();
    }

    /**
     *
     */
    public function beforeUpdate()
    {
        $this->updated_at = time();
    }
} <commit_msg>Added findById to ModelAbstract<commit_after><?php
/**
 * This file is part of Vegas package
 *
 * @author <NAME> <<EMAIL>>
 * @copyright Amsterdam Standard Sp. Z o.o.
 * @homepage http://vegas-cmf.github.io
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
 
namespace Vegas\Db\Decorator;

use Vegas\Db\Decorator\Helper\MappingHelperTrait;
use Vegas\Db\Decorator\Helper\SlugTrait;
use Vegas\Db\Decorator\Helper\WriteAttributesTrait;
use Vegas\Db\MappingResolverTrait;

/**
 * Class ModelAbstract
 * @package Vegas\Db\Decorator
 */
abstract class ModelAbstract extends \Phalcon\Mvc\Model
{
    use MappingResolverTrait;
    use MappingHelperTrait;
    use SlugTrait;
    use WriteAttributesTrait;

    /**
     * Sets time of create
     */
    public function beforeCreate()
    {
        $this->created_at = time();
    }

    /**
     * Sets time of update
     */
    public function beforeUpdate()
    {
        $this->updated_at = time();
    }

    /**
     * Finds record by its ID
     *
     * @param $id
     * @return \Phalcon\Mvc\Model\ResultsetInterface
     */
    public function findById($id)
    {
        return parent::find(array('id' => $id));
    }
} 
{'fraction_non_alphanumeric': 0.11493738819320215, 'fraction_numerical': 0.0, 'mean_word_length': 2.843642611683849, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6627068', 'n_tokens_mistral': 702, 'n_tokens_neox': 699, 'n_words': 176}