<commit_before><?php

class Meanbee_Core_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
{

    /**
     * Create a new CMS static block.
     *
     * @param string $identifier
     * @param string $title
     * @param string $content
     * @param int[]  $stores
     *
     * @return $this
     */
    public function createCmsBlock($identifier, $title, $content, $stores = array(0))
    {
        return $this;
    }

    /**
     * Update an existing CMS block.
     *
     * @param string $identifier
     * @param array  $data A key => value list of new data to assign to the block.
     *
     * @return $this
     */
    public function updateCmsBlock($identifier, $data)
    {
        return $this;
    }

    /**
     * Create a new CMS page.
     *
     * @param string $identifier
     * @param string $title
     * @param string $content
     * @param string $rootTemplate
     * @param string $contentHeading
     * @param string $metaKeywords
     * @param string $metaDescription
     * @param string $layoutUpdateXml
     * @param int[]  $stores
     *
     * @return $this
     */
    public function createCmsPage(
        $identifier,
        $title,
        $content,
        $rootTemplate,
        $contentHeading = "",
        $metaKeywords = "",
        $metaDescription = "",
        $layoutUpdateXml = "",
        $stores = array(0)
    ) {
        return $this;<commit_msg>Add methods to create and update CMS blocks<commit_after><?php

class Meanbee_Core_Model_Resource_Setup extends Mage_Catalog_Model_Resource_Setup
{

    /**
     * Create a new CMS static block.
     *
     * @param string $identifier
     * @param string $title
     * @param string $content
     * @param int[]  $stores
     *
     * @return $this
     */
    public function createCmsBlock($identifier, $title, $content, $stores = array(0))
    {
        $current_store = Mage::app()->getStore();
        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

        Mage::getModel("cms/block")
            ->setData(array(
                "identifier" => $identifier,
                "title"      => $title,
                "content"    => $content,
                "is_active"  => 1,
                "stores"     => $stores
            ))
            ->save();

        Mage::app()->setCurrentStore($current_store);
        return $this;
    }

    /**
     * Update an existing CMS block.
     *
     * @param string   $identifier
     * @param array    $data     A key => value list of new data to assign to the block.
     * @param int|null $storeId  Store the block is currently assigned to
     *
     * @return $this
     */
    public function updateCmsBlock($identifier, $data, $storeId = null)
    {
        $current_store = Mage::app()->getStore();
        Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

        $block = Mage::getModel("cms/block");
        if ($storeId) {
            $block->setStoreId($storeId);
        }
        $block->load($identifier);

        if ($block->getId()) {
            $block
                ->addData($data)
                ->save();
        } else {
            Mage::throwException(sprintf("Can not update CMS block: CMS block '%s' does not exist.", $identifier));
        }

        Mage::app()->setCurrentStore($current_store);
        return $this;
    }

    /**
     * Create a new CMS page.
     *
     * @param string $identifier
     * @param string $title
     * @param string $content
     * @param string $rootTemplate
     * @param string $contentHeading
     * @param string $metaKeywords
     * @param string $metaDescription
     * @param string $layoutUpdateXml
     * @param int[]  $stores
     *
     * @return $this
     */
    public function createCmsPage(
        $identifier,
        $title,
        $content,
        $rootTemplate,
        $contentHeading = "",
        $metaKeywords = "",
        $metaDescription = "",
        $layoutUpdateXml = "",
        $stores = array(0)
    ) {
        return $this;
{'fraction_non_alphanumeric': 0.12286351250928908, 'fraction_numerical': 0.0012385434728758979, 'mean_word_length': 1.9517543859649122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '6959144', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1164, 'n_words': 291}