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

New Association table #97

Closed
wants to merge 3 commits into from
Closed

Conversation

andrepereiradasilva
Copy link
Owner

@andrepereiradasilva andrepereiradasilva commented Oct 23, 2016

Summary of Changes

New Association Table for managing associations.
Can be further improved if needed.

Testing Instructions

Store associations.

$table = JTable::getInstance('Association');
$table->storeAll('com_content.item', array('en-GB' => 2, 'pt-PT' => 12, 'fr-PT' => 18));

Load associations.

$table = JTable::getInstance('Association');
$results = $table->loadAll(array('id' => 2, 'context' => 'com_content.item'), '#__content'));
print_r($results);

And also the usual JTable methods.

Load a particular association.

$table = JTable::getInstance('Association');
$table->load(array('id' => 2, 'context' => 'com_content.item'));
echo $table->id . '|' . $table->context . '|' . $table->key;

Update a particular association.

$table = JTable::getInstance('Association');
$table->load(array('id' => 2, 'context' => 'com_content.item'));
$table->key = 'testkey';

// Bind, check and store the data.
if (!$table->check() || !$table->store())
{
    return false;
}
echo $table->id . '|' . $table->context . '|' . $table->key;

Delete a particular association.

$table = JTable::getInstance('Association');
$table->load(array('id' => 2, 'context' => 'com_content.item'));

// Bind, check and store the data.
if (!$table->delete())
{
    return false;
}

Documentation Changes Required

The ususal.

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.

1 participant