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

Import/Export Sync #63

Merged
merged 1 commit into from
Nov 10, 2015
Merged

Import/Export Sync #63

merged 1 commit into from
Nov 10, 2015

Conversation

jsirish
Copy link
Member

@jsirish jsirish commented Nov 10, 2015

Matched fields in LocationAdmin::getExportFields() with LocationCsvBulkLoader.

Can now export easily from one Locator installation to another without data loss or reformatting column headers in CSV

fixes #59

'Category.Name' => array(
'relationname' => 'Category',
'callback' => 'getCatByName',
),
);

public static function getCatByName(&$obj, $val, $record)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's picky, but we can probably go full words for the getter functions.

@muskie9
Copy link
Member

muskie9 commented Nov 10, 2015

For the category by name logic, we can consolidate it a bit by doing:

        if (!LocationCategory::get()->filter(array('Name' => $val))->first()->exists()) {
            $category = LocationCategory::create();
            $category->Name = $val;
            $category->write();
        }

Matched fields in LocationAdmin::getExportFields() with LocationCsvBulkLoader.

Can now export easily from one Locator installation to another without data loss or reformatting column headers in CSV

fixes dynamic#59
jsirish added a commit that referenced this pull request Nov 10, 2015
@jsirish jsirish merged commit fa7f029 into dynamic:master Nov 10, 2015
@jsirish jsirish deleted the feature/import branch February 11, 2017 02:38
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.

Import/Export doesn't match
2 participants