Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Junaid Rahman pv
test-project
Commits
38ee261d
Commit
38ee261d
authored
Aug 31, 2016
by
dianc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Category Files Model
parent
b2a7a2fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
6 deletions
+81
-6
CategoryFiles.php
common/models/CategoryFiles.php
+75
-0
CategoryFilesQuery.php
common/models/query/CategoryFilesQuery.php
+6
-6
No files found.
common/models/CategoryFiles.php
0 → 100644
View file @
38ee261d
<?php
namespace
common\models
;
use
Yii
;
/**
* This is the model class for table "{{%category_files}}".
*
* @property integer $id
* @property integer $category_id
* @property string $code
* @property string $type
* @property string $name
* @property integer $created_at
* @property integer $updated_at
*
* @property Category $category
*/
class
CategoryFiles
extends
\yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public
static
function
tableName
()
{
return
'{{%category_files}}'
;
}
/**
* @inheritdoc
*/
public
function
rules
()
{
return
[
[[
'category_id'
,
'code'
],
'required'
],
[[
'category_id'
,
'created_at'
,
'updated_at'
],
'integer'
],
[[
'code'
,
'type'
,
'name'
],
'string'
,
'max'
=>
32
],
[[
'category_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
Category
::
className
(),
'targetAttribute'
=>
[
'category_id'
=>
'id'
]],
];
}
/**
* @inheritdoc
*/
public
function
attributeLabels
()
{
return
[
'id'
=>
Yii
::
t
(
'app'
,
'ID'
),
'category_id'
=>
Yii
::
t
(
'app'
,
'Category ID'
),
'code'
=>
Yii
::
t
(
'app'
,
'Code'
),
'type'
=>
Yii
::
t
(
'app'
,
'Type'
),
'name'
=>
Yii
::
t
(
'app'
,
'Name'
),
'created_at'
=>
Yii
::
t
(
'app'
,
'Created At'
),
'updated_at'
=>
Yii
::
t
(
'app'
,
'Updated At'
),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public
function
getCategory
()
{
return
$this
->
hasOne
(
Category
::
className
(),
[
'id'
=>
'category_id'
]);
}
/**
* @inheritdoc
* @return \common\models\query\CategoryFilesQuery the active query used by this AR class.
*/
public
static
function
find
()
{
return
new
\common\models\query\CategoryFilesQuery
(
get_called_class
());
}
}
common/models/
Category
Query.php
→
common/models/
query/CategoryFiles
Query.php
View file @
38ee261d
<?php
<?php
namespace
common\models
;
namespace
common\models
\query
;
/**
/**
* This is the ActiveQuery class for [[
Category
]].
* This is the ActiveQuery class for [[
\common\models\CategoryFiles
]].
*
*
* @see
Category
* @see
\common\models\CategoryFiles
*/
*/
class
CategoryQuery
extends
\yii\db\ActiveQuery
class
Category
Files
Query
extends
\yii\db\ActiveQuery
{
{
/*public function active()
/*public function active()
{
{
...
@@ -16,7 +16,7 @@ class CategoryQuery extends \yii\db\ActiveQuery
...
@@ -16,7 +16,7 @@ class CategoryQuery extends \yii\db\ActiveQuery
/**
/**
* @inheritdoc
* @inheritdoc
* @return
Category
[]|array
* @return
\common\models\CategoryFiles
[]|array
*/
*/
public
function
all
(
$db
=
null
)
public
function
all
(
$db
=
null
)
{
{
...
@@ -25,7 +25,7 @@ class CategoryQuery extends \yii\db\ActiveQuery
...
@@ -25,7 +25,7 @@ class CategoryQuery extends \yii\db\ActiveQuery
/**
/**
* @inheritdoc
* @inheritdoc
* @return
Category
|array|null
* @return
\common\models\CategoryFiles
|array|null
*/
*/
public
function
one
(
$db
=
null
)
public
function
one
(
$db
=
null
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment