Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for database file storage #75

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mikeschaekermann
Copy link

@tzyganu , we are making use of your UMC in our e-commerce company a lot. So first of all, thanks for creating this awesome and very helpful resource! Today, I will file some pull requests of contributions that we would like to offer from our time working with the extension. The first contribution is support for database file storage. We tested it in production and, for us, it worked fine!

@tzyganu
Copy link
Owner

tzyganu commented Jan 13, 2015

@mikeschaekermann Thanks for the kind words and the pull requests. I will review them as soon as possible and merge them if I don't find any issues.

I already took a look at the mass copy to store view aciton and I think something is wrong (I'm not exactly sure, I just want to get this by you). Does the massCopyToStoreViewAction get generated for all entities flat entities, or just for those that have a relation to the store views? It seams to me that it will be generated for all entities. please try to create an entity that has the flag Enable by stores (See this wiki page for details) set to 'No' and see if the massCopyToStoreViewAction gets generated. (sorry for the duplicate e-mail...I used the wrong github account to comment the first time)

@mikeschaekermann
Copy link
Author

@tzyganu thanks for looking into the pull request so quickly. You're right. The code is not cleanly encapsulated for FLAT + NOT TREE entities only. This is true for both the preview feature and the mass copy feature. In the umc_source.xml I was looking for depend statements that would help me to further specify for what kinds of entities individual changes should be applied. The ones I found were:

  • is_flat
  • is_eav
  • is_tree
  • not_is_tree
  • store
  • allow_comment_by_store
  • allow_comment

I think I will need your assistance here. How can I distinguish between "Enable by stores: YES/NO" entities in umc_source.xml?

@tzyganu
Copy link
Owner

tzyganu commented Jan 13, 2015

@mikeschaekermann At a first glance I think that what you are looking for is is_flat, not_is_tree and store.

So if you add an other file the <depend> tag should have as child nodes all 3 elements listed above.

@mikeschaekermann
Copy link
Author

@tzyganu thank you! This should be sufficient in order to restrict the mass copy to store view feature to entites of type FLAT + NOT TREE + ENABLED BY STORE. For the preview feature, I would like to have two different files for ENABLED BY STORE: YES and NO. Hence, my question: is there an inverse option of store, maybe not_store?

@mikeschaekermann
Copy link
Author

@tzyganu for the preview feature, I would like to have two different files for ENABLED BY STORE: YES and NO. Is there an inverse option of store, e.g. something like not_store?

@tzyganu
Copy link
Owner

tzyganu commented Jan 19, 2015

You can add a new method in Ultimate_ModuleCreator_Model_Entity like this:

public function getNotStore() 
{
    return !$this->getStore();
}

then you can use the condition in xml like <not_store />

@mikeschaekermann
Copy link
Author

Oh nice! Thanks for that hint!

@mikeschaekermann
Copy link
Author

Actually, there already seems to be a method fulfilling that purpose:

    /**
     * check if the entity is not store related
     *
     * @access public
     * @return bool
     * @author Marius Strajeru <ultimate.module.creator@gmail.com>
     */
    public function getNoStore()
    {
        return !$this->getStore();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants