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

Model tables can now have prefixes #12795

Merged
merged 1 commit into from Apr 15, 2017
Merged

Model tables can now have prefixes #12795

merged 1 commit into from Apr 15, 2017

Conversation

sergeyklay
Copy link
Member

@sergeyklay sergeyklay commented Apr 14, 2017

use Phalcon\Mvc\Model\Manager;

$di->set("modelsManager", function () {
    $modelsManager = new Manager();
    $modelsManager->setModelPrefix("wp_");

    return $modelsManager;
});

$robots = new Robots();
echo $robots->getSource(); // wp_robots

NOTE: After that to override a model's source developers can only use:

public function initialize()
{
    $this->setSource('new_source');
}

@sergeyklay sergeyklay merged commit 7b8f42b into phalcon:3.2.x Apr 15, 2017
@sergeyklay sergeyklay deleted the model-manager-prefix branch April 15, 2017 06:48
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.

None yet

1 participant