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

Fix transaction status collection not filtered very efficiently #502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ma4nn
Copy link

@ma4nn ma4nn commented Aug 25, 2024

This PR fixes a huge performance drawback introduced by the change in 5231b7ff in the transaction status controller.

The issue is caused by the fact that the collection is not filtered on database level resulting in all status entries being loaded.

@leissbua
Copy link

leissbua commented Dec 4, 2024

Guys at Payone should merge this, the current way is quite stupid, as they load the whole collection each time:

    /**
     * Search all items by field value
     *
     * @param   string $column
     * @param   mixed $value
     * @return  array
     */
    public function getItemsByColumnValue($column, $value)
    {
        $this->load();

        $res = [];
        foreach ($this as $item) {
            if ($item->getData($column) == $value) {
                $res[] = $item;
            }
        }
        return $res;
    }

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