source: pro-violet-viettel/sourcecode/api.violet.vn/www/lib/model/Tblspacefile.php @ 289

Last change on this file since 289 was 289, checked in by dungnv, 11 years ago
File size: 984 bytes
Line 
1<?php
2
3/**
4 * Subclass for representing a row from the 'tblspacefile' table.
5 *
6 *
7 *
8 * @package lib.model
9 */
10class Tblspacefile extends BaseTblspacefile
11{
12        /**
13         * Initializes internal state of Tblspacefile object.
14         * @see        parent::__construct()
15         */
16        public function __construct()
17        {
18                // Make sure that parent constructor is always invoked, since that
19                // is where any default values for this object are set.
20                parent::__construct();
21        }
22
23  public function setFileName($v) {
24    parent::setFileName($v);
25    $dotPos = strrpos($v, '.');
26    if ($dotPos !== false) $this->setFileType(strtolower(substr($v, $dotPos + 1)));
27  }
28
29  public function delete(PropelPDO $con = null) {
30    $resId = $this->getFileResource();
31    parent::delete($con);
32
33    $c1 = new Criteria();
34    $c1->add(TblspacefilePeer::FILE_RESOURCE, $resId);
35    if (TblspacefilePeer::doCount($c1) == 0) {
36      $tblres = TblspaceresourcePeer::retrieveByPk($resId);
37      $tblres->delete($con);
38    }
39  }
40}
Note: See TracBrowser for help on using the repository browser.