{"id":26351983,"url":"https://github.com/denq/yii2-record-replacer","last_synced_at":"2025-03-16T10:36:07.749Z","repository":{"id":56965801,"uuid":"47203198","full_name":"DenQ/yii2-record-replacer","owner":"DenQ","description":"Record replacer a component for safe add new records or replacing that already exists","archived":false,"fork":false,"pushed_at":"2015-12-12T14:18:46.000Z","size":5,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-25T00:14:54.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DenQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-01T16:44:14.000Z","updated_at":"2015-12-04T17:24:42.000Z","dependencies_parsed_at":"2022-08-21T06:10:16.843Z","dependency_job_id":null,"html_url":"https://github.com/DenQ/yii2-record-replacer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenQ%2Fyii2-record-replacer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenQ%2Fyii2-record-replacer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenQ%2Fyii2-record-replacer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DenQ%2Fyii2-record-replacer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DenQ","download_url":"https://codeload.github.com/DenQ/yii2-record-replacer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858929,"owners_count":20359259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-16T10:36:07.091Z","updated_at":"2025-03-16T10:36:07.721Z","avatar_url":"https://github.com/DenQ.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yii2-recod-replacer\nRecord replacer a component for safe add new records or replacing that already exists\n\n# Install\n```sh\n    composer require \"denq/yii2-record-replacer\"\n```\n\n# Configure\n```php\n    'components' =\u003e [\n        'RecordReplacer' =\u003e [\n            'class' =\u003e 'RecordReplacer\\RecordReplacer',\n        ],\n        ...\n    ]\n```\n\n# Usage\n```php\n    Yii::$app-\u003eRecordReplacer-\u003eRun($model, $fields, $primary)\n```\n\n* $model\n    * type: \\yii\\db\\ActiveRecord\n    * description: your active record model\n    * required: true\n\n\n* $fields\n    * type: array\n    * description: array with fields and values\n    * required: true\n\n\n* $primary\n    * type: array\n    * description: searchable fields\n    * required: false\n    * default value: []\n\n\n# Example\n```php\n    Yii::$app-\u003eRecordReplacer-\u003eRun(new CustomModel, [\n        'field_1' =\u003e 'val 1',\n        'field_2' =\u003e 'val 2',\n        ...\n        'field_n' =\u003e 'val n',\n    ], [\n        'field_n'\n    ]);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenq%2Fyii2-record-replacer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenq%2Fyii2-record-replacer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenq%2Fyii2-record-replacer/lists"}