PHPackages                             kharanenka/oc-data-file-model - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. kharanenka/oc-data-file-model

ActiveLibrary[File &amp; Storage](/categories/file-storage)

kharanenka/oc-data-file-model
=============================

Trait helps to get attached to the model file data

1.1.0(8y ago)338.5k↓27.8%1GPL-3.0PHPPHP &gt;=5.6

Since Nov 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kharanenka/oc-data-file-model)[ Packagist](https://packagist.org/packages/kharanenka/oc-data-file-model)[ RSS](/packages/kharanenka-oc-data-file-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (1)

Trait DataFileModel
===================

[](#trait-datafilemodel)

Trait helps to get attached to the model file data. For 'attache one' relation returns data array with fields:

- (string) full\_path
- (string) path
- (string) title
- (string) alt

For 'attache many' relation returns array with files data.

\#Installation Require this package in your `composer.json` and update composer.

```

"kharanenka/oc-data-file-model": "1.*"

```

\#Uses

```
class MyModel extends Model
{
    use DataFileModel;

    public $attachOne = ['preview_image' => 'System\Models\File'];
    public $attachMany = ['images' => 'System\Models\File'];
}

$obModel = MyModel::first();
$arFileData = $obModel->getFileData('preview_image');
$arFileList = $obModel->getFileListData('images');
```

Result:

```
$arFileData = [
    'full_path' => '...',
    'path'      => '...',
    'title'     => '...',
    'alt'       => '...',
];

$arFileList = [
    [
        'full_path' => '...',
        'path'      => '...',
        'title'     => '...',
        'alt'       => '...',
    ],[
        'full_path' => '...',
        'path'      => '...',
        'title'     => '...',
        'alt'       => '...',
    ],
];
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~287 days

Total

2

Last Release

3186d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f72dfe2a14224cf1e368ddefcd7886bbe7be751a21fe77227175ba21ebfab823?d=identicon)[Andrey Kharanenka](/maintainers/Andrey%20Kharanenka)

---

Top Contributors

[![kharanenka](https://avatars.githubusercontent.com/u/18258760?v=4)](https://github.com/kharanenka "kharanenka (1 commits)")

---

Tags

phpmodelfileoctobercmsattache

### Embed Badge

![Health badge](/badges/kharanenka-oc-data-file-model/health.svg)

```
[![Health](https://phpackages.com/badges/kharanenka-oc-data-file-model/health.svg)](https://phpackages.com/packages/kharanenka-oc-data-file-model)
```

###  Alternatives

[blueimp/jquery-file-upload

File Upload widget for jQuery.

141.5M18](/packages/blueimp-jquery-file-upload)[davaxi/vcalendar

PHP Class to generate VCalendar (ics) file

1180.8k](/packages/davaxi-vcalendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
