Creating categories in code
I'm setting up a site which will populate categories and collections from a third party, via it's API. In code, I want to create new categories. To do so, it looks like I should be able to use PerchCategories_Categories->find_or_create. However, in the current version of Runway (3.0.9) it doesn't seem right - though of course I might just be misusing the method :)
I'm calling it like:
$Categories = new PerchCategories_Categories($API);
$NewCategory = find_or_create('property-location/matts-newtown', 'matts-newtown', $Categories );
There seems to be two problems: First, I think there's an erroneous array_pop on line 41, which causes one of the values sent to create to be empty; And secondly, the data passed in to the create function at the end of find_or_create is lacking a catDynamicFields value, which causes the error "Invalid query: SQLSTATE[HY000]: General error: 1364 Field 'catDynamicFields' doesn't have a default value"
Hope that's of interest, or someone can correct my use of the method?