<?php
/**
 *  Secioss_Category.php
 *
 *  @author     {$author}
 *  @package    Secioss
 *  @version    $Id: skel.app_object.php,v 1.3 2006/11/06 14:31:24 cocoitiban Exp $
 */
require_once 'Secioss_AppObject.php';

/**
 *  Secioss_CategoryManager
 *
 *  @author     {$author}
 *  @access     public
 *  @package    Secioss
 */
class Secioss_CategoryManager extends Ethna_AppManager
{
}

/**
 *  Secioss_Category
 *
 *  @author     {$author}
 *  @access     public
 *  @package    Secioss
 */
class Secioss_Category extends Secioss_AppObject
{
    /**
     *  プロパティの表示名を取得する
     *
     *  @access public
     */
    function getName($key)
    {
        return $this->get($key);
    }

    function searchProp($keys = null, $filter = null, $order = null,
                        $offset = null, $count = null)
    {
        $conf = $this->config->get('secioss');
        $num = 0;
        $list = array();

        $r = parent::searchProp($keys, $filter, $order, $offset, $count);
        if (Ethna::isError($r)) {
            return $r;
        }

        for ($i = 0; $i < $r[0]; $i++) {
            if (preg_match('/^[^,]+,'.$conf['group']['objectdn'].',/i', $r[1][$i])) {
                $num++;
                $list[] = $r[1][$i];
            }
        }

        return array($num, $list);
    }
}
?>
