<commit_before><?php
/**
 *  \details &copy; 2011  Open Ximdex Evolution SL [http://www.ximdex.org]
 *
 *  Ximdex a Semantic Content Management System (CMS)
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published
 *  by the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  See the Affero GNU General Public License for more details.
 *  You should have received a copy of the Affero GNU General Public License
 *  version 3 along with Ximdex (see LICENSE file).
 *
 *  If not, visit http://gnu.org/licenses/agpl-3.0.html.
 *
 * @author <NAME> <<EMAIL>>
 * @version $Revision$
 */


namespace Ximdex\Models;

use I_PipeTransitions;
use Ximdex\Models\ORM\PipeProcessOrm;
use Ximdex\Logger as XMD_Log ;


require_once(XIMDEX_ROOT_PATH . '/inc/pipeline/iterators/I_PipeTransitions.class.php');

/**
 *
 * @brief Describes one Pipeline process
 *
 * Describes one Pipeline process, one pipeline is actually formed by various
 * processes, it is reccomended every transition for a single processes to have same cache status.
 *
 */
class PipeProcess extends PipeProcessOrm
{
    /**
     * @var $transitions I_PipeTransitions
     */
    var $transitions;

    /**
     * Load a pipeline by name instead of by id
     *
     * @param $name
     * @return boolean
     */
    function loadByName($name)
    {
        if (empty($name)) {
            XMD_Log::error('Se ha solicitado la carga de un proceso sin introducir su nombre');
            return false;
        }

        $result = $this->find('id', 'Name = %s', array($name), MONO);
        if (count($result) == 1) {
            $this->PipeProcess($result[0]);
            return true;
        }
        return false;
    }<commit_msg>Fixed PipeProcess loadByName<commit_after><?php
/**
 *  \details &copy; 2011  Open Ximdex Evolution SL [http://www.ximdex.org]
 *
 *  Ximdex a Semantic Content Management System (CMS)
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published
 *  by the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  See the Affero GNU General Public License for more details.
 *  You should have received a copy of the Affero GNU General Public License
 *  version 3 along with Ximdex (see LICENSE file).
 *
 *  If not, visit http://gnu.org/licenses/agpl-3.0.html.
 *
 * @author Ximdex DevTeam <<EMAIL>>
 * @version $Revision$
 */


namespace Ximdex\Models;

use I_PipeTransitions;
use Ximdex\Models\ORM\PipeProcessOrm;
use Ximdex\Logger as XMD_Log ;


require_once(XIMDEX_ROOT_PATH . '/inc/pipeline/iterators/I_PipeTransitions.class.php');

/**
 *
 * @brief Describes one Pipeline process
 *
 * Describes one Pipeline process, one pipeline is actually formed by various
 * processes, it is reccomended every transition for a single processes to have same cache status.
 *
 */
class PipeProcess extends PipeProcessOrm
{
    /**
     * @var $transitions I_PipeTransitions
     */
    var $transitions;

    /**
     * Load a pipeline by name instead of by id
     *
     * @param $name
     * @return boolean
     */
    public function loadByName($name)
    {
        if (empty($name)) {
            XMD_Log::error('Se ha solicitado la carga de un proceso sin introducir su nombre');
            return false;
        }

        $result = $this->find('id', 'Name = %s', array($name), MONO);
        if (count($result) == 1) {
            $this->__construct($result[0]);
            return true;
        }
        return false;
    }
{'fraction_non_alphanumeric': 0.09348441926345609, 'fraction_numerical': 0.004721435316336166, 'mean_word_length': 2.919518963922294, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7568226', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1237, 'n_words': 472}